protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { LoanDSTableAdapters.NextOfKinsTableAdapter NextOfKin = new LoanDSTableAdapters.NextOfKinsTableAdapter(); if (!(type == "update")) { NextOfKin.InsertNextOfKin(MySessionManager.ClientID, MySessionManager.AppID, txtfullname.Value.Trim(), txtMobile.Value.Trim(), txtHomeTel.Value.Trim(), txtOfficeTel.Value.Trim(), txtEmail.Value.Trim(), Convert.ToDecimal(txtpercentageshare.Value.Trim()), txtAddress.Value.Trim(), MySessionManager.CurrentUser.UserID, txtRelationship.Value.Trim()); } else if (type == "update") { NextOfKin.UpdateNextOfKin(txtfullname.Value.Trim(), txtMobile.Value.Trim(), txtHomeTel.Value.Trim(), txtOfficeTel.Value.Trim(), txtEmail.Value.Trim(), Convert.ToDecimal(txtpercentageshare.Value.Trim()), txtAddress.Value.Trim(), id, txtRelationship.Value.Trim()); } Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "nedit")); } }
public void loadNOK(int id) { LoanDSTableAdapters.NextOfKinsTableAdapter nok = new LoanDSTableAdapters.NextOfKinsTableAdapter(); LoanDS.NextOfKinsDataTable tblnok = nok.GetNextOfKinDetails(id); if (tblnok.Rows.Count > 0) { try { this.editskip.Value = "2"; txtfullname.Value = tblnok[0].datFullName.ToString(); txtHomeTel.Value = tblnok[0].datHomeTelephoneNumber.ToString(); txtOfficeTel.Value = tblnok[0].datOfficeTelephoneNumber.ToString(); txtMobile.Value = tblnok[0].datMobileNumber.ToString(); txtpercentageshare.Value = tblnok[0].datPercentageShare.ToString(); txtEmail.Value = tblnok[0].datEmailAddress.ToString(); txtAddress.Value = tblnok[0].datAddress.ToString(); txtRelationship.Value = tblnok[0].datRelationship.ToString(); } catch (Exception ex) { } } }