internal DataSet BindAll(BudgetAmountModel ObjBudgetAmountModel) { try { ClsCon.cmd = new SqlCommand(); ClsCon.cmd.CommandType = CommandType.StoredProcedure; ClsCon.cmd.CommandText = "SPBudgetAmount"; ClsCon.cmd.Parameters.AddWithValue("@Ind", ObjBudgetAmountModel.Ind); ClsCon.cmd.Parameters.AddWithValue("@OrgID", ObjBudgetAmountModel.OrgID); ClsCon.cmd.Parameters.AddWithValue("@BrID", ObjBudgetAmountModel.BrID); con = ClsCon.SqlConn(); ClsCon.cmd.Connection = con; dsBudgetAmount = new DataSet(); ClsCon.da = new SqlDataAdapter(ClsCon.cmd); ClsCon.da.Fill(dsBudgetAmount); dsBudgetAmount.DataSetName = "success"; } catch (Exception) { dsBudgetAmount = new DataSet(); dsBudgetAmount.DataSetName = "error"; return(dsBudgetAmount); } finally { con.Close(); con.Dispose(); ClsCon.da.Dispose(); ClsCon.cmd.Dispose(); } return(dsBudgetAmount); }
private void CheckBudgetAmountIsExist() { try { if (ddlSection.SelectedValue == "0") { ShowMessage("Select Section Name.", false); ddlSection.Focus(); ddlBudgetHead.ClearSelection(); return; } if (ddlSubSection.SelectedValue == "0") { ShowMessage("Select Sub-Section Name.", false); ddlSubSection.Focus(); ddlBudgetHead.ClearSelection(); return; } objBudgetAmountModel = new BudgetAmountModel(); objBudgetAmountModel.Ind = 3; objBudgetAmountModel.OrgID = GlobalSession.OrgID; objBudgetAmountModel.BrID = GlobalSession.BrID; objBudgetAmountModel.YrCode = GlobalSession.YrCD; //objBudgetAmountModel.SectionCD = CommonCls.ConvertIntZero(ddlSection.SelectedValue); //objBudgetAmountModel.SubSectionCD = CommonCls.ConvertIntZero(ddlSubSection.SelectedValue); //objBudgetAmountModel.BudgetHeadCD = CommonCls.ConvertIntZero(ddlBudgetHead.SelectedValue); objBudgetAmountModel.SectionCD = CommonCls.ConvertIntZero(SectionID); objBudgetAmountModel.SubSectionCD = CommonCls.ConvertIntZero(SubSectionID); objBudgetAmountModel.BudgetHeadCD = CommonCls.ConvertIntZero(BudgetHeadID); string uri = string.Format("BudgetAmount/CheckBudgetAmount"); DataTable dtSubSection = CommonCls.ApiPostDataTable(uri, objBudgetAmountModel); if (dtSubSection.Rows.Count > 0) { txtAcutal3DrAmt.Text = lblAcutal3DrAmt.Text = dtSubSection.Rows[0]["Actual3BudgetAmtDr"].ToString(); txtAcutal3CrAmt.Text = lblAcutal3CrAmt.Text = dtSubSection.Rows[0]["Actual3BudgetAmtCr"].ToString(); txtProposed2DrAmt.Text = lblProposed2DrAmt.Text = dtSubSection.Rows[0]["Prop2BudgetAmtDr"].ToString(); txtProposed2CrAmt.Text = lblProposed2CrAmt.Text = dtSubSection.Rows[0]["Prop2BudgetAmtCr"].ToString(); txtSanctioned2DrAmt.Text = lblSanctioned2DrAmt.Text = dtSubSection.Rows[0]["Sanc2BudgetAmtDr"].ToString(); txtSanctioned2CrAmt.Text = lblSanctioned2CrAmt.Text = dtSubSection.Rows[0]["Sanc2BudgetAmtCr"].ToString(); txtActual2DrAmt.Text = lblActual2DrAmt.Text = dtSubSection.Rows[0]["Actual2BudgetAmtDr"].ToString(); txtActual2CrAmt.Text = lblActual2CrAmt.Text = dtSubSection.Rows[0]["Actual2BudgetAmtCr"].ToString(); txtProposedDrAmt.Text = lblProposedDrAmt.Text = dtSubSection.Rows[0]["PropBudgetAmtDr"].ToString(); txtProposedCrAmt.Text = lblProposedCrAmt.Text = dtSubSection.Rows[0]["PropBudgetAmtCr"].ToString(); } else { ClearFields(); } } catch (Exception ex) { ShowMessage(ex.Message, false); } }
private void BindAll() { try { objBudgetAmountModel = new BudgetAmountModel(); objBudgetAmountModel.Ind = 1; objBudgetAmountModel.OrgID = GlobalSession.OrgID; objBudgetAmountModel.BrID = GlobalSession.BrID; string uri = string.Format("BudgetAmount/BindAll"); DataSet dsSubSection = CommonCls.ApiPostDataSet(uri, objBudgetAmountModel); if (dsSubSection.Tables.Count > 0) { VSSubSection = dsSubSection.Tables[0]; DataTable dtGRD = dsSubSection.Tables[0]; if (dtGRD.Rows.Count > 0) { DataView dv31 = new DataView(dtGRD); dv31.RowFilter = "ParentSectionID = 0"; ddlSection.DataSource = dv31.ToTable(); ddlSection.DataTextField = "SectionName"; ddlSection.DataValueField = "SectionID"; ddlSection.DataBind(); ddlSection.Items.Insert(0, new ListItem("-- Select --", "0")); VSSection = dv31.ToTable(); lstSection.DataSource = VSSection; lstSection.DataTextField = "SectionName"; lstSection.DataValueField = "SectionName"; lstSection.DataBind(); } if (dsSubSection.Tables[1].Rows.Count > 0) { ddlBudgetHead.DataSource = dsSubSection.Tables[1]; ddlBudgetHead.DataTextField = "AccName"; ddlBudgetHead.DataValueField = "AccCode"; ddlBudgetHead.DataBind(); ddlBudgetHead.Items.Insert(0, new ListItem("-- Select --", "0")); VSBudgetHead = dsSubSection.Tables[1]; lstBudgetHead.DataSource = dsSubSection.Tables[1]; lstBudgetHead.DataTextField = "AccName"; lstBudgetHead.DataValueField = "AccName"; lstBudgetHead.DataBind(); } } } catch (Exception ex) { ShowMessage(ex.Message, false); } }
internal DataTable SaveBudgetAmount(BudgetAmountModel ObjBudgetAmountModel) { try { ClsCon.cmd = new SqlCommand(); ClsCon.cmd.CommandType = CommandType.StoredProcedure; ClsCon.cmd.CommandText = "SPBudgetAmount"; ClsCon.cmd.Parameters.AddWithValue("@Ind", ObjBudgetAmountModel.Ind); ClsCon.cmd.Parameters.AddWithValue("@OrgID", ObjBudgetAmountModel.OrgID); ClsCon.cmd.Parameters.AddWithValue("@BrID", ObjBudgetAmountModel.BrID); ClsCon.cmd.Parameters.AddWithValue("@YrCD", ObjBudgetAmountModel.YrCode); ClsCon.cmd.Parameters.AddWithValue("@SectionCD", ObjBudgetAmountModel.SectionCD); ClsCon.cmd.Parameters.AddWithValue("@SubSectionCD", ObjBudgetAmountModel.SubSectionCD); ClsCon.cmd.Parameters.AddWithValue("@BudgetHeadCD", ObjBudgetAmountModel.BudgetHeadCD); ClsCon.cmd.Parameters.AddWithValue("@Actual3budgetAmtDr", ObjBudgetAmountModel.Actual3budgetAmtDr); ClsCon.cmd.Parameters.AddWithValue("@Actual3budgetAmtCr ", ObjBudgetAmountModel.Actual3budgetAmtCr); ClsCon.cmd.Parameters.AddWithValue("@Prop2BudgetAmtDr", ObjBudgetAmountModel.Prop2BudgetAmtDr); ClsCon.cmd.Parameters.AddWithValue("@Prop2BudgetAmtCr", ObjBudgetAmountModel.Prop2BudgetAmtCr); ClsCon.cmd.Parameters.AddWithValue("@Sanc2BudgetAmtDr", ObjBudgetAmountModel.Sanc2BudgetAmtDr); ClsCon.cmd.Parameters.AddWithValue("@Sanc2BudgetAmtCr", ObjBudgetAmountModel.Sanc2BudgetAmtCr); ClsCon.cmd.Parameters.AddWithValue("@Actual2budgetAmtDr", ObjBudgetAmountModel.Actual2budgetAmtDr); ClsCon.cmd.Parameters.AddWithValue("@Actual2budgetAmtcr", ObjBudgetAmountModel.Actual2budgetAmtcr); ClsCon.cmd.Parameters.AddWithValue("@PropBudgetAmtDr", ObjBudgetAmountModel.PropBudgetAmtDr); ClsCon.cmd.Parameters.AddWithValue("@PropBudgetAmtCr", ObjBudgetAmountModel.PropBudgetAmtCr); ClsCon.cmd.Parameters.AddWithValue("@UserID", ObjBudgetAmountModel.UserID); ClsCon.cmd.Parameters.AddWithValue("@IPAddr", ObjBudgetAmountModel.IP); con = ClsCon.SqlConn(); ClsCon.cmd.Connection = con; dtBudgetAmount = new DataTable(); ClsCon.da = new SqlDataAdapter(ClsCon.cmd); ClsCon.da.Fill(dtBudgetAmount); dtBudgetAmount.TableName = "success"; } catch (Exception) { dtBudgetAmount = new DataTable(); dtBudgetAmount.TableName = "error"; return(dtBudgetAmount); } finally { con.Close(); con.Dispose(); ClsCon.da.Dispose(); ClsCon.cmd.Dispose(); } return(dtBudgetAmount); }
public DataTable CheckBudgetAmount(BudgetAmountModel ObjBudgetAmountModel) { DataTable dtAmountModel = ObjBudgetAmountDA.CheckBudgetAmount(ObjBudgetAmountModel); return(dtAmountModel); }
public DataTable SaveBudget(BudgetAmountModel ObjBudgetAmountModel) { DataTable dtAmountModel = ObjBudgetAmountDA.SaveBudgetAmount(ObjBudgetAmountModel); return(dtAmountModel); }
public DataSet BindAll(BudgetAmountModel ObjBudgetAmountModel) { DataSet dsAmountModel = ObjBudgetAmountDA.BindAll(ObjBudgetAmountModel); return(dsAmountModel); }
private void CheckBudgetAmountIsExist() { try { objBudgetAmountModel = new BudgetAmountModel(); objBudgetAmountModel.Ind = 3; objBudgetAmountModel.OrgID = GlobalSession.OrgID; objBudgetAmountModel.BrID = GlobalSession.BrID; objBudgetAmountModel.YrCode = GlobalSession.BudgetYrCD; objBudgetAmountModel.SectionCD = CommonCls.ConvertIntZero(SectionID); objBudgetAmountModel.SubSectionCD = CommonCls.ConvertIntZero(SubSectionID); objBudgetAmountModel.BudgetHeadCD = CommonCls.ConvertIntZero(BudgetHeadID); string uri = string.Format("BudgetAmountTranscation/CheckBudgetAmount"); DataTable dtSubSection = CommonCls.ApiPostDataTable(uri, objBudgetAmountModel); if (dtSubSection.Rows.Count > 0) { //txtAcutal3DrAmt.Text = lblAcutal3DrAmt.Text = dtSubSection.Rows[0]["Actual3BudgetAmtDr"].ToString(); //txtAcutal3CrAmt.Text = lblAcutal3CrAmt.Text = dtSubSection.Rows[0]["Actual3BudgetAmtCr"].ToString(); //txtProposed2DrAmt.Text = lblProposed2DrAmt.Text = dtSubSection.Rows[0]["Prop2BudgetAmtDr"].ToString(); //txtProposed2CrAmt.Text = lblProposed2CrAmt.Text = dtSubSection.Rows[0]["Prop2BudgetAmtCr"].ToString(); //txtSanctioned2DrAmt.Text = lblSanctioned2DrAmt.Text = dtSubSection.Rows[0]["Sanc2BudgetAmtDr"].ToString(); //txtSanctioned2CrAmt.Text = lblSanctioned2CrAmt.Text = dtSubSection.Rows[0]["Sanc2BudgetAmtCr"].ToString(); //txtActual2DrAmt.Text = lblActual2DrAmt.Text = dtSubSection.Rows[0]["Actual2BudgetAmtDr"].ToString(); //txtActual2CrAmt.Text = lblActual2CrAmt.Text = dtSubSection.Rows[0]["Actual2BudgetAmtCr"].ToString(); //txtProposedDrAmt.Text = lblProposedDrAmt.Text = dtSubSection.Rows[0]["PropBudgetAmtDr"].ToString(); //txtProposedCrAmt.Text = lblProposedCrAmt.Text = dtSubSection.Rows[0]["PropBudgetAmtCr"].ToString(); txtProp2BudgetAmtDr.Text = lblProp2BudgetAmtDr.Text = dtSubSection.Rows[0]["PropBudgetAmtDr"].ToString(); txtProp2BudgetAmtCr.Text = lblProp2BudgetAmtCr.Text = dtSubSection.Rows[0]["PropBudgetAmtCr"].ToString(); txtActualUptoBudgetAmtDr.Text = lblActualUptoBudgetAmtDr.Text = (dtSubSection.Rows[0]["ActualUptoBudgetAmtDr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["ActualUptoBudgetAmtDr"].ToString(); txtActualUptoBudgetAmtCr.Text = lblActualUptoBudgetAmtCr.Text = (dtSubSection.Rows[0]["ActualUptoBudgetAmtCr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["ActualUptoBudgetAmtCr"].ToString(); txtPropLastQtrBudgetAmtDr.Text = lblPropLastQtrBudgetAmtDr.Text = (dtSubSection.Rows[0]["PropLastQtrBudgetAmtDr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["PropLastQtrBudgetAmtDr"].ToString(); txtPropLastQtrBudgetAmtCr.Text = lblPropLastQtrBudgetAmtCr.Text = (dtSubSection.Rows[0]["PropLastQtrBudgetAmtCr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["PropLastQtrBudgetAmtCr"].ToString(); txtPropBudgetCapitalAmtDr.Text = lblPropBudgetAmtDr.Text = (dtSubSection.Rows[0]["PropBudgetCapitalAmtDr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["PropBudgetCapitalAmtDr"].ToString(); txtPropBudgetCapitalAmtCr.Text = lblPropBudgetAmtCr.Text = (dtSubSection.Rows[0]["PropBudgetCapitalAmtCr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["PropBudgetCapitalAmtCr"].ToString(); txtSanc2BudgetAmtDr.Text = lblSanc2BudgetAmtDr.Text = (dtSubSection.Rows[0]["Sanc2BudgetAmtDr"].ToString() == "-2") ? "" : dtSubSection.Rows[0]["Sanc2BudgetAmtDr"].ToString(); txtSanc2BudgetAmtCr.Text = lblSanc2BudgetAmtCr.Text = (dtSubSection.Rows[0]["Sanc2BudgetAmtCr"].ToString() == "-2") ? "" : dtSubSection.Rows[0]["Sanc2BudgetAmtCr"].ToString(); txtProp2BudgetAmtDr.Text = lblProp2BudgetAmtDr.Text = (dtSubSection.Rows[0]["Prop2BudgetAmtDr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["Prop2BudgetAmtDr"].ToString(); txtProp2BudgetAmtCr.Text = lblProp2BudgetAmtCr.Text = (dtSubSection.Rows[0]["Prop2BudgetAmtCr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["Prop2BudgetAmtCr"].ToString(); txtPropBudgetRevenueAmtDr.Text = lblPropBudgetRevenueAmtDr.Text = (dtSubSection.Rows[0]["PropBudgetRevenueAmtDr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["PropBudgetRevenueAmtDr"].ToString(); txtPropBudgetRevenueAmtCr.Text = lblPropBudgetRevenueAmtCr.Text = (dtSubSection.Rows[0]["PropBudgetRevenueAmtCr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["PropBudgetRevenueAmtCr"].ToString(); txtPropBudgetTotalAmtCr.Text = (dtSubSection.Rows[0]["PropBudgetAmtCr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["PropBudgetAmtCr"].ToString(); txtPropBudgetTotalAmtDr.Text = (dtSubSection.Rows[0]["PropBudgetAmtDr"].ToString() == "-1") ? "" : dtSubSection.Rows[0]["PropBudgetAmtDr"].ToString(); } else { ClearFields(); } } catch (Exception ex) { ShowMessage(ex.Message, false); } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtSectionName.Text)) { ShowMessage("Select Section Name.", false); txtSectionName.Focus(); return; } if (string.IsNullOrEmpty(txtSubSection.Text)) { ShowMessage("Select Sub-Section Name.", false); txtSubSection.Focus(); return; } if (string.IsNullOrEmpty(txtBudgetHead.Text)) { ShowMessage("Select Budget Head Name.", false); txtBudgetHead.Focus(); return; } //if (txtProposedDrAmt.Enabled == true) //{ // if (string.IsNullOrEmpty(txtProposedDrAmt.Text) || Convert.ToDecimal(txtProposedDrAmt.Text) <= 0) // { // ShowMessage("Enter Proposed Budget Amount 2017-2018.", false); // txtProposedDrAmt.Focus(); // return; // } //} //if (txtProposedCrAmt.Enabled == true) //{ // if (string.IsNullOrEmpty(txtProposedCrAmt.Text) || Convert.ToDecimal(txtProposedCrAmt.Text) <= 0) // { // ShowMessage("Enter Proposed Budget Amount 2017-2018.", false); // txtProposedCrAmt.Focus(); // return; // } //} objBudgetAmountModel = new BudgetAmountModel(); objBudgetAmountModel.Ind = 2; objBudgetAmountModel.OrgID = GlobalSession.OrgID; objBudgetAmountModel.BrID = GlobalSession.BrID; objBudgetAmountModel.YrCode = GlobalSession.YrCD; //objBudgetAmountModel.SectionCD = CommonCls.ConvertIntZero(ddlSection.SelectedValue); //objBudgetAmountModel.SubSectionCD = CommonCls.ConvertIntZero(ddlSubSection.SelectedValue); objBudgetAmountModel.SectionCD = CommonCls.ConvertIntZero(SectionID); objBudgetAmountModel.SubSectionCD = CommonCls.ConvertIntZero(SubSectionID); //objBudgetAmountModel.BudgetHeadCD = CommonCls.ConvertIntZero(ddlBudgetHead.SelectedValue); objBudgetAmountModel.BudgetHeadCD = CommonCls.ConvertIntZero(BudgetHeadID); objBudgetAmountModel.UserID = GlobalSession.UserID; objBudgetAmountModel.IP = ""; objBudgetAmountModel.Actual3budgetAmtDr = CommonCls.ConvertDecimalZero(txtAcutal3DrAmt.Text); objBudgetAmountModel.Actual3budgetAmtCr = CommonCls.ConvertDecimalZero(txtAcutal3CrAmt.Text); objBudgetAmountModel.Prop2BudgetAmtDr = CommonCls.ConvertDecimalZero(txtProposed2DrAmt.Text); objBudgetAmountModel.Prop2BudgetAmtCr = CommonCls.ConvertDecimalZero(txtProposed2CrAmt.Text); objBudgetAmountModel.Sanc2BudgetAmtDr = CommonCls.ConvertDecimalZero(txtSanctioned2DrAmt.Text); objBudgetAmountModel.Sanc2BudgetAmtCr = CommonCls.ConvertDecimalZero(txtSanctioned2CrAmt.Text); objBudgetAmountModel.Actual2budgetAmtDr = CommonCls.ConvertDecimalZero(txtActual2DrAmt.Text); objBudgetAmountModel.Actual2budgetAmtcr = CommonCls.ConvertDecimalZero(txtActual2CrAmt.Text); objBudgetAmountModel.PropBudgetAmtDr = CommonCls.ConvertDecimalZero(txtProposedDrAmt.Text); objBudgetAmountModel.PropBudgetAmtCr = CommonCls.ConvertDecimalZero(txtProposedCrAmt.Text); string uri = string.Format("BudgetAmount/SaveBudget"); DataTable dtOpeningBalance = CommonCls.ApiPostDataTable(uri, objBudgetAmountModel); if (dtOpeningBalance.Rows.Count > 0) { ShowMessage("Record Save successfully.", true); ClearAll(); } else { ShowMessage("Record Not Save successfully.", false); } } catch (Exception ex) { ShowMessage(ex.Message, false); } }