protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { LoanDSTableAdapters.AuditorsTableAdapter auditors = new LoanDSTableAdapters.AuditorsTableAdapter(); if (!(type == "update")) { auditors.InsertAuditor(MySessionManager.ClientID, MySessionManager.AppID, txtName.Value.Trim(), txtAddress.Value.Trim(), Convert.ToInt32(ddlAuditors_solicitors.Text), MySessionManager.CurrentUser.UserID); this.editskip.Value = "1"; } else if (type == "update") { auditors.UpdateAuditors(txtName.Value.Trim(), txtAddress.Value.Trim(), Convert.ToInt32(ddlAuditors_solicitors.Text), id); this.editskip.Value = "1"; } Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "auedit")); } }
public void loadAuditors(int ID) { LoanDSTableAdapters.AuditorsTableAdapter auditors = new LoanDSTableAdapters.AuditorsTableAdapter(); LoanDS.AuditorsDataTable tblAuditors = auditors.GetAuditors(MySessionManager.ClientID, MySessionManager.AppID); if (tblAuditors.Rows.Count > 0) { txtName.Value = tblAuditors[0].datAuditorName.ToString(); txtAddress.Value = tblAuditors[0].datAddress.ToString(); if (tblAuditors[0].datAORS > 0) { ddlAuditors_solicitors.SelectedValue = tblAuditors[0].datAORS.ToString(); } this.editskip.Value = "2"; } }