protected void btn_Save_Click(object sender, EventArgs e) { try { _obj_SMHR_TC = new SMHR_LOAN_TERMS(); _obj_SMHR_TC.LOAN_TC = BLL.ReplaceQuote(rtxtTermsAndCond.Text); _obj_SMHR_TC.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_TC.CREATEDBY = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session _obj_SMHR_TC.CREATEDDATE = DateTime.Now; _obj_SMHR_TC.LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session _obj_SMHR_TC.LASTMDFDATE = DateTime.Now; switch (((Button)sender).ID.ToUpper()) { case "BTN_UPDATE": _obj_SMHR_TC.LOAN_TERM_ID = Convert.ToInt32(hdnAssemblyMissionID.Value); _obj_SMHR_TC.OPERATION = operation.Update; if (BLL.set_LoanTerms(_obj_SMHR_TC)) { BLL.ShowMessage(this, "Information Updated Successfully"); } else { BLL.ShowMessage(this, "Information Not Updated"); } break; case "BTN_SAVE": _obj_SMHR_TC.OPERATION = operation.Insert; if (BLL.set_LoanTerms(_obj_SMHR_TC)) { BLL.ShowMessage(this, "Information Saved Successfully"); LoadTermsAndCond(); } else { BLL.ShowMessage(this, "Information Not Saved"); } break; default: break; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_LoanTermsandCond", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadTermsAndCond() { try { _obj_SMHR_TC = new SMHR_LOAN_TERMS(); _obj_SMHR_TC.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_TC.OPERATION = operation.Select; DataTable dt = BLL.get_LoanTerms(_obj_SMHR_TC); if (dt.Rows.Count > 0) { rtxtTermsAndCond.Text = dt.Rows[0]["LOAN_TC"].ToString(); hdnAssemblyMissionID.Value = dt.Rows[0]["LOAN_TC_ID"].ToString(); btn_Save.Visible = false; btn_Update.Visible = true; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_LoanTermsandCond", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }