void FillItemName()
    {
        objplOpenStock = new ItemOpenningStockModel()
        {
            Ind   = 30,
            OrgID = GlobalSession.OrgID,
            BrID  = GlobalSession.BrID,
            YrCD  = GlobalSession.YrCD,
        };

        string    uri        = string.Format("ItemOpenStock/FillItemName");
        DataTable dtItemName = CommonCls.ApiPostDataTable(uri, objplOpenStock);

        if (dtItemName.Rows.Count > 0)
        {
            ddlItemName.DataSource     = ViewState["ItemNameList"] = dtItemName;
            ddlItemName.DataTextField  = "ItemName";
            ddlItemName.DataValueField = "ItemID";
            ddlItemName.DataBind();
            ddlItemName.Items.Insert(0, new ListItem {
                Text = "-Select-", Value = "0"
            });
            ddlItemName.SelectedIndex = 0;
        }
    }
예제 #2
0
    private void BindAll()
    {
        try
        {
            objBudgetSection       = new BudgetSectionModel();
            objBudgetSection.Ind   = 11;
            objBudgetSection.OrgID = GlobalSession.OrgID;
            objBudgetSection.BrID  = GlobalSession.BrID;
            string    uri          = string.Format("BudgetSection/BindAll");
            DataTable dtSubSection = CommonCls.ApiPostDataTable(uri, objBudgetSection);
            if (dtSubSection.Rows.Count > 0)
            {
                grdSection.DataSource = dtSubSection;
                grdSection.DataBind();
                VSSection = dtSubSection;


                lstSeaction.DataSource     = dtSubSection;
                lstSeaction.DataTextField  = "SectionName";
                lstSeaction.DataValueField = "SectionName";
                lstSeaction.DataBind();


                //pnlSectionGrid.Visible = true;
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
예제 #3
0
    private void FillVoucherType()
    {
        try
        {
            objNarrMastermodel = new NarrationMasterModel()
            {
                Ind   = 22,
                OrgID = GlobalSession.OrgID,
                BrID  = GlobalSession.BrID,
                // YrCD = GlobalSession.YrCD,
                //VchType = Convert.ToInt32(Session["VchType"]),
            };

            string    uri = string.Format("NarrationMaster/FillVoucher");
            DataTable WarehouseVoucherlist = CommonCls.ApiPostDataTable(uri, objNarrMastermodel);
            if (WarehouseVoucherlist.Rows.Count > 0)
            {
                ddlFillVoucher.DataSource     = WarehouseVoucherlist;
                ddlFillVoucher.DataTextField  = "DocTypeDesc";
                ddlFillVoucher.DataValueField = "DocTypeID";
                ddlFillVoucher.DataBind();
                ddlFillVoucher.Items.Insert(0, new ListItem("-- Select --", "0"));
            }
        }
        catch (Exception ex)
        {
            // ShowMessage(ex.Message, false);
        }
    }
예제 #4
0
    private DataTable checkExistingEntry()
    {
        objOpeningBalance       = new OpeningBalanceModel();
        objOpeningBalance.Ind   = 2;//check yrcode acording companyId,BranchID and YearCode
        objOpeningBalance.yrcd  = GlobalSession.BudgetYrCD;
        objOpeningBalance.OrgID = GlobalSession.OrgID;
        objOpeningBalance.BrID  = GlobalSession.BrID;

        uri = string.Format("OpeningBalance/CheckyrCode");
        DataTable dtOpeningBalance = CommonCls.ApiPostDataTable(uri, objOpeningBalance);

        if (dtOpeningBalance.Rows.Count > 0)
        {
            txtCurrentBudgetAmt.Text       = dtOpeningBalance.Rows[0]["CurrentBudgetAmt"].ToString();
            txtPreviousYearBudgetAmt.Text  = dtOpeningBalance.Rows[0]["PreviousYearBudgetAmt"].ToString();
            txtPreviousYearActualAmt.Text  = dtOpeningBalance.Rows[0]["PreviousYearActualAmt"].ToString();
            txtPreviousYear2ActualAmt.Text = dtOpeningBalance.Rows[0]["PreviousYear2ActualAmt"].ToString();
            // ShowMessage("Record Save successfully.", true);
            hfOpeningBalID.Value = "0";
        }
        else
        {
            //ShowMessage("Record not Save successfully.", false);
        }
        return(dtOpeningBalance);
    }
예제 #5
0
    void fillSubGroup()
    {
        try
        {
            objplgroupType       = new GroupTypeMasterModel();
            objplgroupType.Ind   = 3;
            objplgroupType.OrgID = GlobalSession.OrgID;
            objplgroupType.BrID  = GlobalSession.BrID;
            objplgroupType.YrCD  = GlobalSession.YrCD;


            string    uri = string.Format("GroupTypeMaster/FillMainType");
            DataTable GroupTypeSublist = CommonCls.ApiPostDataTable(uri, objplgroupType);
            if (GroupTypeSublist.Rows.Count > 0)
            {
                int      mainGroupID = Convert.ToInt32(ddlMainGroup.SelectedValue);
                DataView dvsub       = new DataView(GroupTypeSublist);
                dvsub.RowFilter            = "GroupType = 2 AND ParentItemGroupID = " + mainGroupID + "";
                ddlSubGroup.DataSource     = dvsub;
                ddlSubGroup.DataTextField  = "GroupName";
                ddlSubGroup.DataValueField = "ItemGroupID";
                ddlSubGroup.DataBind();
                ddlSubGroup.Items.Insert(0, new ListItem("-- Select --", "0"));
            }
        }
        catch (Exception ex)
        {
            // ShowMessage(ex.Message, false);
        }
    }
예제 #6
0
    void FillMaingroup()
    {
        try
        {
            objplgroupType       = new GroupTypeMasterModel();
            objplgroupType.Ind   = 3;
            objplgroupType.OrgID = GlobalSession.OrgID;
            objplgroupType.YrCD  = GlobalSession.YrCD;

            string    uri = string.Format("GroupTypeMaster/FillMainType");
            DataTable GroupTypeMainlist = CommonCls.ApiPostDataTable(uri, objplgroupType);
            if (GroupTypeMainlist.Rows.Count > 0)
            {
                DataView dv = new DataView(GroupTypeMainlist);
                dv.RowFilter                = "GroupType = 1"; // query example = "id = 10"
                ddlMainGroup.DataSource     = dv;
                ddlMainGroup.DataTextField  = "GroupName";
                ddlMainGroup.DataValueField = "ItemGroupId";
                ddlMainGroup.DataBind();
                ddlMainGroup.Items.Insert(0, new ListItem("-- Select --", "0"));
            }
        }
        catch (Exception ex)
        {
            // ShowMessage(ex.Message, false);
        }
    }
예제 #7
0
    protected void btnSave_Click(object sender, EventArgs e) //button Save
    {
        lblMsg.Text = lblMsg.CssClass = "";

        if (!CommonCls.CheckGUIDIsValid())
        {
            return;
        }

        objSundriModel             = new SundriesModel();
        objSundriModel.Ind         = 3;
        objSundriModel.OrgID       = GlobalSession.OrgID;
        objSundriModel.TblSundries = CreateAccountHeadData();

        string    uri        = string.Format("Sundri/SaveChkAllocated");
        DataTable dtSaveItem = CommonCls.ApiPostDataTable(uri, objSundriModel);

        if (dtSaveItem.Rows.Count > 0)
        {
            ShowMessage("Data Save Successfully!", true);
        }
        else
        {
            ShowMessage("Data Not Save Successfully!", false);
        }
    }
    void FillWareHouse()
    {
        objplOpenStock = new ItemOpenningStockModel()
        {
            Ind   = 2,
            OrgID = GlobalSession.OrgID,
            BrID  = GlobalSession.BrID,
            YrCD  = GlobalSession.YrCD,
        };

        string    uri         = string.Format("ItemOpenStock/FillWareHouse");
        DataTable dtWareHouse = CommonCls.ApiPostDataTable(uri, objplOpenStock);

        if (dtWareHouse.Rows.Count > 0)
        {
            ddlwarehouse.DataSource     = dtWareHouse;
            ddlwarehouse.DataTextField  = "WareHouseAddress";
            ddlwarehouse.DataValueField = "WareHouseID";
            ddlwarehouse.DataBind();
            ddlwarehouse.Items.Insert(0, new ListItem {
                Text = "-Select-", Value = "0"
            });
            ddlwarehouse.SelectedIndex = 0;
        }
    }
예제 #9
0
    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);
        }
    }
예제 #10
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            lblMsg.Text = lblMsg.CssClass = "";

            if (!CommonCls.CheckGUIDIsValid())
            {
                return;
            }

            if (ddlFillVoucher.SelectedValue == "0")
            {
                ddlFillVoucher.Focus();
                ShowMessage("Select Voucher Type..!", false);
                return;
            }
            if (string.IsNullOrEmpty(txtSnarration.Text.Trim()))
            {
                txtSnarration.Focus();
                ShowMessage("Enter Narration..!", false);
                return;
            }
            objNarrMastermodel = new NarrationMasterModel()
            {
                Ind   = 2,
                OrgID = GlobalSession.OrgID,
                BrID  = GlobalSession.BrID,
                YrCD  = GlobalSession.YrCD,
                User  = GlobalSession.UserID,
                IP    = GlobalSession.IP,
            };

            objNarrMastermodel.DocTypeID = Convert.ToInt32(ddlFillVoucher.SelectedItem.Value);

            objNarrMastermodel.NarrDesc = txtSnarration.Text;
            string    uri = string.Format("NarrationMaster/SaveProcess");
            DataTable WarehouSaveProcess = CommonCls.ApiPostDataTable(uri, objNarrMastermodel);
            if (WarehouSaveProcess.Rows.Count > 0)
            {
                ShowMessage("Data Is SucessFully Saved..!", true);
            }
            else
            {
                ShowMessage("Data Is Not Saved SucessFully..!", false);
            }
            FillGrid();
            clear();
        }
        catch (Exception ex)
        {
            // ShowMessage(ex.Message, false);
        }
    }
예제 #11
0
    public int MatchInd(string SelectedValue)
    {
        objSundriModel            = new SundriesModel();
        objSundriModel.Ind        = 2;
        objSundriModel.OrgID      = GlobalSession.OrgID;
        objSundriModel.SundriCode = int.Parse(SelectedValue);

        string    uri        = string.Format("Sundri/MatchInd");
        DataTable dsMatchInd = CommonCls.ApiPostDataTable(uri, objSundriModel);

        return(int.Parse(dsMatchInd.Rows[0]["InvoiceCnt"].ToString()));
    }
    void fillGrid()
    {
        objplOpenStock = new ItemOpenningStockModel()
        {
            Ind    = 32,
            OrgID  = GlobalSession.OrgID,
            BrID   = GlobalSession.BrID,
            YrCD   = GlobalSession.YrCD,
            ItemID = Convert.ToInt32(ddlItemName.SelectedValue),
        };

        string    uri = string.Format("ItemOpenStock/FillGridItem");
        DataTable FillGridItemName = CommonCls.ApiPostDataTable(uri, objplOpenStock);

        if (FillGridItemName.Rows.Count > 0)
        {
            //grdOpenStockEntry.DataSource = FillGridItemName;
            //grdOpenStockEntry.DataBind();

            FillGridItemName.Columns["CompanyID"].SetOrdinal(0);
            FillGridItemName.Columns["WareHouseID"].SetOrdinal(1);
            FillGridItemName.Columns["Address"].SetOrdinal(2);
            FillGridItemName.Columns["ItemUnitID"].SetOrdinal(3);
            FillGridItemName.Columns["ItemOpeningQty"].SetOrdinal(4);
            FillGridItemName.Columns["ItemMinorUnitID"].SetOrdinal(5);
            FillGridItemName.Columns["ItemMinorUnitQty"].SetOrdinal(6);
            FillGridItemName.Columns["ItemOpeningRate"].SetOrdinal(7);
            FillGridItemName.Columns["ItemOpeningDate"].SetOrdinal(8);

            if (FillGridItemName.Columns.Contains("ItemOpeningRate1"))
            {
                FillGridItemName.Columns.Remove("ItemOpeningRate1");
            }
            if (FillGridItemName.Columns.Contains("UnitName"))
            {
                FillGridItemName.Columns.Remove("UnitName");
            }
            foreach (DataRow item in FillGridItemName.Rows)
            {
                item["ItemOpeningDate"] = CommonCls.ConvertToDate(item["ItemOpeningDate"].ToString());
            }

            gridOpenStock.DataSource = VsDtOpenStock = FillGridItemName;
            gridOpenStock.DataBind();
        }
        else
        {
            gridOpenStock.DataSource = null;
            gridOpenStock.DataBind();
            //grdOpenStockEntry.DataSource = null;
            //grdOpenStockEntry.DataBind();
        }
    }
예제 #13
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (ddlbank.SelectedValue == "0")
            {
                ShowMessage("Please Select Bank Name.", false);
                ddlbank.Focus();
                return;
            }

            if (ViewState["grdData"] == null)
            {
                ShowMessage("Please Click Add Button For Add Checque Series.", false);
                txtChequefrom.Focus();

                return;
            }

            objChkseries          = new ChequeSeriesModel();
            objChkseries.Ind      = 1;
            objChkseries.OrgID    = GlobalSession.OrgID;
            objChkseries.BrID     = GlobalSession.BrID;
            objChkseries.BankCode = Convert.ToInt32(ddlbank.SelectedValue);
            if (VSItemsData.Columns.Contains("ID"))
            {
                VSItemsData.Columns.Remove("ID");
            }
            objChkseries.DtChkSeries = VSItemsData;

            string    uri           = string.Format("ChequeSeries/SaveChkSerices");
            DataTable dtSaveChkList = CommonCls.ApiPostDataTable(uri, objChkseries);
            if (dtSaveChkList.Rows.Count > 0)
            {
                ShowMessage("Data Save Sucessfully.", true);
                ddlbank.Enabled = true;
                //  pnlSectionGrid.Visible = false;
                ClearAll();
            }
            else
            {
                ShowMessage("Data Not Save Sucessfully.", false);
                return;
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
    private void BindAllocatedScheme()
    {
        objNewBudgetAmountModel     = new NewBudgetAmountModel();
        objNewBudgetAmountModel.Ind = 12;
        string    uri      = string.Format("NewBudgetAmount/BindAllocatedScheme");
        DataTable dtScheme = CommonCls.ApiPostDataTable(uri, objNewBudgetAmountModel);

        if (dtScheme.Rows.Count > 0)
        {
            DataView dv31 = new DataView(dtScheme);
            dv31.RowFilter       = "DepartmentName Not = 'Not Allocated' And SubDepartmentName Not = 'Not Allocated'";
            grdScheme.DataSource = dv31.ToTable();
            grdScheme.DataBind();
        }
    }
예제 #15
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            objBudgetYearActivation     = new BudgetYearActivationModel();
            objBudgetYearActivation.Ind = 1;

            objBudgetYearActivation.YrCode     = 18;
            objBudgetYearActivation.YearFromTo = ddlFinancialYr.SelectedValue;
            objBudgetYearActivation.ActiveID   = 1;
            objBudgetYearActivation.UserID     = GlobalSession.UserID;
            objBudgetYearActivation.IPAddress  = GlobalSession.IP;
            objBudgetYearActivation.AccountInd = 0;
            objBudgetYearActivation.BudgetInd  = 1;

            objBudgetYearActivation.YrStartDate = CommonCls.ConvertToDate("01/04/2018");
            objBudgetYearActivation.YrEndDate   = CommonCls.ConvertToDate("31/03/2019");

            objBudgetYearActivation.BudgetOrderNumber     = txtOrderNo.Text;
            objBudgetYearActivation.BudgetOrderDate       = CommonCls.ConvertToDate(txtOrderDate.Text);
            objBudgetYearActivation.AccountingOrderDate   = "";
            objBudgetYearActivation.AccountingOrderNumber = "";
            objBudgetYearActivation.AccountingEntryDate   = "";
            string    uri    = string.Format("BudgetYearActivation/SaveFinancialYear");
            DataTable dtYear = CommonCls.ApiPostDataTable(uri, objBudgetYearActivation);
            if (dtYear.Rows.Count > 0)
            {
                if (dtYear.Rows[0][0].ToString() == "1")
                {
                    ShowMessage("Financial Year is Activated For Year" + ddlFinancialYr.SelectedValue, true);
                }
            }
            else
            {
                ShowMessage("Data is not saved successfully", false);
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
예제 #16
0
    private void FillGrid()
    {
        objNarrMastermodel = new NarrationMasterModel()
        {
            Ind       = 1,
            OrgID     = GlobalSession.OrgID,
            BrID      = GlobalSession.BrID,
            YrCD      = GlobalSession.YrCD,
            DocTypeID = Convert.ToInt32(ddlFillVoucher.SelectedValue),
        };

        string    uri = string.Format("NarrationMaster/FillGrid");
        DataTable WarehouseFillGridlist = CommonCls.ApiPostDataTable(uri, objNarrMastermodel);

        if (WarehouseFillGridlist.Rows.Count > 0)
        {
            grdNarration.DataSource = WarehouseFillGridlist;
            grdNarration.DataBind();
        }
    }
예제 #17
0
    private void LoadFinancialYear()
    {
        try
        {
            objBudgetYearActivation     = new BudgetYearActivationModel();
            objBudgetYearActivation.Ind = 11;

            string    uri             = string.Format("BudgetYearActivation/LoadFinancialYear");
            DataTable dtFinancialYear = CommonCls.ApiPostDataTable(uri, objBudgetYearActivation);
            if (dtFinancialYear.Rows.Count > 0)
            {
                txtOrderNo.Text              = dtFinancialYear.Rows[0]["BudgetOrderNumber"].ToString();
                txtOrderDate.Text            = CommonCls.ConvertDateDB(dtFinancialYear.Rows[0]["BudgetOrderDate"].ToString());
                ddlFinancialYr.SelectedValue = dtFinancialYear.Rows[0]["YearFromTo"].ToString();
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
예제 #18
0
    protected void ddlbank_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlbank.SelectedValue == "0")
        {
            lblMsg.Text     = "";
            lblMsg.CssClass = "";
        }
        else
        {
            lblMsg.Text           = "";
            lblMsg.CssClass       = "";
            objChkseries          = new ChequeSeriesModel();
            objChkseries.Ind      = 2;
            objChkseries.OrgID    = GlobalSession.OrgID;
            objChkseries.BrID     = GlobalSession.BrID;
            objChkseries.BankCode = Convert.ToInt32(ddlbank.SelectedValue);
            // objChkseries.DtChkSeries = VSItemsData;

            string    uri             = string.Format("ChequeSeries/ddlBankSeries");
            DataTable dtSearchChkList = CommonCls.ApiPostDataTable(uri, objChkseries);
            if (dtSearchChkList.Rows.Count > 0)
            {
                // pnlSectionGrid.Visible = true;
                grdchequeseries.DataSource = ViewState["grdData"] = dtSearchChkList;
                grdchequeseries.DataBind();
            }
            else
            {
                grdchequeseries.DataSource = new DataTable();
                grdchequeseries.DataBind();
                ViewState["grdData"] = null;
                //ShowMessage("Data Not Available Given Check Series Please Add Cheque Series.", false);
                return;
            }
        }
    }
예제 #19
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        lblMsg.Text = lblMsg.CssClass = "";
        bool IsValid = ValidationBtnSave();

        if (!IsValid)
        {
            return;
        }


        bool chkUncheck = false;

        foreach (GridViewRow grdRow in grdReportFormats.Rows)
        {
            CheckBox chkSelectOnce = (CheckBox)grdRow.FindControl("chkSelectOnce");
            if (chkSelectOnce.Checked == true)
            {
                hfFormatID.Value = ((Label)grdRow.FindControl("lblFormatID")).Text;
                chkUncheck       = true;
                break;
            }
        }

        objPCModel = new ProfileCreationModel();

        objPCModel.Ind             = 1;
        objPCModel.CompName        = txtCompanyName.Text;
        objPCModel.ShortName       = txtShortName.Text;
        objPCModel.OrgType         = Convert.ToInt32(ddlOrgType.SelectedValue);
        objPCModel.BusiNature      = Convert.ToInt32(ddlBussiNature.SelectedValue);
        objPCModel.BusiType        = Convert.ToInt32(ddlBussiType.SelectedValue);
        objPCModel.Addr            = txtAddress.Text;
        objPCModel.City            = txtCityCompany.Text;
        objPCModel.State           = Convert.ToInt32(ddlStateCompany.SelectedValue);
        objPCModel.Pin             = Convert.ToInt32(txtPincodeCompany.Text);
        objPCModel.Phone           = txtLandLineNo.Text;
        objPCModel.Fax             = txtFaxNo.Text;
        objPCModel.EMail           = txtEmail.Text;
        objPCModel.PAN             = txtPanNo.Text;
        objPCModel.TAN             = txtTanNo.Text;
        objPCModel.CIN             = txtCINNo.Text;
        objPCModel.IECode          = txtImportExportCode.Text;
        objPCModel.ExportCtg       = 0;
        objPCModel.ContactName     = txtPersonName.Text;
        objPCModel.ContactDesg     = txtDesiPerson.Text;
        objPCModel.ContactEmail    = txtEmailPerson.Text;
        objPCModel.ContactMobile   = txtMobileNoPerson.Text;
        objPCModel.AltPerson       = txtPersonNameAlter.Text;
        objPCModel.AltPersonDesg   = txtDesiPersonAlter.Text;
        objPCModel.AltPersonEmail  = txtEmailPersonAlter.Text;
        objPCModel.AltMobile       = txtMobileNoPersonAlter.Text;
        objPCModel.Composition     = Convert.ToInt32(ddlComposiOpted.SelectedValue);
        objPCModel.CompositionDate = CommonCls.ConvertToDate(txtCompoEffDate.Text);
        objPCModel.GSTIN           = string.IsNullOrEmpty(txtGSTIN.Text) ? "" : txtGSTIN.Text;
        objPCModel.RegDate         = string.IsNullOrEmpty(CommonCls.ConvertToDate(txtRegDate.Text)) ? "" : CommonCls.ConvertToDate(txtRegDate.Text);
        objPCModel.RegAddr         = string.IsNullOrEmpty(txtRegAddress.Text) ? "" : txtRegAddress.Text;
        objPCModel.RegCity         = string.IsNullOrEmpty(txtCityGSTIN.Text) ? "" : txtCityGSTIN.Text;
        objPCModel.RegState        = Convert.ToInt32(ddlStateGSTIN.SelectedValue) == 0 ? 0 : Convert.ToInt32(ddlStateGSTIN.SelectedValue);
        objPCModel.RegPin          = string.IsNullOrEmpty(txtPincodeGSTIN.Text) ? 0 : Convert.ToInt32(txtPincodeGSTIN.Text);
        objPCModel.RegAuthPerson   = txtAuthorizedSign.Text;
        objPCModel.RegAuthDesg     = txtAuthorizedDesi.Text;
        objPCModel.InvoiceNoSeries = ""; //txtInvioceSeries.Text;
        objPCModel.InvoiceNo       = 0;  //string.IsNullOrEmpty(txtStartingNo.Text) ? 0 : Convert.ToInt32(txtStartingNo.Text);
        objPCModel.YrCD            = GlobalSession.YrCD;
        objPCModel.User            = GlobalSession.UserID;
        objPCModel.IP = GlobalSession.IP;
        objPCModel.InvoiceCaption1     = txtInvoiceCaption1.Text;
        objPCModel.InvoicePrint1       = Convert.ToInt32(ddlInvoicePrint1.SelectedValue);
        objPCModel.InvoiceCaption2     = txtInvoiceCaption2.Text;
        objPCModel.InvoicePrint2       = Convert.ToInt32(ddlInvoicePrint2.SelectedValue);
        objPCModel.InvoiceCaption3     = txtInvoiceCaption3.Text;
        objPCModel.InvoicePrint3       = Convert.ToInt32(ddlInvoicePrint3.SelectedValue);
        objPCModel.InvoiceCaption4     = txtInvoiceCaption4.Text;
        objPCModel.InvoicePrint4       = Convert.ToInt32(ddlInvoicePrint4.SelectedValue);
        objPCModel.InvoiceCaption5     = txtInvoiceCaption5.Text;
        objPCModel.InvoicePrint5       = Convert.ToInt32(ddlInvoicePrint5.SelectedValue);
        objPCModel.CompanyLogo         = imgCompanyLogo.ImageUrl.Substring(imgCompanyLogo.ImageUrl.LastIndexOf("/") + 1);
        objPCModel.DtSeries            = VsDtSeries; // Series Table
        objPCModel.UnRegistered        = ddlCompanyType.SelectedValue == "1" ? 0 : ddlCompanyType.SelectedValue == "2" ? 0 : 1;
        objPCModel.CompanyType         = Convert.ToInt32(ddlCompanyType.SelectedValue);
        objPCModel.TurnoverID          = Convert.ToInt32(ddlTurnover.SelectedValue);
        objPCModel.TurnoverDescription = ddlTurnover.SelectedItem.Text;
        objPCModel.PrintHSNSACCode     = Convert.ToInt32(ddlPrintTurnover.SelectedValue);
        objPCModel.BankName            = txtBankName.Text;
        objPCModel.IFSCCode            = txtIFSCCode.Text;
        objPCModel.AccountNumber       = txtAccountNumber.Text;

        if (cbCopyType.Items[0].Selected)
        {
            objPCModel.InvoiceCopy1Header = cbCopyType.Items[0].Text;
        }
        if (cbCopyType.Items[1].Selected)
        {
            objPCModel.InvoiceCopy2Header = cbCopyType.Items[1].Text;
        }
        if (cbCopyType.Items[2].Selected)
        {
            objPCModel.InvoiceCopy3Header = cbCopyType.Items[2].Text;
        }
        if (cbCopyType.Items[3].Selected)
        {
            objPCModel.InvoiceCopy4Header = txtExtra1.Text;
        }
        if (cbCopyType.Items[4].Selected)
        {
            objPCModel.InvoiceCopy5Header = txtExtra2.Text;
        }


        objPCModel.InvoiceOnPrePrinted = Convert.ToInt32(ddlSIOnPrePrinted.SelectedValue);
        objPCModel.InvoiceCopyNo       = string.IsNullOrEmpty(txtNoPrintedCopy.Text) ? 0 : Convert.ToInt32(txtNoPrintedCopy.Text);

        objPCModel.CompositionCategoryID = ddlCompositionCategory.SelectedItem == null ? 0 : Convert.ToInt32(ddlCompositionCategory.SelectedValue);

        if (VSDTCompositionCategory != null) // First Time DataTable Create For Grid
        {
            DataRow[] row = VSDTCompositionCategory.Select("CompositionCategoryID=" + Convert.ToInt32(ddlCompositionCategory.SelectedValue));
            if (row.Count() > 0)
            {
                objPCModel.CompositionTaxRate = CommonCls.ConvertDecimalZero(row[0]["CompositionTaxRate"]);
            }
        }
        objPCModel.StcokMaintaneByMinorUnit = Convert.ToInt32(ddlStockMISecUnit.SelectedValue);

        if (chkUncheck == true)
        {
            objPCModel.ReportFormat = Convert.ToInt32(hfFormatID.Value);
        }
        else
        {
            lblMsg.Text = "Choose Invoice Format!";
            ShowMessage(lblMsg.Text, false);
            return;
        }

        if (VSTerms != null)
        {
            objPCModel.DtTerms = VSTerms;//(DataTable)ViewState["dtTerms"];
        }
        else
        {
            DataTable dtTerms = new DataTable();
            dtTerms.Columns.Add("Terms", typeof(string));
            dtTerms.Columns.Add("UserID", typeof(int));
            dtTerms.Columns.Add("IP", typeof(string));

            DataRow drTerms = dtTerms.NewRow();
            drTerms["Terms"]  = "";
            drTerms["UserID"] = GlobalSession.UserID;
            drTerms["IP"]     = GlobalSession.IP;
            dtTerms.Rows.Add(drTerms);
            objPCModel.DtTerms = dtTerms;
        }

        string    uri    = string.Format("ProfileCreation/SaveCompanyProfile");
        DataTable dtSave = CommonCls.ApiPostDataTable(uri, objPCModel);

        if (dtSave.Rows.Count > 0)
        {
            if (dtSave.Rows[0]["RecordID"].ToString() == "0")
            {
                lblMsg.Text = "Record Not Save Please Try Again.";
                ShowMessage(lblMsg.Text, false);
            }
            else if (dtSave.Rows[0]["RecordID"].ToString() == "1")
            {
                ClearAll();
                Response.Redirect("frmSuccessfullyProfileCreation.aspx?ProfileCreation=" + "Profile Create Successfully!&&OrgName=" + GlobalSession.OrgName);
            }
            else if (dtSave.Rows[0]["RecordID"].ToString() == "2")
            {
                lblMsg.Text = "Duplicate Record.";
                ShowMessage(lblMsg.Text, false);
                txtCompanyName.Focus();
            }
        }
        else
        {
            lblMsg.Text = "Record Not Save Please Try Again.";
            ShowMessage(lblMsg.Text, false);
        }
    }
예제 #20
0
    // protected void btnclear_Click(object sender, EventArgs e)
    // {
    //     txtCurrentBudgetAmt.Focus();
    //     ClearAll();
    //}

    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (string.IsNullOrEmpty(txtCurrentBudgetAmt.Text) || Convert.ToDecimal(txtCurrentBudgetAmt.Text) <= 0)
            {
                ShowMessage("Enter " + lblOBalBg1718.Text + " .", false);
                txtCurrentBudgetAmt.Focus();
                return;
            }

            //if (System.Text.RegularExpressions.Regex.IsMatch(txtCurrentBudgetAmt.Text, "[^0-9]"))
            //{
            //    ShowMessage("Please enter only numbers.", false);
            //    txtCurrentBudgetAmt.Text = txtCurrentBudgetAmt.Text.Remove(txtCurrentBudgetAmt.Text.Length - 1);
            //    txtCurrentBudgetAmt.Focus();
            //    return;
            //}
            //if (System.Text.RegularExpressions.Regex.IsMatch(txtPreviousYearBudgetAmt.Text, "[^0-9]"))
            //{
            //    ShowMessage("Please enter only numbers.", false);
            //    txtPreviousYearBudgetAmt.Text = txtPreviousYearBudgetAmt.Text.Remove(txtPreviousYearBudgetAmt.Text.Length - 1);
            //    txtPreviousYearBudgetAmt.Focus();
            //    return;
            //}
            //if (System.Text.RegularExpressions.Regex.IsMatch(txtPreviousYearActualAmt.Text, "[^0-9]"))
            //{
            //    ShowMessage("Please enter only numbers.", false);
            //    txtPreviousYearActualAmt.Text = txtPreviousYearActualAmt.Text.Remove(txtPreviousYearActualAmt.Text.Length - 1);
            //    txtPreviousYearActualAmt.Focus();
            //    return;
            //}
            //if (System.Text.RegularExpressions.Regex.IsMatch(txtPreviousYear2ActualAmt.Text, "[^0-9]"))
            //{
            //    ShowMessage("Please enter only numbers.", false);
            //    txtPreviousYear2ActualAmt.Text = txtPreviousYear2ActualAmt.Text.Remove(txtPreviousYear2ActualAmt.Text.Length - 1);
            //    txtPreviousYear2ActualAmt.Focus();
            //    return;
            //}

            if (string.IsNullOrEmpty(txtPreviousYearBudgetAmt.Text))
            {
                txtPreviousYearBudgetAmt.Text = "0";
                //ShowMessage(lblOBalBg1617.Text, false);
                //txtPreviousYearBudgetAmt.Focus();
                //return;
            }

            if (string.IsNullOrEmpty(txtPreviousYearActualAmt.Text))
            {
                txtPreviousYearActualAmt.Text = "0";
                //ShowMessage(lblOBalAc1617.Text, false);
                //txtPreviousYearActualAmt.Focus();
                //return;
            }

            if (string.IsNullOrEmpty(txtPreviousYear2ActualAmt.Text))
            {
                txtPreviousYear2ActualAmt.Text = "0";
                //ShowMessage(lblOBalAc1516.Text, false);
                //txtPreviousYear2ActualAmt.Focus();
                //return;
            }

            objOpeningBalance                        = new OpeningBalanceModel();
            objOpeningBalance.OrgID                  = GlobalSession.OrgID;
            objOpeningBalance.BrID                   = GlobalSession.BrID;
            objOpeningBalance.yrcd                   = GlobalSession.BudgetYrCD;
            objOpeningBalance.CurrentBudgetAmt       = Convert.ToDecimal(txtCurrentBudgetAmt.Text);
            objOpeningBalance.PreviousYearBudgetAmt  = Convert.ToDecimal(txtPreviousYearBudgetAmt.Text);
            objOpeningBalance.PreviousYearActualAmt  = Convert.ToDecimal(txtPreviousYearActualAmt.Text);
            objOpeningBalance.PreviousYear2ActualAmt = Convert.ToDecimal(txtPreviousYear2ActualAmt.Text);


            if (hfOpeningBalID.Value == "0")
            {
                objOpeningBalance.Ind = 1;//For Saving Data
                uri = string.Format("OpeningBalance/SaveOpeningBalance");
            }
            //else
            //{
            //    objOpeningBalance.Ind = 2;//For Update Data
            //    //objOpeningBalance.SectionID = CommonCls.ConvertIntZero(hfSectionID.Value);
            //    uri = string.Format("OpeningBalance/UpdateBudgetSection");
            //}

            DataTable dtOpeningBalance = CommonCls.ApiPostDataTable(uri, objOpeningBalance);
            if (dtOpeningBalance.Rows.Count > 0)
            {
                ShowMessage("Record Save successfully.", true);
                // ClearAll();
                hfOpeningBalID.Value = "0";
                //BindAll();
            }
            else
            {
                ShowMessage("Record not Save successfully.", false);
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
예제 #21
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (ddlSection.SelectedValue == "0")
            {
                ShowMessage("Select Group Name.", false);
                ddlSection.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtSubSectionName.Text))
            {
                ShowMessage("Enter Cost Centre Name.", false);
                txtSubSectionName.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtSubSectionNameHindi.Text))
            {
                ShowMessage("Enter Cost Centre Name(Hindi).", false);
                txtSubSectionNameHindi.Focus();
                return;
            }

            objSubBudgetSection                     = new BudgetSubSectionModel();
            objSubBudgetSection.OrgID               = GlobalSession.OrgID;
            objSubBudgetSection.BrID                = GlobalSession.BrID;
            objSubBudgetSection.User                = GlobalSession.UserID;
            objSubBudgetSection.IP                  = GlobalSession.IP;
            objSubBudgetSection.SubSectionName      = (txtSubSectionName.Text).ToUpper().Trim();
            objSubBudgetSection.SubSectionNameHindi = (txtSubSectionNameHindi.Text).Trim();
            objSubBudgetSection.ParentSectionID     = CommonCls.ConvertIntZero(ddlSection.SelectedValue);
            objSubBudgetSection.SchemeCode          = (txtSchemeCode.Text).Trim();

            string uri;
            if (hfSectionID.Value == "0")
            {
                if (VSSubSection != null)
                {
                    bool IsValid = CheckSectionNameExisting();
                    if (!IsValid)
                    {
                        return;
                    }
                }
                objSubBudgetSection.Ind = 1;//For Saving Data
                uri = string.Format("BudgetSubSection/SaveBudgetSubSection");
            }
            else
            {
                objSubBudgetSection.Ind       = 2;//For Update Data
                objSubBudgetSection.SectionID = CommonCls.ConvertIntZero(hfSectionID.Value);
                uri = string.Format("BudgetSubSection/UpdateBudgetSubSection");
            }

            DataTable dtSubSection = CommonCls.ApiPostDataTable(uri, objSubBudgetSection);
            if (dtSubSection.Rows.Count > 0)
            {
                ShowMessage("Record Save successfully.", true);
                hfSectionID.Value = "0";
                BindAll();
                ClearAll();
                ddlSection_SelectedIndexChanged(sender, e);
            }
            else
            {
                ShowMessage("Record not Save successfully.", false);
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
예제 #22
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (string.IsNullOrEmpty(txtSectionName.Text))
            {
                ShowMessage("Enter Group Name.", false);
                txtSectionName.Focus();
                return;
            }


            //if (!string.IsNullOrEmpty(txtSectionName.Text))
            //{
            //    if (Regex.IsMatch((txtSectionName.Text).ToUpper().Trim(), @"/^[ A-Za-z0-9-%().*/&]*$/"))
            //    {
            //        ShowMessage("Enter Valid Section Name.", false);
            //        txtSectionName.Focus();
            //        return;
            //    }
            //    else
            //    {

            //    }
            //}
            if (string.IsNullOrEmpty(txtSectionNameHindi.Text))
            {
                ShowMessage("Enter Group Name(Hindi).", false);
                txtSectionNameHindi.Focus();
                return;
            }

            if (VSSection != null)
            {
                bool IsValid = CheckSectionNameExisting();
                if (!IsValid)
                {
                    return;
                }
            }
            objBudgetSection                  = new BudgetSectionModel();
            objBudgetSection.OrgID            = GlobalSession.OrgID;
            objBudgetSection.BrID             = GlobalSession.BrID;
            objBudgetSection.User             = GlobalSession.UserID;
            objBudgetSection.IP               = GlobalSession.IP;
            objBudgetSection.SectionName      = (txtSectionName.Text).ToUpper().Trim();
            objBudgetSection.SectionNameHindi = (txtSectionNameHindi.Text).Trim();
            objBudgetSection.ParentSectionID  = 0;
            string uri;
            if (hfSectionID.Value == "0")
            {
                objBudgetSection.Ind = 1;//For Saving Data
                uri = string.Format("BudgetSection/SaveBudgetSection");
            }
            else
            {
                objBudgetSection.Ind       = 2;//For Update Data
                objBudgetSection.SectionID = CommonCls.ConvertIntZero(hfSectionID.Value);
                uri = string.Format("BudgetSection/UpdateBudgetSection");
            }

            DataTable dtSection = CommonCls.ApiPostDataTable(uri, objBudgetSection);
            if (dtSection.Rows.Count > 0)
            {
                ShowMessage("Record Save successfully.", true);
                ClearAll();
                hfSectionID.Value = "0";
                BindAll();
            }
            else
            {
                ShowMessage("Record not Save successfully.", false);
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
예제 #23
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (!CommonCls.CheckGUIDIsValid())
            {
                return;
            }

            if (ddlGroupType.SelectedValue == "0")
            {
                ddlGroupType.Focus();
                lblMsg.Text = "Select Group Type..!";
                return;
            }
            if (ddlGroupType.SelectedValue == "2")
            {
                if (ddlMainGroup.SelectedValue == "0")
                {
                    ddlMainGroup.Focus();
                    lblMsg.Text = "Select  Main Group!";
                    return;
                }
            }
            else if (ddlGroupType.SelectedValue == "3")
            {
                if (ddlMainGroup.SelectedValue == "0")
                {
                    ddlMainGroup.Focus();
                    lblMsg.Text = "Select  Main Group!";
                    return;
                }
                if (ddlSubGroup.SelectedValue == "0")
                {
                    lblMsg.Text = "Select  Sub Group!";
                    return;
                }
            }
            if (string.IsNullOrEmpty(txtName.Text.Trim()))
            {
                txtName.Focus();
                lblMsg.Text = "Enter Group Name..! ";
                return;
            }
            objplgroupType       = new GroupTypeMasterModel();
            objplgroupType.Ind   = 1;
            objplgroupType.OrgID = GlobalSession.OrgID;
            objplgroupType.User  = GlobalSession.UserID;
            objplgroupType.IP    = GlobalSession.IP;

            objplgroupType.GrType = Convert.ToInt32(ddlGroupType.SelectedItem.Value);
            if (ddlGroupType.SelectedValue == "1")
            {
                objplgroupType.ParentID = 0;
            }
            else if (ddlGroupType.SelectedValue == "2")
            {
                objplgroupType.ParentID = Convert.ToInt32(ddlMainGroup.SelectedValue);
            }
            else if (ddlGroupType.SelectedValue == "3")
            {
                objplgroupType.ParentID = Convert.ToInt32(ddlSubGroup.SelectedValue);
            }

            //objplgroupType.ParentID = string.IsNullOrEmpty(ddlMainGroup.SelectedValue) ? 0 : ddlSubGroup.SelectedValue;
            //objplgroupType.ParentID = Convert.ToInt32(ddlMainGroup.SelectedValue == null ? "0" : ddlMainGroup.SelectedValue == null ? "0" : ddlSubGroup.SelectedValue);

            objplgroupType.GrDesc = txtName.Text;
            string    uri = string.Format("GroupTypeMaster/SaveGroupItem");
            DataTable GroupMasterSaveProcess = CommonCls.ApiPostDataTable(uri, objplgroupType);
            if (GroupMasterSaveProcess.Rows.Count > 0)
            {
                if (GroupMasterSaveProcess.Rows[0]["RecordID"].ToString() == "1")
                {
                    lblMsg.Text = "Data Is SucessFully Saved..!";
                }
                else if (GroupMasterSaveProcess.Rows[0]["RecordID"].ToString() == "2")
                {
                    lblMsg.Text = "Data Already Added.";
                }
            }
            else
            {
                lblMsg.Text = "Data Is Not Saved..!";
            }
            clear();
        }
        catch (Exception ex)
        {
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (string.IsNullOrEmpty(txtSectionName.Text))
            {
                ShowMessage("Select Section Name.", false);
                txtSectionName.Focus();
                return;
            }

            if (ddlSubSection.SelectedValue == "0")
            {
                ShowMessage("Select Sub-Section Name.", false);
                ddlSubSection.Focus();
                return;
            }


            if (string.IsNullOrEmpty(txtSubSection.Text))
            {
                ShowMessage("Select Cost Centre Name.", false);
                txtSubSection.Focus();
                return;
            }

            if (string.IsNullOrEmpty(txtBudgetHead.Text))
            {
                ShowMessage("Select Budget Head Name.", false);
                txtBudgetHead.Focus();
                return;
            }
            CalCulateRevisedBudgetAmt();
            objNewBudgetAmountModel              = new NewBudgetAmountModel();
            objNewBudgetAmountModel.Ind          = 21;
            objNewBudgetAmountModel.OrgID        = GlobalSession.OrgID;
            objNewBudgetAmountModel.BrID         = GlobalSession.BrID;
            objNewBudgetAmountModel.YrCode       = GlobalSession.BudgetYrCD;
            objNewBudgetAmountModel.SectionCD    = 0;
            objNewBudgetAmountModel.SubSectionCD = CommonCls.ConvertIntZero(SubSectionID);
            objNewBudgetAmountModel.BudgetHeadCD = CommonCls.ConvertIntZero(BudgetHeadID);
            objNewBudgetAmountModel.SecCode      = CommonCls.ConvertIntZero(SectionID);

            objNewBudgetAmountModel.UserID = GlobalSession.UserID;
            objNewBudgetAmountModel.IP     = "";


            //Current Year Capital
            if (txtPropBudgetCapitalAmtDr.Text == "" && txtPropBudgetCapitalAmtDr.Enabled == true)
            {
                objNewBudgetAmountModel.PropBudgetCapitalAmtDr = -1;
            }
            else
            {
                objNewBudgetAmountModel.PropBudgetCapitalAmtDr = CommonCls.ConvertDecimalZero(txtPropBudgetCapitalAmtDr.Text);
            }

            if (txtPropBudgetCapitalAmtCr.Text == "" && txtPropBudgetCapitalAmtCr.Enabled == true)
            {
                objNewBudgetAmountModel.PropBudgetCapitalAmtCr = -1;
            }
            else
            {
                objNewBudgetAmountModel.PropBudgetCapitalAmtCr = CommonCls.ConvertDecimalZero(txtPropBudgetCapitalAmtCr.Text);
            }

            //Current Year Revenue
            if (txtPropBudgetRevenueAmtDr.Text == "" && txtPropBudgetRevenueAmtDr.Enabled == true)
            {
                objNewBudgetAmountModel.PropBudgetRevenueAmtDr = -1;
            }
            else
            {
                objNewBudgetAmountModel.PropBudgetRevenueAmtDr = CommonCls.ConvertDecimalZero(txtPropBudgetRevenueAmtDr.Text);
            }

            if (txtPropBudgetRevenueAmtCr.Text == "" && txtPropBudgetRevenueAmtCr.Enabled == true)
            {
                objNewBudgetAmountModel.PropBudgetRevenueAmtCr = -1;
            }
            else
            {
                objNewBudgetAmountModel.PropBudgetRevenueAmtCr = CommonCls.ConvertDecimalZero(txtPropBudgetRevenueAmtCr.Text);
            }


            // Propose Budget Amt
            if (txtProp2BudgetAmtDr.Text == "" && txtProp2BudgetAmtDr.Enabled == true)
            {
                objNewBudgetAmountModel.Prop2BudgetAmtDr = -1;
            }
            else
            {
                objNewBudgetAmountModel.Prop2BudgetAmtDr = CommonCls.ConvertDecimalZero(txtProp2BudgetAmtDr.Text);
            }


            if (txtProp2BudgetAmtCr.Text == "" && txtProp2BudgetAmtCr.Enabled == true)
            {
                objNewBudgetAmountModel.Prop2BudgetAmtCr = -1;
            }
            else
            {
                objNewBudgetAmountModel.Prop2BudgetAmtCr = CommonCls.ConvertDecimalZero(txtProp2BudgetAmtCr.Text);
            }


            //Actual Busget Amt

            if (txtActualUptoBudgetAmtCr.Text == "" && txtActualUptoBudgetAmtCr.Enabled == true)
            {
                objNewBudgetAmountModel.ActualUptoBudgetAmtCr = -1;
            }
            else
            {
                objNewBudgetAmountModel.ActualUptoBudgetAmtCr = CommonCls.ConvertDecimalZero(txtActualUptoBudgetAmtCr.Text);
            }

            if (txtActualUptoBudgetAmtDr.Text == "" && txtActualUptoBudgetAmtDr.Enabled == true)
            {
                objNewBudgetAmountModel.ActualUptoBudgetAmtDr = -1;
            }
            else
            {
                objNewBudgetAmountModel.ActualUptoBudgetAmtDr = CommonCls.ConvertDecimalZero(txtActualUptoBudgetAmtDr.Text);
            }


            //Qtr Amt

            if (txtPropLastQtrBudgetAmtCr.Text == "" && txtPropLastQtrBudgetAmtCr.Enabled == true)
            {
                objNewBudgetAmountModel.PropLastQtrBudgetAmtCr = -1;
            }
            else
            {
                objNewBudgetAmountModel.PropLastQtrBudgetAmtCr = CommonCls.ConvertDecimalZero(txtPropLastQtrBudgetAmtCr.Text);
            }


            if (txtPropLastQtrBudgetAmtDr.Text == "" && txtPropLastQtrBudgetAmtDr.Enabled == true)
            {
                objNewBudgetAmountModel.PropLastQtrBudgetAmtDr = -1;
            }
            else
            {
                objNewBudgetAmountModel.PropLastQtrBudgetAmtDr = CommonCls.ConvertDecimalZero(txtPropLastQtrBudgetAmtDr.Text);
            }


            //Revised
            //if (txtSanc2BudgetAmtCr.Text == "" && txtSanc2BudgetAmtCr.Enabled == true)
            //    objNewBudgetAmountModel.Sanc2BudgetAmtCr = -1;
            //else
            //    objNewBudgetAmountModel.Sanc2BudgetAmtCr = CommonCls.ConvertDecimalZero(txtSanc2BudgetAmtCr.Text);

            //if (txtSanc2BudgetAmtDr.Text == "" && txtSanc2BudgetAmtDr.Enabled == true)
            //    objNewBudgetAmountModel.Sanc2BudgetAmtDr = -1;
            //else
            //    objNewBudgetAmountModel.Sanc2BudgetAmtDr = CommonCls.ConvertDecimalZero(txtSanc2BudgetAmtDr.Text);

            objNewBudgetAmountModel.Sanc2BudgetAmtCr = (CommonCls.ConvertDecimalZero(objNewBudgetAmountModel.ActualUptoBudgetAmtCr) + CommonCls.ConvertDecimalZero(objNewBudgetAmountModel.PropLastQtrBudgetAmtCr));


            objNewBudgetAmountModel.Sanc2BudgetAmtDr = (CommonCls.ConvertDecimalZero(objNewBudgetAmountModel.ActualUptoBudgetAmtDr) + CommonCls.ConvertDecimalZero(objNewBudgetAmountModel.PropLastQtrBudgetAmtDr));



            if (txtPropBudgetCapitalAmtCr.Text == "" && txtPropBudgetRevenueAmtCr.Text == "" && txtPropBudgetCapitalAmtCr.Enabled == true && txtPropBudgetRevenueAmtCr.Enabled == true)
            {
                objNewBudgetAmountModel.PropBudgetAmtCr = -1;
            }
            else
            {
                decimal PropBudgetAmtCr = (CommonCls.ConvertDecimalZero(txtPropBudgetCapitalAmtCr.Text) + CommonCls.ConvertDecimalZero(txtPropBudgetRevenueAmtCr.Text));
                objNewBudgetAmountModel.PropBudgetAmtCr = CommonCls.ConvertDecimalZero(PropBudgetAmtCr);
            }


            if (txtPropBudgetCapitalAmtDr.Text == "" && txtPropBudgetRevenueAmtDr.Text == "" && txtPropBudgetCapitalAmtDr.Enabled == true && txtPropBudgetRevenueAmtDr.Enabled == true)
            {
                objNewBudgetAmountModel.PropBudgetAmtDr = -1;
            }
            else
            {
                decimal PropBudgetAmtDr = (CommonCls.ConvertDecimalZero(txtPropBudgetCapitalAmtDr.Text) + CommonCls.ConvertDecimalZero(txtPropBudgetRevenueAmtDr.Text));
                objNewBudgetAmountModel.PropBudgetAmtDr = CommonCls.ConvertDecimalZero(PropBudgetAmtDr);
            }

            //objNewBudgetAmountModel.PropBudgetAmtCr = CommonCls.ConvertDecimalZero(txtPropBudgetCapitalAmtCr.Text + txtPropBudgetRevenueAmtCr.Text);
            //objNewBudgetAmountModel.PropBudgetAmtDr = CommonCls.ConvertDecimalZero(txtPropBudgetCapitalAmtDr.Text + txtPropBudgetRevenueAmtDr.Text);

            string uri = string.Format("NewBudgetAmount/SaveBudget");

            DataTable dtOpeningBalance = CommonCls.ApiPostDataTable(uri, objNewBudgetAmountModel);
            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);
        }
    }
예제 #25
0
    protected void lnkHSNSACCodeSearch_Click(object sender, EventArgs e)
    {
        try
        {
            lblHSNSACErrorMSG.Text = "";
            objItemMaster          = new ItemMasterModel();

            if (ddlItemType.SelectedValue == "0")
            {
                ShowMessage("Select Item Type.", false);
                ddlItemType.Focus();
                return;
            }

            //if (ddlItemType.SelectedValue == "1")
            //{
            //    long hsnCode = "";
            //    if (txtHSNSACCode.Text.Length == 2)
            //    {
            //        hsnCode = txtHSNSACCode.Text + "000000";
            //    }
            //    else if (txtHSNSACCode.Text.Length == 4)
            //    {
            //        hsnCode = txtHSNSACCode.Text + "0000";
            //    }
            //    else if (txtHSNSACCode.Text.Length == 8)
            //    {
            //        hsnCode = txtHSNSACCode.Text;
            //    }
            //    else
            //    {
            //        txtHSNSACCode.Focus();
            //        ShowMessage("Invalid HSN Code", false);
            //        return;
            //    }

            //    if (!string.IsNullOrEmpty(hsnCode))
            //    {
            //        objItemMaster.HSNSACCode1 = hsnCode;
            //    }
            //}
            //else if (ddlItemType.SelectedValue == "2")
            //{
            //    long sacCode = "";
            //    if (txtHSNSACCode.Text.Length == 2)
            //    {
            //        sacCode = txtHSNSACCode.Text + "0000";
            //    }
            //    else if (txtHSNSACCode.Text.Length == 4)
            //    {
            //        sacCode = txtHSNSACCode.Text + "00";
            //    }
            //    else if (txtHSNSACCode.Text.Length == 6)
            //    {
            //        sacCode = txtHSNSACCode.Text;
            //    }
            //    else
            //    {
            //        txtHSNSACCode.Focus();
            //        ShowMessage("Invalid Sac Code", false);
            //        return;
            //    }

            //    if (!string.IsNullOrEmpty(sacCode))
            //    {
            //        objItemMaster.HSNSACCode1 = sacCode;
            //    }
            //}

            objItemMaster.Ind         = 30;
            objItemMaster.HSNSACCode1 = Convert.ToInt64(txtHSNSACCode.Text);

            string    uri          = string.Format("ItemMaster/LoadHSNSCDesc");
            DataTable dtHSNSACDesc = CommonCls.ApiPostDataTable(uri, objItemMaster);
            if (dtHSNSACDesc.Rows.Count > 0)
            {
                txtHSNSACDesc.Text       = dtHSNSACDesc.Rows[0]["HSNSACDesc"].ToString();
                ddlTaxrate.SelectedValue = dtHSNSACDesc.Rows[0]["TAXRATE"].ToString();
                //btnSave.Enabled = true;
                ddlWarehouse.Focus();
            }
            else
            {
                ddlTaxrate.SelectedValue = "-1";

                if (ddlItemType.SelectedValue == "1")
                {
                    txtHSNSACCode.Focus();
                    txtHSNSACDesc.Text = "";
                    //ShowMessage("Invalid HSN Code!",false);
                }
                else
                {
                    txtHSNSACCode.Focus();
                    txtHSNSACDesc.Text = "";
                    //ShowMessage("Invalid SAC Code!",false);
                }
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
    private void CheckBudgetAmountIsExist()
    {
        try
        {
            objNewBudgetAmountModel              = new NewBudgetAmountModel();
            objNewBudgetAmountModel.Ind          = 3;
            objNewBudgetAmountModel.OrgID        = GlobalSession.OrgID;
            objNewBudgetAmountModel.BrID         = GlobalSession.BrID;
            objNewBudgetAmountModel.YrCode       = GlobalSession.BudgetYrCD;//Bugdet Year for new session (18)
            objNewBudgetAmountModel.SectionCD    = CommonCls.ConvertIntZero(SectionID);
            objNewBudgetAmountModel.SubSectionCD = CommonCls.ConvertIntZero(SubSectionID);
            objNewBudgetAmountModel.BudgetHeadCD = CommonCls.ConvertIntZero(BudgetHeadID);
            string    uri          = string.Format("NewBudgetAmount/CheckBudgetAmount");
            DataTable dtSubSection = CommonCls.ApiPostDataTable(uri, objNewBudgetAmountModel);
            if (dtSubSection.Rows.Count > 0)
            {
                //userType = user.Type == 0 ? "Admin"

                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() == "-1") ? "" : dtSubSection.Rows[0]["Sanc2BudgetAmtDr"].ToString();

                txtSanc2BudgetAmtCr.Text = lblSanc2BudgetAmtCr.Text = (dtSubSection.Rows[0]["Sanc2BudgetAmtCr"].ToString() == "-1") ? "" : 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();

                //txtActualUptoBudgetAmtDr.Text = lblActualUptoBudgetAmtDr.Text = dtSubSection.Rows[0]["ActualUptoBudgetAmtDr"].ToString();

                //txtActualUptoBudgetAmtCr.Text = lblActualUptoBudgetAmtCr.Text = dtSubSection.Rows[0]["ActualUptoBudgetAmtCr"].ToString();
                //txtPropLastQtrBudgetAmtDr.Text = lblPropLastQtrBudgetAmtDr.Text = dtSubSection.Rows[0]["PropLastQtrBudgetAmtDr"].ToString();
                //txtPropLastQtrBudgetAmtCr.Text = lblPropLastQtrBudgetAmtCr.Text = dtSubSection.Rows[0]["PropLastQtrBudgetAmtCr"].ToString();
                //txtPropBudgetCapitalAmtDr.Text = lblPropBudgetAmtDr.Text = dtSubSection.Rows[0]["PropBudgetCapitalAmtDr"].ToString();
                //txtPropBudgetCapitalAmtCr.Text = lblPropBudgetAmtCr.Text = dtSubSection.Rows[0]["PropBudgetCapitalAmtCr"].ToString();
                //txtSanc2BudgetAmtDr.Text = lblSanc2BudgetAmtDr.Text = dtSubSection.Rows[0]["Sanc2BudgetAmtDr"].ToString();
                //txtSanc2BudgetAmtCr.Text = lblSanc2BudgetAmtCr.Text = dtSubSection.Rows[0]["Sanc2BudgetAmtCr"].ToString();
                //txtProp2BudgetAmtDr.Text = lblProp2BudgetAmtDr.Text = dtSubSection.Rows[0]["Prop2BudgetAmtDr"].ToString();
                //txtProp2BudgetAmtCr.Text = lblProp2BudgetAmtCr.Text = dtSubSection.Rows[0]["Prop2BudgetAmtCr"].ToString();
                //txtPropBudgetRevenueAmtDr.Text = lblPropBudgetRevenueAmtDr.Text = dtSubSection.Rows[0]["PropBudgetRevenueAmtDr"].ToString();
                //txtPropBudgetRevenueAmtCr.Text = lblPropBudgetRevenueAmtCr.Text = dtSubSection.Rows[0]["PropBudgetRevenueAmtCr"].ToString();
            }
            else
            {
                ClearFields();
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (!CommonCls.CheckGUIDIsValid())
            {
                return;
            }

            objplOpenStock = new ItemOpenningStockModel();

            if (CommonCls.ConvertIntZero(ddlItemName.SelectedValue) == 0)
            {
                ddlItemName.Focus();
                ShowMessage("Fill Item Detail..", false);
                return;
            }
            if (gridOpenStock.Rows.Count > 0)
            {
                objplOpenStock.Ind    = 31;
                objplOpenStock.OrgID  = GlobalSession.OrgID;
                objplOpenStock.YrCD   = GlobalSession.YrCD;
                objplOpenStock.User   = GlobalSession.UserID;
                objplOpenStock.IP     = GlobalSession.IP;
                objplOpenStock.ItemID = Convert.ToInt32(ddlItemName.SelectedValue);

                objplOpenStock.DtItem = VsDtOpenStock;

                if (objplOpenStock.DtItem.Columns.Contains("ItemID"))
                {
                    objplOpenStock.DtItem.Columns.Remove("ItemID");
                }
                //if (objplOpenStock.DtItem.Columns.Contains("WareHouseName"))
                //{
                //    objplOpenStock.DtItem.Columns.Remove("WareHouseName");
                //}
                if (objplOpenStock.DtItem.Columns.Contains("Address"))
                {
                    objplOpenStock.DtItem.Columns.Remove("Address");
                }


                string    uri = string.Format("ItemOpenStock/SaveStockEntry");
                DataTable dtSaveopenStockEntry = CommonCls.ApiPostDataTable(uri, objplOpenStock);
                if (dtSaveopenStockEntry.Rows.Count > 0)
                {
                    ShowMessage("Data Is SucessFully Saved..", true);
                    ClearAfterSaved();
                    VsDtOpenStock = null;
                    // fillGrid();
                }
                else
                {
                    ShowMessage("Data Is Not Saved..", false);
                }
            }
            else
            {
                ShowMessage("Fill All Item Detail..", false);
            }
            fillGrid();
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
예제 #28
0
    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);
        }
    }
예제 #29
0
    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);
        }
    }
예제 #30
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (!CommonCls.CheckGUIDIsValid())
            {
                return;
            }


            bool IsValid = ValidationBtnSave();
            if (!IsValid)
            {
                return;
            }

            objItemMaster                  = new ItemMasterModel();
            objItemMaster.Ind              = 3;
            objItemMaster.OrgID            = GlobalSession.OrgID;
            objItemMaster.YrCD             = GlobalSession.YrCD;
            objItemMaster.ItemMainID       = Convert.ToInt32(hfMainGrCode.Value);
            objItemMaster.ItemSubID        = Convert.ToInt32(hfSubGrCode.Value);
            objItemMaster.ItemMinorID      = Convert.ToInt32(ddlMinorGroup.SelectedValue);
            objItemMaster.ItemGroupID      = Convert.ToInt32(hfItemGroupID.Value);
            objItemMaster.ItemName         = txtItemName.Text;
            objItemMaster.ItemShortName    = txtShortName.Text;
            objItemMaster.ItemUnitID       = Convert.ToInt32(ddlItemUnit.SelectedValue);
            objItemMaster.GoodServiceInd   = Convert.ToInt32(ddlItemType.SelectedValue);
            objItemMaster.ItemSellingRate  = CommonCls.ConvertDecimalZero(txtSellingRate.Text);
            objItemMaster.ItemDesc         = txtItemDescription.Text == null ? "" : txtItemDescription.Text;
            objItemMaster.HSNSACCode       = txtHSNSACCode.Text; //ddlHSNSACCode.SelectedValue;
            objItemMaster.ItemCode         = Convert.ToInt64(hfMainGrCode.Value + hfSubGrCode.Value + ddlMinorGroup.SelectedValue);
            objItemMaster.User             = GlobalSession.UserID;
            objItemMaster.IP               = GlobalSession.IP;
            objItemMaster.DtItemOpening    = (DataTable)ViewState["dtItemOSE"];
            objItemMaster.ItemMinorUnitID  = CommonCls.ConvertIntZero(ddlMinorUnit.SelectedValue);
            objItemMaster.ItemMinorUnitQyt = CommonCls.ConvertDecimalZero(txtMinorUnitQty.Text);
            objItemMaster.TaxRate          = CommonCls.ConvertDecimalZero(ddlTaxrate.SelectedValue) < CommonCls.ConvertDecimalZero("0.05") ? 0 : CommonCls.ConvertDecimalZero(ddlTaxrate.SelectedValue);
            objItemMaster.TaxRateDesc      = ddlTaxrate.SelectedItem.Text;
            objItemMaster.StockMaintainInd = 0;


            if (objItemMaster.DtItemOpening != null)
            {
                if (objItemMaster.DtItemOpening.Columns.Contains("ItemID"))
                {
                    objItemMaster.DtItemOpening.Columns.Remove("ItemID");
                }
                if (objItemMaster.DtItemOpening.Columns.Contains("WareHouseName"))
                {
                    objItemMaster.DtItemOpening.Columns.Remove("WareHouseName");
                }
                //if (objItemMaster.DtItemOpening.Columns.Contains("Warehouse"))
                //{
                //    objItemMaster.DtItemOpening.Columns.Remove("Warehouse");
                //}
            }
            else
            {
                objItemMaster.DtItemOpening = DtItemOSESchema();
                DataRow drItemOpening = objItemMaster.DtItemOpening.NewRow();

                if (objItemMaster.DtItemOpening.Columns.Contains("ItemID"))
                {
                    objItemMaster.DtItemOpening.Columns.Remove("ItemID");
                }
                if (objItemMaster.DtItemOpening.Columns.Contains("WareHouseName"))
                {
                    objItemMaster.DtItemOpening.Columns.Remove("WareHouseName");
                }

                drItemOpening["OpeningUnit"]      = "";
                drItemOpening["OpeningMinorUnit"] = "";
                drItemOpening["OpeningMinorQty"]  = "";

                drItemOpening["OrgId"]       = 0;
                drItemOpening["WarehouseId"] = 0;
                drItemOpening["OpeningQty"]  = 0;
                drItemOpening["OpRate"]      = 0;
                drItemOpening["OpDate"]      = "";
                objItemMaster.DtItemOpening.Rows.Add(drItemOpening);
                //objItemMaster.DtItemOpening.Columns.Remove("Warehouse");
            }

            string    uri    = string.Format("ItemMaster/SaveItem");
            DataTable dtSave = CommonCls.ApiPostDataTable(uri, objItemMaster);
            if (dtSave.Rows.Count > 0)
            {
                if (dtSave.Rows[0]["Column1"].ToString() == "1")
                {
                    ClearAll();
                    ShowMessage("Item Save successfully.", true);
                    ddlMinorGroup.Focus();
                }
                else if (dtSave.Rows[0]["Column1"].ToString() == "2")
                {
                    ShowMessage("Item Already Added.", false);
                    txtItemName.Focus();
                }
                else if (dtSave.Rows[0]["Column1"].ToString() == "3")
                {
                    ShowMessage("Invalid HSN / SAC Code.", false);
                    txtHSNSACCode.Focus();
                }
            }
            else
            {
                ShowMessage("Record Not Save Please Try Again.", false);
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }