protected void grdBillDetails_RowUpdating(object sender, GridViewUpdateEventArgs e) { try { dvMsg.Visible = false; ddlYear1.Visible = false; GridViewRow row = grdBillDetails.Rows[e.RowIndex]; TextBox txtBillAmount = (TextBox)row.FindControl("txtBillAmount"); Label lblBillId = (Label)row.FindControl("lblBillId"); Int64 BillId = Convert.ToInt64(lblBillId.Text); TMSTelephoneBillDetails objBillDetails = TMSTelephoneBillDetails.Get(BillId); if (objBillDetails != null) { objBillDetails.TBDBillAmount = Convert.ToInt64(txtBillAmount.Text); objBillDetails.Update(); BindBillGridview(); grdBillDetails.EditIndex = -1; dvMsg.Visible = true; lblMessage.Text = "Record Updated Successfully"; dvMsg.Attributes.Add("class", "warring_msg"); BindBillGridview(); } } catch (Exception ex) { } }
protected void grdBillDetails_RowCommand(object sender, GridViewCommandEventArgs e) { try { string cmdName = e.CommandName.ToString(); if (cmdName == "Edit1") { Int64 BillId = Convert.ToInt64(e.CommandArgument); grdBillDetails.Visible = false; fieldsetAddBill.Visible = true; btnSave.Text = "Update"; TMSTelephoneBillDetails objBillDetails = TMSTelephoneBillDetails.Get(BillId); if (objBillDetails != null) { Int64 TelephoneId = Convert.ToInt64(objBillDetails.TBDTelephoneId); TMSTelephoneDetails obj = TMSTelephoneDetails.Get(TelephoneId); if (obj != null) { ddlType.SelectedValue = obj.TDTelephoneDepartment; BindTelephoneNo(); } ddlPhone.SelectedValue = Convert.ToString(objBillDetails.TBDTelephoneId); txtBill.Text = Convert.ToString(objBillDetails.TBDBillAmount); ddlMonth.SelectedValue = objBillDetails.TBDMonth; ddlYear.SelectedValue = objBillDetails.TBDYear; objBillDetails.Update(); } } } catch (Exception ex) { } }
public static void Update(TMSTelephoneBillDetails tMSTelephoneBillDetails, DbTransaction transaction) { tMSTelephoneBillDetails.Update(transaction); }
public static void Update(TMSTelephoneBillDetails tMSTelephoneBillDetails) { tMSTelephoneBillDetails.Update(); }