private void BindDropDowns()
        {
            List <Models.MBankAccount> BankAccount = new List <Models.MBankAccount>();
            List <Models.MCashAccount> CashAccount = new List <Models.MCashAccount>();

            Classes.CBankOfAccount ca = new Classes.CBankOfAccount();
            Classes.CCashAccount   cc = new Classes.CCashAccount();
            BankAccount = ca.GetAll();
            CashAccount = cc.GetAll();
            BankAccount = BankAccount.Where(o => o.WareHouseId == Session["WareHouse"].ToString()).ToList();
            CashAccount = CashAccount.Where(o => o.WareHouseId == Convert.ToInt32(Session["WareHouse"].ToString())).ToList();
            Dictionary <int, string> Bank = new Dictionary <int, string>();
            Dictionary <int, string> Cash = new Dictionary <int, string>();

            Cash.Add(-1, "Please Select");
            Bank.Add(-1, "Please Select");
            for (int i = 0; i < CashAccount.Count; i++)
            {
                Cash.Add(CashAccount[i].id, CashAccount[i].CashAccountName);
            }
            for (int i = 0; i < BankAccount.Count; i++)
            {
                Bank.Add(Convert.ToInt32(BankAccount[i].id), BankAccount[i].Accounttitle + "-" + BankAccount[i].accountNumber);
            }
            ddlCashAccount.DataTextField  = "Value";
            ddlCashAccount.DataValueField = "Key";
            ddlSaleAccount.DataTextField  = "Value";
            ddlSaleAccount.DataValueField = "Key";
            ddlCashAccount.DataSource     = Cash;
            ddlSaleAccount.DataSource     = Bank;
            ddlCashAccount.DataBind();
            ddlSaleAccount.DataBind();
        }
示例#2
0
        private void BindData()
        {
            Classes.CCashAccount       ca          = new Classes.CCashAccount();
            List <Models.MCashAccount> CashAccount = new List <Models.MCashAccount>();

            CashAccount = ca.GetAll();
            CashAccount = CashAccount.Where(o =>
                                            o.WareHouseId == Convert.ToInt32(Session["WareHouse"].ToString()) &&
                                            o.ClientId == -1 && o.VendorId == -1).ToList();
            grdAccountTransaction.DataSource = CashAccount;
            grdAccountTransaction.DataBind();
        }
示例#3
0
        private void BindCashAccountDdl()
        {
            Classes.CCashAccount       cv         = new Classes.CCashAccount();
            Dictionary <int, string>   VendorData = new Dictionary <int, string>();
            List <Models.MCashAccount> Get        = new List <Models.MCashAccount>();

            Get = cv.GetAll();
            Get = Get.Where(o => o.WareHouseId == Convert.ToInt32(Session["WareHouse"].ToString())).ToList();
            VendorData.Add(-1, "Please Select");
            for (int i = 0; i < Get.Count; i++)
            {
                VendorData.Add(Convert.ToInt32(Get[i].id), Get[i].CashAccountName);
            }
            ddlCashAccount.DataValueField = "Key";
            ddlCashAccount.DataTextField  = "Value";
            ddlCashAccount.DataSource     = VendorData;
            ddlCashAccount.DataBind();
        }
        private void BindDropDowns()
        {
            Classes.CCashAccount       cv         = new Classes.CCashAccount();
            Dictionary <int, string>   VendorData = new Dictionary <int, string>();
            List <Models.MCashAccount> Get        = new List <Models.MCashAccount>();

            Get = cv.GetAll();
            Get = Get.Where(o => o.ClientId == -1 &&
                            o.AccountType == Common.Constants.CashAccountTypes.Vendor.ToString()).ToList();
            VendorData.Add(-1, "Please Select");
            for (int i = 0; i < Get.Count; i++)
            {
                VendorData.Add(Convert.ToInt32(Get[i].id), Get[i].CashAccountName);
            }
            ddlAccountType.DataValueField = "Key";
            ddlAccountType.DataTextField  = "Value";
            ddlAccountType.DataSource     = VendorData;
            ddlAccountType.DataBind();
        }
        private void BindDdl()
        {
            Dictionary <int, string> BankAccounts = new Dictionary <int, string>();

            Classes.CBankOfAccount     cca = new Classes.CBankOfAccount();
            List <Models.MBankAccount> ListOfBankAccounts = new List <Models.MBankAccount>();

            ListOfBankAccounts = cca.GetAll();
            ListOfBankAccounts = ListOfBankAccounts.Where(o => o.WareHouseId == Session["WareHouse"].ToString()).ToList();
            BankAccounts.Add(-1, "Please Select");
            for (int i = 0; i < ListOfBankAccounts.Count; i++)
            {
                BankAccounts.Add(Convert.ToInt32(ListOfBankAccounts[i].id),
                                 ListOfBankAccounts[i].AccountHolderId + "-" + ListOfBankAccounts[i].Accounttitle);
            }
            ddlBankAccount.DataSource     = BankAccounts;
            ddlBankAccount.DataTextField  = "Value";
            ddlBankAccount.DataValueField = "Key";
            ddlBankAccount.DataBind();
            Classes.CCashAccount       ca           = new Classes.CCashAccount();
            List <Models.MCashAccount> CashAccounts = new List <Models.MCashAccount>();

            CashAccounts = ca.GetAll();
            CashAccounts = CashAccounts.Where(o => o.WareHouseId == Convert.ToInt32(Session["WareHouse"].ToString()) &&
                                              o.VendorId == -1 && o.ClientId == -1).ToList();
            Dictionary <int, string> CashAccountsDc = new Dictionary <int, string>();

            CashAccountsDc.Add(-1, "Please Select");
            for (int i = 0; i < CashAccounts.Count; i++)
            {
                CashAccountsDc.Add(CashAccounts[i].id, CashAccounts[i].CashAccountName);
            }

            ddlCashAccount.DataSource     = CashAccountsDc;
            ddlCashAccount.DataTextField  = "Value";
            ddlCashAccount.DataValueField = "Key";
            ddlCashAccount.DataBind();
        }
        private void BindDdl()
        {
            Classes.CCashAccount       ca           = new Classes.CCashAccount();
            List <Models.MCashAccount> CashAccounts = new List <Models.MCashAccount>();

            CashAccounts = ca.GetAll();
            CashAccounts = CashAccounts.Where(o => o.WareHouseId == Convert.ToInt32(Session["WareHouse"].ToString()) &&
                                              o.VendorId == -1 && o.ClientId == -1).ToList();
            Dictionary <int, string> Accounts = new Dictionary <int, string>();

            Accounts.Add(-1, "Please Select");
            for (int i = 0; i < CashAccounts.Count; i++)
            {
                Accounts.Add(CashAccounts[i].id, CashAccounts[i].CashAccountName);
            }
            ddlPurchaseAccount.DataValueField = "Key";
            ddlPurchaseAccount.DataTextField  = "Value";
            ddlSalesAccount.DataValueField    = "Key";
            ddlSalesAccount.DataTextField     = "Value";
            ddlSalesAccount.DataSource        = Accounts;
            ddlPurchaseAccount.DataSource     = Accounts;
            ddlSalesAccount.DataBind();
            ddlPurchaseAccount.DataBind();
        }