protected void rcb_FinancialPeriod_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) { try { if (rcb_FinancialPeriod.SelectedIndex > 0) { btn_Save.Visible = true; _obj_smhr_TaxationMaster = new SMHR_TAXATIONMASTER(); _obj_smhr_TaxationMaster.OPERATION = operation.Get; _obj_smhr_TaxationMaster.TAXATIONMASTER_FINPERIOD_ID = Convert.ToInt32(rcb_FinancialPeriod.SelectedValue); _obj_smhr_TaxationMaster.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_smhr_TaxationMaster.TAXATIONMASTER_TYPE_ID = Convert.ToInt32(rcb_Taxation.SelectedValue); DataTable dt_Details = BLL.get_Taxation(_obj_smhr_TaxationMaster); if (dt_Details.Rows.Count > 0) { RG_TaxationSlab.Visible = true; RG_TaxationSlab.DataSource = dt_Details; RG_TaxationSlab.DataBind(); SMHR_PERIOD osmhr_period = new SMHR_PERIOD(); osmhr_period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); osmhr_period.PERIOD_ID = Convert.ToInt32(rcb_FinancialPeriod.SelectedValue); DataTable dtCurrentFinPeriod = BLL.IscurrentFinPeriod(osmhr_period); if (string.Compare(dtCurrentFinPeriod.Rows[0]["ISEXISTS"].ToString(), "0", true) == 0) { RG_TaxationSlab.Enabled = false; btn_Save.Visible = false; } else { RG_TaxationSlab.Enabled = Convert.ToBoolean(dt_Details.Rows[0]["ISEnable"]);; btn_Save.Visible = Convert.ToBoolean(dt_Details.Rows[0]["ISEnable"]);; } } else { RG_TaxationSlab.Visible = true; RG_TaxationSlab.DataSource = GetEmptyDT(); RG_TaxationSlab.DataBind(); RG_TaxationSlab.Enabled = true; btn_Save.Visible = true; } } else { RG_TaxationSlab.Visible = false; } } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "TaxationMaster", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }
protected void btn_Save_Click(object sender, EventArgs e) { try { _obj_smhr_TaxationMaster = new SMHR_TAXATIONMASTER(); DataTable dt = CreateGridDataTable(); RadNumericTextBox rnAmnt, rnPer; foreach (GridDataItem g in RG_TaxationSlab.Items) { rnAmnt = rnPer = new RadNumericTextBox(); rnAmnt = g.FindControl("txt_SlabAmount") as RadNumericTextBox; rnPer = g.FindControl("txt_Percentage") as RadNumericTextBox; dt.Rows.Add(Convert.ToInt32(g.Cells[2].Text), g.Cells[3].Text, rnAmnt.Text, rnPer.Text); } _obj_smhr_TaxationMaster.TAXATIONMASTER_FINPERIOD_ID = Convert.ToInt32(rcb_FinancialPeriod.SelectedItem.Value); _obj_smhr_TaxationMaster.TAXATIONMASTER_TYPE_ID = Convert.ToInt32(rcb_Taxation.SelectedItem.Value); _obj_smhr_TaxationMaster.TAXATIONMASTER_TYPE_NAME = rcb_Taxation.SelectedItem.Text; _obj_smhr_TaxationMaster.TAXATIONDATA = dt; _obj_smhr_TaxationMaster.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]); _obj_smhr_TaxationMaster.CREATEDBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_TaxationMaster.CREATEDDATE = DateTime.Now; _obj_smhr_TaxationMaster.LASTMDFBY = Convert.ToInt32(Session["USER_ID"]); _obj_smhr_TaxationMaster.LASTMDFDATE = DateTime.Now; _obj_smhr_TaxationMaster.OPERATION = operation.Insert; if (BLL.set_Taxation(_obj_smhr_TaxationMaster)) { BLL.ShowMessage(this, "Information Saved Successfully"); } else { BLL.ShowMessage(this, "Information Not Saved"); } rcb_FinancialPeriod.ClearSelection(); rcb_Taxation.ClearSelection(); RG_TaxationSlab.Visible = false; } catch (Exception ex) { SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "TaxationMaster", ex.StackTrace, DateTime.Now); Response.Redirect("~/Frm_ErrorPage.aspx"); } }