Ejemplo n.º 1
0
        public ActionResult Index()
        {
            ViewData["ddl_location"] = new SelectList(new DALLocation().PopulateData(), "Loc_Id", "Loc_Title", "");
            ViewData["ddl_Bank"] = new SelectList(new DALBank().PopulateData(), "Bank_Id", "Bank_Title", "");

            var ChartOfAccounts = new DALChartOfAccount().GetChartOfAccountForDropDown(1, "''");
            SETUP_ChartOfAccount SelectChartOfAccount = new SETUP_ChartOfAccount();
            SelectChartOfAccount.ChrtAcc_Id = "0";
            SelectChartOfAccount.ChrtAcc_Title = "";
            ChartOfAccounts.Insert(0, SelectChartOfAccount);
            ViewData["ddl_AccountCode"] = new SelectList(ChartOfAccounts, "ChrtAcc_Id", "ChrtAcc_Title", "");

            return View("BankAccount");
        }
Ejemplo n.º 2
0
        public ActionResult VoucherEntry(String VoucherId)
        {
            DALVoucherEntry objDalVoucherEntry = new DALVoucherEntry();

            var VoucherTypes = new DALVoucherType().GetAllData();
            var Locations = new DALLocation().PopulateData();
            var Voucher = new DALVoucherEntry().GetAllMasterRecords();

            ViewData["ddl_VoucherType"] = new SelectList(VoucherTypes, "VchrType_Id", "VchrType_Title", Session["VoucherTypeForVoucherEntry"]);
            var ChartOfAccounts = new DALChartOfAccount().GetChartOfAccountForDropDown(1, "''");
            string ChartOfAccountCodes = "";
            foreach (SETUP_ChartOfAccount COA in ChartOfAccounts)
            {
                if (ChartOfAccountCodes.Length > 0)
                {
                    ChartOfAccountCodes += "|" + COA.ChrtAcc_Id + ":" + COA.ChrtAcc_Title;
                }
                else
                {
                    ChartOfAccountCodes += COA.ChrtAcc_Id + ":" + COA.ChrtAcc_Title;
                }
            }
            ViewData["ChartOfAccountCodesWithTitles"] = ChartOfAccountCodes;
            SETUP_ChartOfAccount SelectChartOfAccount = new SETUP_ChartOfAccount();
            SelectChartOfAccount.ChrtAcc_Id = "0";
            SelectChartOfAccount.ChrtAcc_Code = "";
            ChartOfAccounts.Insert(0, SelectChartOfAccount);
            ViewData["ChartOfAccounts"] = ChartOfAccounts;
            ViewData["ddl_Account"] = new SelectList(ChartOfAccounts, "ChrtAcc_Id", "ChrtAcc_Title", "");
            var NarrationList = new DALVoucherTypeNarration().GetAllData().ToList();
            string[] nList = new string[NarrationList.Count];
            if (NarrationList != null && NarrationList.Count > 0)
            {
                for (int index = 0; index < NarrationList.Count; index++)
                {
                    nList[index] = NarrationList[index].VchrTypeNarr_Title;
                }
                System.Web.Script.Serialization.JavaScriptSerializer se = new System.Web.Script.Serialization.JavaScriptSerializer();
                ViewData["Narrations"] = se.Serialize(nList);
            }
            ViewData["ddl_Location"] = new SelectList(Locations, "Loc_Id", "Loc_Title", Session["LocationIdForVoucherEntry"]);
            if (!String.IsNullOrEmpty(VoucherId))
            {
                SetVoucherEntryToEdit(VoucherId);
            }
            else
            {
                ViewData["VoucherCode"] = "[Auto]";
                ViewData["CurrentDate"] = DateTime.Now.ToString("MM/dd/yyyy");
            }
            Session.Remove("VoucherTypeForVoucherEntry");
            Session.Remove("LocationIdForVoucherEntry");
            return View();
        }