protected void LoadMainGrid() { try { _obj_Smhr_Payitems = new SMHR_PAYITEMS(); _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); //Rg_PayItems.DataSource = BLL.get_PayItems(_obj_Smhr_Payitems); if (BLL.get_PayItems(_obj_Smhr_Payitems).Rows.Count > 0) { Rg_PayItems.DataSource = BLL.get_PayItems(_obj_Smhr_Payitems); } else { DataTable dt = new DataTable(); Rg_PayItems.DataSource = dt; } ///Please donot change the sequence in the binded values, there is a big functionality ahead, be careful :0/// Rm_PayItem_page.SelectedIndex = 0; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayItemDefine", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void lnk_Delete_Command(object sender, CommandEventArgs e) { try { _obj_Smhr_Payitems = new SMHR_PAYITEMS(); _obj_Smhr_Payitems.PAYITEM_ID = Convert.ToInt32(Convert.ToString(e.CommandArgument)); _obj_Smhr_Payitems.ISDELETED = true; _obj_Smhr_Payitems.PAYITEM_LASTMDFBY = 1; // Need to Change _obj_Smhr_Payitems.PAYITEM_LASTMDFDATE = DateTime.Now; //TO CHECK WHETHER THE PAYITEM IS BEING USED OR NOT BEOFRE DELETE IT, BY SRAVANI 28.03.2011 _obj_Smhr_Payitems.OPERATION = operation.Check_New; if (Convert.ToString(BLL.get_PayItems(_obj_Smhr_Payitems).Rows[0]["Count"]) != "0") { BLL.ShowMessage(this, "You can not Delete this Pay Item"); return; } _obj_Smhr_Payitems.OPERATION = operation.Delete; _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); if (BLL.set_PayItems(_obj_Smhr_Payitems)) { BLL.ShowMessage(this, "Record deleted Successfully"); } else { BLL.ShowMessage(this, "Record not deleted"); } LoadMainGrid(); Rg_PayItems.DataBind(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayItemDefine", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_selectpayitemhead_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { //to load payitems _obj_Smhr_Payitems = new SMHR_PAYITEMS(); DataTable dt_Recurring = new DataTable(); _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_Smhr_Payitems.OPERATION = operation.Select1; dt_Recurring = BLL.fetch_PayItems(_obj_Smhr_Payitems); DataTable dt_rec_new = new DataTable(); for (int i = 0; i < dt_Recurring.Rows.Count; i++) { if (Convert.ToInt32(dt_Recurring.Rows[i]["PAYITEM_ID"]) == Convert.ToInt32(rcmb_selectpayitemhead.SelectedItem.Value)) { dt_Recurring.Rows[i].Delete(); } } chck_Payitems.DataSource = dt_Recurring; chck_Payitems.DataValueField = "PAYITEM_ID"; chck_Payitems.DataTextField = "PAYITEM_PAYITEMNAME"; chck_Payitems.DataBind(); chck_Payitems.Visible = true; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "bonus", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadLoanType() { try { SMHR_PAYITEMS _obj_Smhr_BusinessUnit = new SMHR_PAYITEMS(); string loanType = string.Empty; if (Request.QueryString.HasKeys()) { loanType = Convert.ToString(Request.QueryString["LoanType"]); } if (loanType == "SpecialLoan") { _obj_Smhr_BusinessUnit.OPERATION = operation.Get; _obj_Smhr_BusinessUnit.MODE = 1; //Special Loan } else if (loanType == "CombinedLoan") { _obj_Smhr_BusinessUnit.OPERATION = operation.Get; _obj_Smhr_BusinessUnit.MODE = 2; //Combined Loan } else if (loanType == "CarAdvanceAndMortgage") { _obj_Smhr_BusinessUnit.OPERATION = operation.Get; _obj_Smhr_BusinessUnit.MODE = 3; //"CarAdvance And Mortgage Loan Account Statement" } else { //_obj_Smhr_BusinessUnit.OPERATION = operation.Check1; _obj_Smhr_BusinessUnit.OPERATION = operation.Get; _obj_Smhr_BusinessUnit.MODE = 4; //All Loans } //SMHR_PAYITEMS _obj_Smhr_BusinessUnit = new SMHR_PAYITEMS(); //_obj_Smhr_BusinessUnit.OPERATION = operation.Check1; _obj_Smhr_BusinessUnit.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); rcmb_LoanType.Items.Clear(); rcmb_LoanType.DataSource = BLL.get_PayItems(_obj_Smhr_BusinessUnit); rcmb_LoanType.DataTextField = "PAYITEM_PAYITEMNAME"; rcmb_LoanType.DataValueField = "PAYITEM_ID"; rcmb_LoanType.DataBind(); if (loanType == "CombinedLoan") { rcmb_LoanType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("All", "-1")); } else { rcmb_LoanType.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "LoanDetails", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void rc_FinalicalPeriod_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rc_financialPeriod.SelectedIndex > 0) { RG_TrainingApproval.Visible = true; btn_submit.Visible = true; btn_Cancel.Visible = true; SMHR_PAYITEMS _obj_Smhr_PayItems = new SMHR_PAYITEMS(); _obj_Smhr_PayItems.OPERATION = operation.Check2; _obj_Smhr_PayItems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_PayItems.PAYITEM_FINPERIODID = Convert.ToInt32(rc_financialPeriod.SelectedValue); DataTable dt = BLL.get_PayItems(_obj_Smhr_PayItems); RG_TrainingApproval.DataSource = dt; RG_TrainingApproval.DataBind(); RadComboBox rc_LoanProcessType; for (int i = 0; i < RG_TrainingApproval.Items.Count; i++) { rc_LoanProcessType = RG_TrainingApproval.Items[i].FindControl("rc_LoanProcessType") as RadComboBox; //rc_LoanProcessType.SelectedValue = Convert.ToString(dt.Rows[i]["LOANSETUP_LOANPROCESSTYPE"]); rc_LoanProcessType.SelectedIndex = rc_LoanProcessType.Items.FindItemIndexByText(Convert.ToString(dt.Rows[i]["LOANSETUP_LOANPROCESSTYPE"])); } SMHR_PERIOD osmhr_period = new SMHR_PERIOD(); osmhr_period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); osmhr_period.PERIOD_ID = Convert.ToInt32(rc_financialPeriod.SelectedValue); DataTable dtCurrentFinPeriod = BLL.IscurrentFinPeriod(osmhr_period); if (string.Compare(dtCurrentFinPeriod.Rows[0]["ISEXISTS"].ToString(), "0", true) == 0) { RG_TrainingApproval.Enabled = false; btn_submit.Visible = false; btn_Cancel.Visible = false; } else { RG_TrainingApproval.Enabled = true; btn_submit.Visible = true; btn_Cancel.Visible = true; } } else { RG_TrainingApproval.Visible = false; btn_submit.Visible = false; btn_Cancel.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_LoanSetup", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void lnk_Edit_Command(object sender, CommandEventArgs e) { try { clearControls(); BindFinancialPeriod(); //BindLoanTypes(); rad_TypeOfLoan.Enabled = false; RadGrid1.Visible = true; SMHR_LOANELIGIBLEAMOUNT smhr_LoanAmount = new SMHR_LOANELIGIBLEAMOUNT(); smhr_LoanAmount.OPERATION = operation.Get; smhr_LoanAmount.OrgID = Convert.ToInt32(Session["ORG_ID"]); smhr_LoanAmount.LoanID = Convert.ToInt32(e.CommandArgument); DataTable dt = BLL.get_LoanMaxEligibleAmount(smhr_LoanAmount); RadGrid1.DataSource = dt; RadGrid1.DataBind(); if (dt.Rows.Count > 0) { SMHR_PAYITEMS _obj_Smhr_BusinessUnit = new SMHR_PAYITEMS(); _obj_Smhr_BusinessUnit.OPERATION = operation.Check2; _obj_Smhr_BusinessUnit.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt1 = BLL.get_PayItems(_obj_Smhr_BusinessUnit); rad_TypeOfLoan.DataSource = dt1; rad_TypeOfLoan.DataValueField = "PAYITEM_ID"; rad_TypeOfLoan.DataTextField = "PAYITEM_PAYITEMNAME"; rad_TypeOfLoan.DataBind(); rad_TypeOfLoan.Items.Insert(0, new RadComboBoxItem("Select", "-1")); rad_TypeOfLoan.SelectedIndex = rad_TypeOfLoan.FindItemIndexByValue(smhr_LoanAmount.LoanID.ToString()); radFinPeriod.SelectedIndex = radFinPeriod.FindItemIndexByValue(dt.Rows[0]["LOANELIGIBLEAMOUNT_FIN_PERIOD_ID"].ToString()); } SMHR_PERIOD osmhr_period = new SMHR_PERIOD(); osmhr_period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); osmhr_period.PERIOD_ID = Convert.ToInt32(radFinPeriod.SelectedValue); DataTable dtCurrentFinPeriod = BLL.IscurrentFinPeriod(osmhr_period); if (string.Compare(dtCurrentFinPeriod.Rows[0]["ISEXISTS"].ToString(), "0", true) == 0) { RadGrid1.Enabled = false; } else { RadGrid1.Enabled = true; } // trExpend.Visible = false; lbl_ExpenditureID.Text = smhr_LoanAmount.LoanID.ToString(); // rad_ExpenditureName.Text = Convert.ToString(dt.Rows[0]["EXPENDITURE_NAME"]); // rad_ExpenditureName.Enabled = false; // rtxt_ExpenditureDesc.Text = Convert.ToString(dt.Rows[0]["EXPENDITURE_DESC"]); btn_Save.Visible = true; Rm_CY_page.SelectedIndex = 1; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_MaxLoanEligibility", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
//private void LoadBU() //{ // //Business Unit // rcmb_PayBU.Items.Clear(); // _obj_smhr_businessunit = new SMHR_BUSINESSUNIT(); // _obj_smhr_businessunit.OPERATION = operation.Check1; // _obj_smhr_businessunit.BU_LOGIN_ID = Convert.ToInt32(Session["USER_ID"]); // _obj_smhr_businessunit.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); // DataTable dt_BUDetails = BLL.get_BusinessUnit(_obj_smhr_businessunit); // rcmb_PayBU.DataSource = dt_BUDetails; // rcmb_PayBU.DataValueField = "BUSINESSUNIT_ID"; // rcmb_PayBU.DataTextField = "BUSINESSUNIT_CODE"; // rcmb_PayBU.DataBind(); // rcmb_PayBU.Items.Insert(0, new RadComboBoxItem("Select")); //} protected void rtxt_AccountHead_TextChanged(object sender, EventArgs e) { try { _obj_Smhr_Payitems = new SMHR_PAYITEMS(); _obj_Smhr_Payitems.PAYITEM_ACCOUNTHEAD = Convert.ToString(rtxt_AccountHead.Text); _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_Smhr_Payitems.OPERATION = operation.Check1; DataTable dt = BLL.get_PayItems(_obj_Smhr_Payitems); //if (dt.Rows.Count != 0) //{ // if (Convert.ToString(dt.Rows[0][0]) != "0") // { // BLL.ShowMessage(this, "Voter Code Has Been Already Assigned."); // rtxt_AccountHead.Text = string.Empty; // rtxt_AccountHead.Focus(); // return; // } //} //for (int i = 0; i < dt.Rows.Count - 1; i++) //{ // //System.Threading.Thread.Sleep(1000); // if (Convert.ToString(rtxt_AccountHead.Text) == Convert.ToString(dt.Rows[i]["PAYITEM_ACCOUNTHEAD"])) // { // lbl_Request.Visible = true; // lbl_Request.Text = "Account Head is already assigned"; // rtxt_AccountHead.BackColor = System.Drawing.Color.Yellow; // rtxt_AccountHead.Text = string.Empty; // break; // } // else // { // lbl_Request.Visible = false; // rtxt_AccountHead.BackColor = System.Drawing.Color.White; // lbl_Request.Text = string.Empty; // } //} //if (lbl_Request.Text == string.Empty) //{ // rdt_PayItemStartDate.Focus(); //} } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayItemDefine", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadCombos() { try { _obj_smhr_period = new SMHR_PERIOD(); _obj_smhr_period.OPERATION = operation.Select; _obj_smhr_period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Details = BLL.get_PeriodHeaderDetails(_obj_smhr_period); rcmb_payperiod.DataSource = dt_Details; rcmb_payperiod.DataValueField = "PERIOD_ID"; rcmb_payperiod.DataTextField = "PERIOD_NAME"; rcmb_payperiod.DataBind(); rcmb_payperiod.Items.Insert(0, new RadComboBoxItem("Select")); _obj_PayItems = new SMHR_PAYITEMS(); _obj_PayItems.OPERATION = operation.Select; _obj_PayItems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt = BLL.get_PayItems(_obj_PayItems); ddl_Payitems.DataSource = dt; ddl_Payitems.DataTextField = "PAYITEM_PAYITEMNAME"; ddl_Payitems.DataValueField = "PAYITEM_ID"; ddl_Payitems.DataBind(); ddl_Payitems.Items.Insert(0, new RadComboBoxItem("Select")); ddl_BusinessUnit.Items.Clear(); //_obj_BusinessUnit = new SMHR_BUSINESSUNIT(); //_obj_BusinessUnit.OPERATION = operation.Select; //_obj_BusinessUnit.ISDELETED = true; _obj_SMHR_LoginInfo = new SMHR_LOGININFO(); _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_LoginInfo.LOGIN_ID = Convert.ToInt32(Session["USER_ID"]); DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo); ddl_BusinessUnit.DataSource = dt_BUDetails; ddl_BusinessUnit.DataValueField = "BUSINESSUNIT_ID"; ddl_BusinessUnit.DataTextField = "BUSINESSUNIT_CODE"; ddl_BusinessUnit.DataBind(); ddl_BusinessUnit.Items.Insert(0, new RadComboBoxItem("Select")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Employee_Pay_Item", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void LoadVoteCode() { try { _obj_Payitems = new SMHR_PAYITEMS(); _obj_Payitems.OPERATION = operation.Chk; _obj_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_Details = BLL.get_PayItems(_obj_Payitems); rcmb_VoteCode.DataSource = dt_Details; rcmb_VoteCode.DataTextField = "PAYITEM_ACCOUNTHEAD"; rcmb_VoteCode.DataValueField = "PAYITEM_ID"; rcmb_VoteCode.DataBind(); rcmb_VoteCode.Items.Insert(0, new RadComboBoxItem("All")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeDueIncrement", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadPayItems() { try { SMHR_PAYITEMS objPayItems = new SMHR_PAYITEMS(); objPayItems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); objPayItems.OPERATION = operation.Select1; DataTable dtPayItems = BLL.get_PayItems(objPayItems); rcmb_PayItem.DataSource = dtPayItems; rcmb_PayItem.DataTextField = "PAYITEM_PAYITEMNAME"; rcmb_PayItem.DataValueField = "PAYITEM_ID"; rcmb_PayItem.DataBind(); rcmb_PayItem.Items.Insert(0, new RadComboBoxItem("ALL", "-1")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "PayItemWiseAllocationSummary", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void rcmb_BusinessUnit_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { string control = Convert.ToString(Request.QueryString["Control"]); if (control == "11") { if (rcmb_BusinessUnit.SelectedIndex != 0 & control == "11") { _obj_Payitems = new SMHR_PAYITEMS(); _obj_Payitems.OPERATION = operation.Select4; _obj_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Payitems.BUID = Convert.ToInt32(rcmb_BusinessUnit.SelectedValue); DataTable dt_Details = BLL.get_PayItems(_obj_Payitems); if (dt_Details.Rows.Count != 0) { rcmb_PayItem.DataSource = dt_Details; rcmb_PayItem.DataTextField = "PAYITEM_PAYITEMNAME"; rcmb_PayItem.DataValueField = "PAYITEM_ID"; rcmb_PayItem.DataBind(); rcmb_PayItem.Items.Insert(0, new RadComboBoxItem("Select")); } else { rcmb_PayItem.Items.Clear(); rcmb_PayItem.Items.Insert(0, new RadComboBoxItem("Select")); } } else { rcmb_PayItem.Items.Clear(); rcmb_PayItem.Text = string.Empty; } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeDueIncrement", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadLoanInterest() { try { SMHR_PAYITEMS _obj_Smhr_Payitems = new SMHR_PAYITEMS(); _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_Payitems.OPERATION = operation.Finalized; rcbLoanInterest.DataSource = BLL.get_PayItems(_obj_Smhr_Payitems); rcbLoanInterest.DataTextField = "PAYITEM_PAYITEMNAME"; rcbLoanInterest.DataValueField = "PAYITEM_ID"; rcbLoanInterest.DataBind(); rcbLoanInterest.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayItemDefine", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadCombos() { try { SMHR_PERIOD _obj_smhr_period = new SMHR_PERIOD(); DataTable dt_PeriodDetails = new DataTable(); _obj_smhr_period.OPERATION = operation.Select; _obj_SMHR_LoginInfo = new SMHR_LOGININFO(); _obj_smhr_period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); //To load Business unit _obj_SMHR_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHR_LoginInfo.LOGIN_ID = Convert.ToInt32(Session["USER_ID"]); DataTable dt_BUDetails = BLL.get_Business_Units(_obj_SMHR_LoginInfo); rcmb_businessunit.DataSource = dt_BUDetails; rcmb_businessunit.DataValueField = "BUSINESSUNIT_ID"; rcmb_businessunit.DataTextField = "BUSINESSUNIT_CODE"; rcmb_businessunit.DataBind(); rcmb_businessunit.Items.Insert(0, new RadComboBoxItem("Select")); chck_Payitems.Items.Clear(); //to load payitem head _obj_Smhr_Payitems = new SMHR_PAYITEMS(); _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_Payitems.OPERATION = operation.Select1; //_obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); DataTable dt_PayItemDetails = BLL.fetch_PayItems(_obj_Smhr_Payitems); ViewState["payitems"] = dt_PayItemDetails; rcmb_selectpayitemhead.DataSource = dt_PayItemDetails; rcmb_selectpayitemhead.DataValueField = "PAYITEM_ID"; rcmb_selectpayitemhead.DataTextField = "PAYITEM_PAYITEMNAME"; rcmb_selectpayitemhead.DataBind(); rcmb_selectpayitemhead.Items.Insert(0, new RadComboBoxItem("Select")); rcmb_selectpayitemhead.Enabled = true; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "bonus", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void cmb_PayitemPriority_SelectedIndexChanged(object sender, EventArgs e) { try { DropDownList ddSender = (DropDownList)sender; _obj_Smhr_Payitems = new SMHR_PAYITEMS(); _obj_Smhr_Payitems.OPERATION = operation.Check; _obj_Smhr_Payitems.PAYITEM_ID = Convert.ToInt32(((Label)ddSender.Parent.FindControl("lblPayitemID")).Text); _obj_Smhr_Payitems.PAYITEM_PROCESSPRIORITY = Convert.ToInt32(ddSender.SelectedItem.Value); _obj_Smhr_Payitems.PAYITEM_LASTMDFBY = 1; // Need to Change _obj_Smhr_Payitems.PAYITEM_LASTMDFDATE = DateTime.Now; BLL.set_PayItems(_obj_Smhr_Payitems); LoadMainGrid(); Rg_PayItems.DataBind(); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayItemDefine", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
private void LoadLoanNumber() { try { SMHR_PAYITEMS _obj_Smhr_PayItems = new SMHR_PAYITEMS(); //_obj_Smhr_BusinessUnit.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_Smhr_PayItems.PAYITEM_ITEMTYPE_ID = Convert.ToInt32(rcmb_LoanType.SelectedValue); //Loan type ID _obj_Smhr_PayItems.LASTMDFBY = Convert.ToInt32(rcmb_Employee.SelectedValue); _obj_Smhr_PayItems.OPERATION = operation.load; rcmb_LoanNo.Items.Clear(); rcmb_LoanNo.DataSource = BLL.get_PayItems(_obj_Smhr_PayItems); rcmb_LoanNo.DataTextField = "LOANTRANS_LOANNO"; rcmb_LoanNo.DataValueField = "LOANTRANS_LOANNO"; rcmb_LoanNo.DataBind(); rcmb_LoanNo.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select", "0")); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "LoanDetails", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); return; } }
protected void LoadPayItem() { try { string control = Convert.ToString(Request.QueryString["Control"]); _obj_Payitems = new SMHR_PAYITEMS(); _obj_Payitems.OPERATION = operation.details; _obj_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); if (control == "3" || control == "6") { _obj_Payitems.MODE = Convert.ToInt32("1"); } if (control == "4" || control == "5") { _obj_Payitems.MODE = Convert.ToInt32("2"); } DataTable dt_Details = BLL.get_PayItems(_obj_Payitems); rcmb_PayItem.DataSource = dt_Details; rcmb_PayItem.DataTextField = "PAYITEM_PAYITEMNAME"; rcmb_PayItem.DataValueField = "PAYITEM_ID"; rcmb_PayItem.DataBind(); if (control == "4" || control == "5" || control == "6") { rcmb_PayItem.Items.Insert(0, new RadComboBoxItem("All", "-1")); } else { rcmb_PayItem.Items.Insert(0, new RadComboBoxItem("Select")); } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeeDueIncrement", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Save_Click(object sender, EventArgs e) { try { string str = string.Empty; _obj_Smhr_Payitems = new SMHR_PAYITEMS(); _obj_Smhr_Payitems.PAYITEM_PAYITEMNAME = BLL.ReplaceQuote(rtxt_PayItemCode.Text); _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_Smhr_Payitems.PAYITEM_PAYDESC = BLL.ReplaceQuote(rtxt_PayItemDesc.Text); _obj_Smhr_Payitems.PAYITEM_ITEMTYPE_ID = Convert.ToInt32(rcmb_PayItemType.SelectedItem.Value); _obj_Smhr_Payitems.PAYITEM_ITEMMODE_ID = Convert.ToInt32(rcmb_PayItemMode.SelectedItem.Value); _obj_Smhr_Payitems.PAYITEM_CALMODE = Convert.ToString(rcmb_PayCalMode.SelectedItem.Text); _obj_Smhr_Payitems.PAYITEM_STARTDATE = Convert.ToDateTime(rdt_PayItemStartDate.SelectedDate); if (rdtp_PayItemEnddate.SelectedDate != null) { _obj_Smhr_Payitems.PAYITEM_ENDDATE = Convert.ToDateTime(rdtp_PayItemEnddate.SelectedDate); } else { _obj_Smhr_Payitems.PAYITEM_ENDDATE = null; } _obj_Smhr_Payitems.PAYITEM_PRINTINPAYREG = Convert.ToBoolean(chk_PrintinPayRegister.Checked); _obj_Smhr_Payitems.PAYITEM_PRINTINPAYSLIP = Convert.ToBoolean(chk_PrintPaySlip.Checked); _obj_Smhr_Payitems.PAYITEM_ISLOANVAILDATE = Convert.ToBoolean(chk_loanval.Checked); // _obj_Smhr_Payitems.PAYITEM_PROJECTID = Convert.ToInt32(rcmb_Project.SelectedValue); _obj_Smhr_Payitems.PAYITEM_ISNULLIFY = Convert.ToBoolean(chkISNullify.Checked); ShowCheckedItems(rlb_Project, lbl_projectlist); //for project list box _obj_Smhr_Payitems.PAYITEM_PROJECTID = Convert.ToString(lbl_projectlist.Text); //if (chk_PrintPaySlip.Checked) //{ // _obj_Smhr_Payitems.PAYITEM_PRINTINPAYSLIP = true; //} //else //{ // _obj_Smhr_Payitems.PAYITEM_PRINTINPAYSLIP = false; //} _obj_Smhr_Payitems.PAYITEM_AUTOMATIC = Convert.ToBoolean(chk_Automatic.Checked); _obj_Smhr_Payitems.PAYITEM_CTC = Convert.ToBoolean(chk_CTC.Checked); _obj_Smhr_Payitems.PAYITEM_INDIVIDUAL = Convert.ToBoolean(chk_IndividualPrint.Checked); _obj_Smhr_Payitems.PAYITEM_PROCESSTYPE = Convert.ToBoolean(rbtn_ProcessingType.SelectedItem.Value.ToString() == "0" ? "TRUE" : "FALSE"); _obj_Smhr_Payitems.PAYITEM_PROCESSTYPE = Convert.ToBoolean(rbtn_ProcessingType.SelectedItem.Value.ToString() == "1" ? "TRUE" : "FALSE"); _obj_Smhr_Payitems.PAYITEM_ACCOUNTHEAD = Convert.ToString(rtxt_AccountHead.Text); _obj_Smhr_Payitems.PAYITEM_VOTENAME = Convert.ToString(rtxtVoteName.Text).Replace("'", "''"); // _obj_Smhr_Payitems.PAYITEM_YTD = Convert.ToString(rcmb_YTDType.SelectedItem.Text.Trim()); _obj_Smhr_Payitems.PAYITEM_CREATEDBY = Convert.ToInt32(Session["USER_ID"]); // Need to Change _obj_Smhr_Payitems.PAYITEM_CREATEDDATE = DateTime.Now; _obj_Smhr_Payitems.PAYITEM_LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); // Need to Change _obj_Smhr_Payitems.PAYITEM_LASTMDFDATE = DateTime.Now; _obj_Smhr_Payitems.PAYITEM_ISBENFITABLE = chk_Benfit.Checked; _obj_Smhr_Payitems.PAYITEM_ISTAXABLE = chk_Istaxable.Checked; _obj_Smhr_Payitems.PAYITEM_ISOA_INCLUDED = chk_Oaincluded.Checked; _obj_Smhr_Payitems.PAYITEM_MINIMUM_PERCENTAGE_VALUE = Convert.ToDouble(RNT_MinimumValue.Text); if (trProcessType.Visible == true) //if ((string.Compare(rcmb_PayItemMode.SelectedItem.Text, "Loan", true) == 0) || (string.Compare(rcmb_PayItemMode.SelectedItem.Text, "Insurance", true) == 0)) { _obj_Smhr_Payitems.PAYITEM_LOAN_PROCESS_TYPE = rb_loanprocesstype.SelectedItem.Text; } else { _obj_Smhr_Payitems.PAYITEM_LOAN_PROCESS_TYPE = null; } //_obj_Smhr_Payitems.PAYITEM_ACCOUNTTYPE = Convert.ToString(ddl_AccountType.SelectedItem.Text.Trim()); //if (Convert.ToString(ddl_AccountType.SelectedItem.Text.Trim()) == "Vendor") // _obj_Smhr_Payitems.PAYITEM_POSTINGPROFILE = Convert.ToString(txt_PostingProfile.Text.Trim()); // else _obj_Smhr_Payitems.PAYITEM_ACCOUNTTYPE = string.Empty; _obj_Smhr_Payitems.PAYITEM_POSTINGPROFILE = string.Empty; _obj_Smhr_Payitems.PAYITEM_ISAFFECTLOP = Convert.ToBoolean(chk_AffectLop.Checked); if (string.Compare(rcmb_PayItemMode.SelectedItem.Text, "Loan", true) == 0) { _obj_Smhr_Payitems.PAYITEM_LOAN_PROCESSTYPE = Convert.ToInt32(rb_loanprocesstype.SelectedItem.Value); } else if (string.Compare(rcmb_PayItemMode.SelectedItem.Text, "Insurance", true) == 0) { _obj_Smhr_Payitems.PAYITEM_INSTAXRELIEF = Convert.ToDecimal(rtxtTaxRelief.Value); } else if ((string.Compare(rcmb_PayItemMode.SelectedItem.Text, "Loan Interest", true) == 0) && rcbLoanInterest.SelectedValue != string.Empty) { _obj_Smhr_Payitems.PAYITEM_LOAN_INTEREST = Convert.ToInt32(rcbLoanInterest.SelectedValue); } switch (((Button)sender).ID.ToUpper()) { case "BTN_SAVE": _obj_Smhr_Payitems.OPERATION = operation.Check; _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); if (Convert.ToString(BLL.get_PayItems(_obj_Smhr_Payitems).Rows[0][0]) != "0") { BLL.ShowMessage(this, "Pay Item with this Name Already Exists"); rtxt_PayItemCode.Text = String.Empty; return; } _obj_Smhr_Payitems.PAYITEM_ACCOUNTHEAD = Convert.ToString(rtxt_AccountHead.Text); _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_Smhr_Payitems.OPERATION = operation.CHECKDUPLICATE; DataTable dt = BLL.get_PayItems(_obj_Smhr_Payitems); if (dt.Rows.Count != 0) { //if (Convert.ToString(dt.Rows[0][0]) != "0") //{ // BLL.ShowMessage(this, "Voter Code Has Been Already Assigned."); // rtxt_AccountHead.Text = string.Empty; // rtxt_AccountHead.Focus(); // return; //} } _obj_Smhr_Payitems.OPERATION = operation.Insert; if (BLL.set_PayItems(_obj_Smhr_Payitems)) { dtpriority = null; str = "save"; BLL.ShowMessage(this, "Information Saved Successfully"); } else { BLL.ShowMessage(this, "Information Not Saved"); } break; case "BTN_EDIT": _obj_Smhr_Payitems.PAYITEM_ID = Convert.ToInt32(lbl_PayItemID.Text); _obj_Smhr_Payitems.OPERATION = operation.Check; _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); if (Convert.ToString(BLL.get_PayItems(_obj_Smhr_Payitems).Rows[0][0]) != "1") { BLL.ShowMessage(this, "Pay Item with this Name Already Exists"); rtxt_PayItemCode.Text = String.Empty; return; } if (Convert.ToString(lbl_Request.Text) != Convert.ToString(rtxt_AccountHead.Text)) { _obj_Smhr_Payitems.PAYITEM_ACCOUNTHEAD = Convert.ToString(rtxt_AccountHead.Text); _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_Smhr_Payitems.OPERATION = operation.CHECKDUPLICATE; DataTable dt_check = BLL.get_PayItems(_obj_Smhr_Payitems); if (dt_check.Rows.Count != 0) { //if (Convert.ToString(dt_check.Rows[0][0]) != "0") //{ // BLL.ShowMessage(this, "Voter Code Has Been Already Assigned."); // rtxt_AccountHead.Text = string.Empty; // rtxt_AccountHead.Focus(); // return; //} } } _obj_Smhr_Payitems.OPERATION = operation.Update; if (BLL.set_PayItems(_obj_Smhr_Payitems)) { dtpriority = null; str = "update"; BLL.ShowMessage(this, "Information Updated Successfully"); } else { BLL.ShowMessage(this, "Information Not Saved"); } break; } //Rm_PayItem_page.SelectedIndex = 0; //LoadMainGrid(); //Rg_PayItems.DataBind(); Response.Redirect("~/Masters/frm_PayItemDefine.aspx?value=" + str, false); } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayItemDefine", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void lbtn_Edit_OnCommand(object sender, CommandEventArgs e) { try { RadMultiPage1.SelectedIndex = 1; //code for security if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_update.Visible = false; } else { btn_update.Visible = true; } btnSave.Visible = false; string BONUS_ID = e.CommandArgument.ToString(); ViewState["BONUS_ID"] = BONUS_ID; _obj_smhr_bonusmaster.BONUS_ID = Convert.ToInt32(BONUS_ID); _obj_smhr_bonusmaster.OPERATION = operation.Edit; DataTable dt_getdata = new DataTable(); dt_getdata = BLL.Get_SMHR_BONUSMASTER1(_obj_smhr_bonusmaster); rcmb_businessunit.SelectedIndex = rcmb_businessunit.FindItemIndexByValue(dt_getdata.Rows[0]["BUSINESSUNIT"].ToString()); rcmb_businessunit.Enabled = false; rtxt_restrictionamount.Text = dt_getdata.Rows[0]["RESTRICTION_AMOUNT"].ToString(); rtxt_minimumbonus.Text = dt_getdata.Rows[0]["MINIMUM_BONUS_PERCENTAGE"].ToString(); rtxt_maximumbonus.Text = dt_getdata.Rows[0]["MAXIMUM_BONUS_PERCENTAGE"].ToString(); rcmb_selectpayitemhead.SelectedIndex = rcmb_selectpayitemhead.FindItemIndexByValue(dt_getdata.Rows[0]["PAYITEM_ID"].ToString()); DataTable dt_Recurring = new DataTable(); SMHR_PAYITEMS _obj_Smhr_Payitems = new SMHR_PAYITEMS(); _obj_Smhr_Payitems.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString()); _obj_Smhr_Payitems.OPERATION = operation.Select1; dt_Recurring = BLL.fetch_PayItems(_obj_Smhr_Payitems); for (int i = 0; i < dt_Recurring.Rows.Count; i++) { if (Convert.ToInt32(dt_Recurring.Rows[i]["PAYITEM_ID"]) == Convert.ToInt32(rcmb_selectpayitemhead.SelectedItem.Value)) { dt_Recurring.Rows[i].Delete(); } } chck_Payitems.DataSource = dt_Recurring; chck_Payitems.DataValueField = "PAYITEM_ID"; chck_Payitems.DataTextField = "PAYITEM_PAYITEMNAME"; chck_Payitems.DataBind(); chck_Payitems.Visible = true; _obj_smhr_bonusmaster.OPERATION = operation.Check; DataTable dt_amt = new DataTable(); dt_amt = BLL.Get_SMHR_BONUSMASTER1(_obj_smhr_bonusmaster); for (int i = 0; i < chck_Payitems.Items.Count; i++) { for (int j = 0; j < dt_amt.Rows.Count; j++) { if (dt_amt.Rows[j]["BONUS_PAYITEM_CHECKED"].ToString() == "True") { chck_Payitems.Items[j].Selected = true; } else { chck_Payitems.Items[j].Selected = false; } } } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "bonus", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void lnk_Edit_Command(object sender, CommandEventArgs e) { try { rblConfigure.ClearSelection(); trLoanInterest.Visible = false; trConfig.Visible = true; trProcessType.Visible = false; trInsurance.Visible = false; LoadCombos(); LoadProject(); //to load project // LoadBU(); ClearControls(); DataTable dt; _obj_Smhr_Payitems = new SMHR_PAYITEMS(); //lbl_Request.Visible = true; _obj_Smhr_Payitems.PAYITEM_ID = Convert.ToInt32(Convert.ToString(e.CommandArgument)); lbl_PayItemID.Text = Convert.ToString(e.CommandArgument); dt = BLL.get_PayItems(_obj_Smhr_Payitems); if (dt.Rows.Count > 0) { //PAYITEM_LOAN_PROCESSTYPE rtxt_PayItemCode.Text = Convert.ToString(dt.Rows[0]["PAYITEM_PAYITEMNAME"]); rtxt_PayItemDesc.Text = Convert.ToString(dt.Rows[0]["PAYITEM_PAYDESC"]); rcmb_PayItemType.SelectedIndex = rcmb_PayItemType.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["PAYITEM_ITEMTYPE_ID"])); rcmb_PayItemMode.SelectedIndex = rcmb_PayItemMode.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["PAYITEM_ITEMMODE_ID"])); //rcmb_PayCalMode.SelectedItem.Text = Convert.ToString(dt.Rows[0]["PAYITEM_CALMODE"]); rcmb_PayCalMode.SelectedIndex = rcmb_PayCalMode.Items.FindItemIndexByText(Convert.ToString(dt.Rows[0]["PAYITEM_CALMODE"])); // rcmb_YTDType.SelectedIndex = rcmb_YTDType.Items.FindItemIndexByText(Convert.ToString(dt.Rows[0]["PAYITEM_YTD"])); //rbtn_ProcessingType.SelectedIndex = (Convert.ToString(dt.Rows[0]["PAYITEM_PROCESSTYPE"]).ToUpper() == "FALSE" ? 1 : 2); rbtn_ProcessingType.SelectedIndex = Convert.ToInt32(dt.Rows[0]["PAYITEM_PROCESSTYPE"]); //rblConfigure.SelectedIndex = (Convert.ToString(dt.Rows[0]["ALLOWANCE_CONFG_ID"]).ToUpper() == "FALSE" ? 1:0); rdt_PayItemStartDate.SelectedDate = Convert.ToDateTime(dt.Rows[0]["PAYITEM_STARTDATE"]); RNT_MinimumValue.Text = Convert.ToString(dt.Rows[0]["PAYITEM_MINIMUM_PERCENTAGE_VALUE"]); if (dt.Rows[0]["PAYITEM_ENDDATE"] == DBNull.Value) { rdtp_PayItemEnddate.SelectedDate = null; } else { rdtp_PayItemEnddate.SelectedDate = Convert.ToDateTime(dt.Rows[0]["PAYITEM_ENDDATE"]); } chk_PrintinPayRegister.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_PRINTINPAYREG"]); if (Convert.ToString(dt.Rows[0]["PAYITEM_ISBENEFITABLE"]) != "") { chk_Benfit.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_ISBENEFITABLE"].ToString()); } if (Convert.ToString(dt.Rows[0]["PAYITEM_ISTAXABLE"]) != "") { chk_Istaxable.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_ISTAXABLE"]); } if (Convert.ToString(dt.Rows[0]["PAYITEM_ISOA_INCLUDED"]) != "") { chk_Oaincluded.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_ISOA_INCLUDED"]); } if (Convert.ToString(dt.Rows[0]["PAYITEM_ISAFFECTLOP"]) != "") { chk_AffectLop.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_ISAFFECTLOP"]); } chk_Automatic.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_AUTOMATIC"]); chk_CTC.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_CTC"]); chk_IndividualPrint.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_INDIVIDUAL"]); //chk_PrintPaySlip.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_PRINTINPAYSLIP"]); if (Convert.ToString(dt.Rows[0]["PAYITEM_PRINTINPAYSLIP"]) != null) { chk_PrintPaySlip.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_PRINTINPAYSLIP"]); } if (dt.Rows[0]["PAYITEM_ISLOANVAILDATE"] != System.DBNull.Value) { chk_loanval.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_ISLOANVAILDATE"]); } if (dt.Rows[0]["PAYITEM_ISNULLIFY"] != System.DBNull.Value) { chkISNullify.Checked = Convert.ToBoolean(dt.Rows[0]["PAYITEM_ISNULLIFY"]); } /*if (dt.Rows[0]["PAYITEM_PROJECTID"] != System.DBNull.Value) * { * //rcmb_Project.SelectedIndex = Convert.ToInt32(dt.Rows[0]["PAYITEM_PROJECTID"]); * //rcmb_Project.SelectedIndex = rcmb_Project.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["PAYITEM_PROJECTID"])); * }*/ lbl_projectlist.Text = Convert.ToString(dt.Rows[0]["PAYITEM_PROJECTID"]); //for project listbox getCheckedItems(rlb_Project, lbl_projectlist); rtxt_AccountHead.Text = Convert.ToString(dt.Rows[0]["PAYITEM_ACCOUNTHEAD"]); rtxtVoteName.Text = Convert.ToString(dt.Rows[0]["PAYITEM_VOTENAME"]); lbl_Request.Text = Convert.ToString(dt.Rows[0]["PAYITEM_ACCOUNTHEAD"]); if (string.Compare(rcmb_PayItemMode.SelectedItem.Text, "Loan", true) == 0) { trProcessType.Visible = true; rb_loanprocesstype.SelectedIndex = rb_loanprocesstype.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["PAYITEM_LOAN_PROCESSTYPE"])); } else if (string.Compare(rcmb_PayItemMode.SelectedItem.Text, "Loan Interest", true) == 0) { LoadLoanInterest(); trProcessType.Visible = trLoanInterest.Visible = true; rb_loanprocesstype.SelectedIndex = rb_loanprocesstype.Items.FindItemIndexByText(Convert.ToString(dt.Rows[0]["PAYITEM_LOAN_PROCESS_TYPE"])); rcbLoanInterest.SelectedIndex = rcbLoanInterest.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["PAYITEM_LOAN_INTEREST"])); } else if (string.Compare(rcmb_PayItemMode.SelectedItem.Text, "Insurance", true) == 0) { trInsurance.Visible = true; rtxtTaxRelief.Text = Convert.ToString(dt.Rows[0]["PAYITEM_INSTAXRELIEF"]); } else { trProcessType.Visible = false; trInsurance.Visible = false; } } btn_Save.Visible = false; //code for security if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2) { btn_Edit.Visible = false; } else { btn_Edit.Visible = true; } Rm_PayItem_page.SelectedIndex = 1; ScriptManager.RegisterClientScriptBlock(this, this.GetType(), Guid.NewGuid().ToString(), "<script>OnAccountType();</script>", false); if (Convert.ToString(dt.Rows[0]["PAYITEM_ACCOUNTTYPE"]) != "" || dt.Rows[0]["PAYITEM_ACCOUNTTYPE"] != System.DBNull.Value) { ddl_AccountType.SelectedIndex = ddl_AccountType.Items.FindItemIndexByText(Convert.ToString(dt.Rows[0]["PAYITEM_ACCOUNTTYPE"])); } else { ddl_AccountType.SelectedIndex = 0; } if (Convert.ToString(dt.Rows[0]["PAYITEM_POSTINGPROFILE"]) != "") { txt_PostingProfile.Text = Convert.ToString(dt.Rows[0]["PAYITEM_POSTINGPROFILE"]); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), Guid.NewGuid().ToString(), "<script> document.getElementById('Posting_Profile').style.display = '';</script>", false); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), Guid.NewGuid().ToString(), "<script> document.getElementById('Posting_Profile').style.display = 'none';</script>", false); } #region Check Loan Setup Data if (rcmb_PayItemMode.SelectedItem.Text == "Loan") { SMHR_LOANSETUP _obj_SMHRLOANSETUP = new SMHR_LOANSETUP(); _obj_SMHRLOANSETUP.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_SMHRLOANSETUP.LOANSETUP_LOANTYPE_ID = Convert.ToInt32(lbl_PayItemID.Text); _obj_SMHRLOANSETUP.LOANSETUP_LOANPROCESSTYPE = rb_loanprocesstype.SelectedItem.Text; DataTable dtLS = BLL.GetLoanSetupData(_obj_SMHRLOANSETUP); if (dtLS.Rows.Count > 0) { BLL.ShowMessage(this, "You are not supposed to modify this Pay Item, because it is already in use in Loan module"); btn_Edit.Visible = false; } else { btn_Edit.Visible = true; } } #endregion } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_PayItemDefine", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }