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

        string uri = string.Format("ItemOpenStock/FillUnit");

        DataSet dsItemUnit = CommonCls.ApiPostDataSet(uri, objplOpenStock);

        if (dsItemUnit.Tables.Count > 0)
        {
            DataTable dtPrimaryUnit  = dsItemUnit.Tables[0];
            DataTable dtSecondryUnit = dsItemUnit.Tables[0];

            ddlPriUnit.DataSource     = dtPrimaryUnit;
            ddlPriUnit.DataTextField  = "UnitName";
            ddlPriUnit.DataValueField = "UnitID";
            ddlPriUnit.DataBind();
            ddlPriUnit.Items.Insert(0, new ListItem("-- Select --", "0"));

            ddlsecunit.DataSource     = dtSecondryUnit;
            ddlsecunit.DataTextField  = "UnitName";
            ddlsecunit.DataValueField = "UnitID";
            ddlsecunit.DataBind();
            ddlsecunit.Items.Insert(0, new ListItem("-- Select --", "0"));
        }
    }
    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);
        }
    }
Beispiel #3
0
    void BindAllBankReceiptDDL()
    {
        try
        {
            plbankrec         = new BankReceiptModel();
            plbankrec.Ind     = 11;
            plbankrec.OrgID   = GlobalSession.OrgID;
            plbankrec.BrID    = GlobalSession.BrID;
            plbankrec.YrCD    = GlobalSession.YrCD;
            plbankrec.VchType = Convert.ToInt32(ViewState["VchType"]);

            string  uri            = string.Format("BankReceipt/BindAllBankReceiptDDL");
            DataSet dsBindAllCRDDL = CommonCls.ApiPostDataSet(uri, plbankrec);
            if (dsBindAllCRDDL.Tables.Count > 0)
            {
                DataTable dtAccountHead = dsBindAllCRDDL.Tables[0];
                DataTable dtLastVoucher = dsBindAllCRDDL.Tables[1];
                DataTable dtNarration   = dsBindAllCRDDL.Tables[2];
                DataTable dtCashAccount = dsBindAllCRDDL.Tables[3];



                // Cash List Bind
                if (dtCashAccount.Rows.Count > 0)
                {
                    ddlbank.DataSource     = dtCashAccount;
                    ddlbank.DataTextField  = "AccName";
                    ddlbank.DataValueField = "AccCode";
                    ddlbank.DataBind();
                    if (dtCashAccount.Rows.Count > 1)
                    {
                        ddlbank.Items.Insert(0, new ListItem("-- Select --", "0"));
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
Beispiel #4
0
    private void BindAll()
    {
        try
        {
            objSubBudgetSection       = new BudgetSubSectionModel();
            objSubBudgetSection.Ind   = 11;
            objSubBudgetSection.OrgID = GlobalSession.OrgID;
            objSubBudgetSection.BrID  = GlobalSession.BrID;
            string  uri          = string.Format("BudgetSubSection/BindAll");
            DataSet dsSubSection = CommonCls.ApiPostDataSet(uri, objSubBudgetSection);
            if (dsSubSection.Tables.Count > 0)
            {
                if (dsSubSection.Tables[1].Rows.Count > 0)
                {
                    grdSubSection.DataSource = dsSubSection.Tables[1];
                    grdSubSection.DataBind();
                    //pnlSectionGrid.Visible = true;
                    VSSubSection = dsSubSection.Tables[1];

                    lstSubSeaction.DataSource     = dsSubSection.Tables[1];
                    lstSubSeaction.DataTextField  = "SectionName";
                    lstSubSeaction.DataValueField = "SectionName";
                    lstSubSeaction.DataBind();
                }
                if (dsSubSection.Tables[0].Rows.Count > 0)
                {
                    ddlSection.DataSource     = dsSubSection.Tables[0];
                    ddlSection.DataTextField  = "SectionName";
                    ddlSection.DataValueField = "SectionID";
                    ddlSection.DataBind();
                    ddlSection.Items.Insert(0, new ListItem("-- Select --", "0"));
                    VSSection = dsSubSection.Tables[0];
                }
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
    private void Loadchklist()
    {
        try
        {
            objSundriModel       = new SundriesModel();
            objSundriModel.OrgID = GlobalSession.OrgID;
            objSundriModel.YrCD  = GlobalSession.YrCD;

            string  uri       = string.Format(" Sundri/ChkList");
            DataSet dsChklist = CommonCls.ApiPostDataSet(uri, objSundriModel);
            if (dsChklist.Tables.Count > 0)
            {
                DataTable dtChkAviable   = dsChklist.Tables["AvailableList"];
                DataTable dtChkAllocated = dsChklist.Tables["AllocatedList"];

                ViewState["dtCheckListAvailable"] = dtChkAviable;
                chkAvailable.DataSource           = dtChkAviable;
                chkAvailable.DataTextField        = "AccName";
                chkAvailable.DataValueField       = "AccCode";
                chkAvailable.DataBind();

                ChkSelected.DataSource     = dtChkAllocated;
                ChkSelected.DataTextField  = "SundriHeadName";
                ChkSelected.DataValueField = "AccCode";
                ChkSelected.DataBind();
                if (dtChkAllocated.Columns.Count > 0)
                {
                    ViewState["CheckListViewSelect"] = dtChkAllocated;
                }
                else
                {
                }
                //chkAvailable.Items.Insert(0, new ListItem("-- Select --", "0"));
            }
        }
        catch (Exception ex)
        {
        }
    }
    private void BindAll()
    {
        try
        {
            objNewBudgetAmountModel        = new NewBudgetAmountModel();
            objNewBudgetAmountModel.Ind    = 1;
            objNewBudgetAmountModel.OrgID  = GlobalSession.OrgID;
            objNewBudgetAmountModel.BrID   = GlobalSession.BrID;
            objNewBudgetAmountModel.DeptID = GlobalSession.DepartmentID;

            string  uri          = string.Format("NewBudgetAmount/BindAll");
            DataSet dsSubSection = CommonCls.ApiPostDataSet(uri, objNewBudgetAmountModel);

            if (dsSubSection.Tables.Count > 0)
            {
                VSMainSection      = dsSubSection.Tables[2];
                VSSSearchubSection = dsSubSection.Tables[3];
                DataTable dtGRD = dsSubSection.Tables[2];
                if (dtGRD.Rows.Count > 0)
                {
                    DataView dvSection = new DataView(dsSubSection.Tables[2]);
                    dvSection.RowFilter       = "DeptParentID > 0";
                    VSSection                 = dvSection.ToTable();
                    lstSection.DataSource     = dvSection.ToTable();
                    lstSection.DataTextField  = "DeptName";
                    lstSection.DataValueField = "DeptName";
                    lstSection.DataBind();



                    ddlNewSubSection.DataSource     = dvSection.ToTable();
                    ddlNewSubSection.DataTextField  = "DeptName";
                    ddlNewSubSection.DataValueField = "DeptID";
                    ddlNewSubSection.DataBind();
                    if (dvSection.ToTable().Rows.Count > 1)
                    {
                        ddlNewSubSection.Items.Insert(0, new ListItem("-- Select --", "0"));
                    }
                }

                //DataTable dtSubSection = dsSubSection.Tables[0];

                //if (dtSubSection.Rows.Count > 0)
                //{
                //    DataView dv31 = new DataView(dtSubSection);
                //    dv31.RowFilter = "ParentSectionID > 0";
                //    VSSubSection = dv31.ToTable();
                //    lstSubSection.DataSource = VSSubSection;
                //    lstSubSection.DataTextField = "SectionName";
                //    lstSubSection.DataValueField = "SectionName";
                //    lstSubSection.DataBind();
                //}

                if (dsSubSection.Tables[1].Rows.Count > 0)
                {
                    VSBudgetHead                 = dsSubSection.Tables[1];
                    lstBudgetHead.DataSource     = dsSubSection.Tables[1];
                    lstBudgetHead.DataTextField  = "AccName";
                    lstBudgetHead.DataValueField = "AccName";
                    lstBudgetHead.DataBind();
                }

                if (GlobalSession.IsAdmin == 1 && GlobalSession.DepartmentID > 0 && GlobalSession.SubDeptID == 0)
                {
                    DataView dvSection = new DataView(VSMainSection);
                    dvSection.RowFilter       = "DeptParentID =" + GlobalSession.DepartmentID;
                    VSSection                 = dvSection.ToTable();
                    lstSection.DataSource     = dvSection.ToTable();
                    lstSection.DataTextField  = "DeptName";
                    lstSection.DataValueField = "DeptName";
                    lstSection.DataBind();

                    ddlNewSubSection.DataSource     = dvSection.ToTable();
                    ddlNewSubSection.DataTextField  = "DeptName";
                    ddlNewSubSection.DataValueField = "DeptName";
                    ddlNewSubSection.DataBind();



                    if (dvSection.ToTable().Rows.Count == 1)
                    {
                        lstSection.SelectedValue = dvSection.ToTable().Rows[0]["DeptID"].ToString();
                        txtSectionName.Text      = dvSection.ToTable().Rows[0]["DeptName"].ToString();
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
Beispiel #7
0
    void LoadProfileCreationDDL()
    {
        try
        {
            objPCModel     = new ProfileCreationModel();
            objPCModel.Ind = 11;

            string  uri = string.Format("ProfileCreation/BindAllProfileCreationDDL");
            DataSet dsProfileCreation = CommonCls.ApiPostDataSet(uri, objPCModel);
            if (dsProfileCreation.Tables.Count > 0)
            {
                ddlOrgType.DataSource     = dsProfileCreation.Tables["OrganizationType"];
                ddlOrgType.DataTextField  = "OrgTypeDesc";
                ddlOrgType.DataValueField = "OrgTypeID";
                ddlOrgType.DataBind();
                ddlOrgType.Items.Insert(0, new ListItem("-- Org Type --", "0"));

                ddlBussiNature.DataSource     = dsProfileCreation.Tables["BusinessNature"];
                ddlBussiNature.DataTextField  = "BusinessDesc";
                ddlBussiNature.DataValueField = "BusinessID";
                ddlBussiNature.DataBind();
                ddlBussiNature.Items.Insert(0, new ListItem("-- Business Nature --", "0"));

                ddlBussiType.DataSource     = dsProfileCreation.Tables["BusinessType"];
                ddlBussiType.DataTextField  = "BusinessTypeDesc";
                ddlBussiType.DataValueField = "BusinessTypeID";
                ddlBussiType.DataBind();
                ddlBussiType.Items.Insert(0, new ListItem("-- Business Type --", "0"));

                cbCopyType.DataSource     = dsProfileCreation.Tables["CopyType"];
                cbCopyType.DataTextField  = "CopyType";
                cbCopyType.DataValueField = "CopyID";
                cbCopyType.DataBind();

                DataTable dtCompanyState = dsProfileCreation.Tables["State"];
                DataTable dtGSTInfoState = dsProfileCreation.Tables["State"];

                ddlStateCompany.DataSource     = dtCompanyState;
                ddlStateCompany.DataTextField  = "StateName";
                ddlStateCompany.DataValueField = "StateID";
                ddlStateCompany.DataBind();
                ddlStateCompany.Items.Insert(0, new ListItem("-- State --", "0"));

                ddlStateGSTIN.DataSource     = dtGSTInfoState;
                ddlStateGSTIN.DataTextField  = "StateName";
                ddlStateGSTIN.DataValueField = "StateID";
                ddlStateGSTIN.DataBind();
                ddlStateGSTIN.Items.Insert(0, new ListItem("-- State --", "0"));

                grdReportFormats.DataSource = dsProfileCreation.Tables["ReportFormats"];
                grdReportFormats.DataBind();

                ddlCompositionCategory.DataSource     = VSDTCompositionCategory = dsProfileCreation.Tables["CompositionCategory"];
                ddlCompositionCategory.DataTextField  = "CompositionCategoryDesc";
                ddlCompositionCategory.DataValueField = "CompositionCategoryID";
                ddlCompositionCategory.DataBind();
                ddlCompositionCategory.Items.Insert(0, new ListItem("-- Select --", "0"));
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }
    void LoadItemMasterDDL()
    {
        try
        {
            objItemMaster       = new ItemMasterModel();
            objItemMaster.OrgID = GlobalSession.OrgID;
            objItemMaster.BrID  = GlobalSession.BrID;
            objItemMaster.YrCD  = GlobalSession.YrCD;
            string  uri          = string.Format("ItemMaster/ItemMasterDDL");
            DataSet dsItemMaster = CommonCls.ApiPostDataSet(uri, objItemMaster);
            if (dsItemMaster.Tables.Count > 0)
            {
                ddlMinorGroup.DataSource     = ViewState["ItemGroup"] = dsItemMaster.Tables["ItemGroup"];
                ddlMinorGroup.DataTextField  = "MinorGrName";
                ddlMinorGroup.DataValueField = "MinorGrCode";
                ddlMinorGroup.DataBind();
                ddlMinorGroup.Items.Insert(0, new ListItem("-- Select --", "0"));

                ddlItemUnit.DataSource     = ddlPriUnit.DataSource = dsItemMaster.Tables["ItemUnit"];
                ddlItemUnit.DataTextField  = ddlPriUnit.DataTextField = "UnitName";
                ddlItemUnit.DataValueField = ddlPriUnit.DataValueField = "UnitID";
                ddlItemUnit.DataBind(); ddlPriUnit.DataBind();
                ddlItemUnit.Items.Insert(0, new ListItem("-- Select --", "0"));
                ddlPriUnit.Items.Insert(0, new ListItem("-- Select --", "0"));

                ddlWarehouse.DataSource     = dsItemMaster.Tables["Warehouse"];
                ddlWarehouse.DataTextField  = "WareHouseAddress";
                ddlWarehouse.DataValueField = "WareHouseID";
                ddlWarehouse.DataBind();
                ddlWarehouse.Items.Insert(0, new ListItem("-- Select --", "0"));

                ddlMinorUnit.DataSource     = ddlSecUnit.DataSource = ViewState["dtMinorUnit"] = dsItemMaster.Tables["ItemUnit"];
                ddlMinorUnit.DataTextField  = ddlSecUnit.DataTextField = "UnitName";
                ddlMinorUnit.DataValueField = ddlSecUnit.DataValueField = "UnitID";
                ddlMinorUnit.DataBind(); ddlSecUnit.DataBind();

                ddlMinorUnit.Items.Insert(0, new ListItem("-- Select --", "0"));
                ddlSecUnit.Items.Insert(0, new ListItem("-- Select --", "0"));

                ddlTaxrate.DataSource     = dsItemMaster.Tables["TaxRate"];
                ddlTaxrate.DataTextField  = "TaxRateDesc";
                ddlTaxrate.DataValueField = "TaxRate";
                ddlTaxrate.DataBind();
                ddlTaxrate.Items.Insert(0, new ListItem("-- Select --", "-1"));

                double TaxValue = 0;
                foreach (ListItem item in ddlTaxrate.Items)
                {
                    if (item.Value == "0")
                    {
                        item.Value = TaxValue.ToString();
                        TaxValue   = (TaxValue + 0.01);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            ShowMessage(ex.Message, false);
        }
    }