private void UpdateAssetNumber(string requestId) { clsDatabase objDb = new clsDatabase(); clsUtility objUtil = new clsUtility(); SendEmail objMail = new SendEmail(); SqlTransaction objTrans; string TableName = "Assets_Requisition_Detail_Controller"; string FieldsName = string.Empty; string FieldsValue = string.Empty; string todayDate = objUtil.fncGetDate(); bool flg = false; try { objDb.fncOpenConnection(); objTrans = objDb.cnnConnection.BeginTransaction(); FieldsName = "Asset_No$"; foreach (GridViewRow row in grdEntry.Rows) { Label lblDetailId = row.FindControl("lblDetailId") as Label; TextBox txtAssetNo = row.FindControl("txtAssetNo") as TextBox; FieldsValue = "'" + txtAssetNo.Text + "'$'"; flg = objDb.fncModifyRecord(TableName, FieldsName, FieldsValue, "Request_Id= " + requestId + " AND IsActive = 'TRUE' AND Detail_Id = " + lblDetailId.Text, ref objDb.cnnConnection, ref objTrans); if (!flg) { break; } } if (flg) { flg = UpdateRquestStatus(lblPk.Text, ref objDb.cnnConnection, ref objTrans); } if (flg) { objTrans.Commit(); SearchRequest(); pnlNew.Visible = false; pnlSearch.Visible = true; lblMsg.Text = objUtil.fncGetErrorDesc(1); objMail.SendCodeOpenedEmail("ASSET", Convert.ToInt32(lblPk.Text)); } else { objTrans.Rollback(); lblMsg.Text = objUtil.fncGetErrorDesc(-1); } pnlMsg.Visible = true; } catch (Exception ex) { throw ex; } finally { objDb.fncCloseConnection(objDb.cnnConnection); objTrans = null; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)