public List <Bank> GetAllBankes() { List <Bank> bankList = null; try { bankList = _bankBusiness.GetAllBanks(); } catch (Exception ex) { throw ex; } return(bankList); }
public ActionResult Index() { DepositAndWithdrwalViewModel depositAndWithdrwalViewModelObj = null; try { depositAndWithdrwalViewModelObj = new DepositAndWithdrwalViewModel(); depositAndWithdrwalViewModelObj.bankList = new List <SelectListItem>(); List <SelectListItem> selectListItem = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <BankViewModel> PayTermList = Mapper.Map <List <Bank>, List <BankViewModel> >(_bankBusiness.GetAllBanks()); foreach (BankViewModel bvm in PayTermList) { selectListItem.Add(new SelectListItem { Text = bvm.Name, Value = bvm.Code, Selected = false }); } depositAndWithdrwalViewModelObj.bankList = selectListItem; depositAndWithdrwalViewModelObj.paymentModeList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <PaymentModesViewModel> PaymentList = Mapper.Map <List <PaymentModes>, List <PaymentModesViewModel> >(_paymentModesBusiness.GetAllPaymentModes()); foreach (PaymentModesViewModel PMVM in PaymentList) { selectListItem.Add(new SelectListItem { Text = PMVM.Description, Value = PMVM.Code, Selected = false }); } depositAndWithdrwalViewModelObj.paymentModeList = selectListItem; selectListItem = null; selectListItem = new List <SelectListItem>(); List <CustomerViewModel> customerList = Mapper.Map <List <Customer>, List <CustomerViewModel> >(_customerBusiness.GetAllCustomers()); if (customerList != null) { foreach (CustomerViewModel Cust in customerList) { selectListItem.Add(new SelectListItem { Text = Cust.CompanyName, Value = Cust.ID.ToString(), Selected = false }); } } depositAndWithdrwalViewModelObj.customerList = selectListItem; } catch (Exception ex) { throw ex; } return(View(depositAndWithdrwalViewModelObj)); }
public string GetAllBanks() { try { List <BankViewModel> BankList = Mapper.Map <List <Bank>, List <BankViewModel> >(_bankBusiness.GetAllBanks()); Permission _permission = Session["UserRights"] as Permission; string p = _permission.SubPermissionList.Where(li => li.Name == "ODLimit").First().AccessCode; foreach (var Item in BankList) { if (p.Contains("R") || p.Contains("W")) { Item.ShowODLimit = true; } else { Item.ShowODLimit = false; } } return(JsonConvert.SerializeObject(new { Result = "OK", Records = BankList })); } catch (Exception ex) { AppConstMessage cm = c.GetMessage(ex.Message); return(JsonConvert.SerializeObject(new { Result = "ERROR", Message = cm.Message })); } }
public ActionResult Index(string id) { ViewBag.value = id; AppUA appUA = Session["AppUA"] as AppUA; ViewBag.Currentdate = appUA.DateTime.ToString("dd-MMM-yyyy"); List <SelectListItem> selectListItem = new List <SelectListItem>(); SupplierPaymentsViewModel SP = new SupplierPaymentsViewModel(); //-------------1.Supplier List-------------------// SP.supplierObj = new SuppliersViewModel(); SP.supplierObj.SupplierList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <SuppliersViewModel> supplierList = Mapper.Map <List <Supplier>, List <SuppliersViewModel> >(_supplierBusiness.GetAllSuppliers()); foreach (SuppliersViewModel supplier in supplierList) { selectListItem.Add(new SelectListItem { Text = supplier.CompanyName, Value = supplier.ID.ToString(), Selected = false }); } SP.supplierObj.SupplierList = selectListItem; //-------------2.PaymentModes-------------------// SP.PaymentModesObj = new PaymentModesViewModel(); SP.PaymentModesObj.PaymentModesList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <PaymentModesViewModel> PaymentModeList = Mapper.Map <List <PaymentModes>, List <PaymentModesViewModel> >(_paymentmodesBusiness.GetAllPaymentModes()); foreach (PaymentModesViewModel PMVM in PaymentModeList) { selectListItem.Add(new SelectListItem { Text = PMVM.Description, Value = PMVM.Code, Selected = false }); } SP.PaymentModesObj.PaymentModesList = selectListItem; //-------------3.BanksList-------------------// SP.bankObj = new BankViewModel(); SP.bankObj.BanksList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <BankViewModel> BankList = Mapper.Map <List <Bank>, List <BankViewModel> >(_bankBusiness.GetAllBanks()); foreach (BankViewModel BL in BankList) { selectListItem.Add(new SelectListItem { Text = BL.Name, Value = BL.Code, Selected = false }); } SP.bankObj.BanksList = selectListItem; //-------------4.CompanyList-------------------// SP.CompanyObj = new CompaniesViewModel(); SP.CompanyObj.CompanyList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <CompaniesViewModel> CompaniesList = Mapper.Map <List <Companies>, List <CompaniesViewModel> >(_companiesBusiness.GetAllCompanies()); foreach (CompaniesViewModel BL in CompaniesList) { selectListItem.Add(new SelectListItem { Text = BL.Name, Value = BL.Code, Selected = false }); } SP.CompanyObj.CompanyList = selectListItem; //-------------4.Approval Status-------------------// SP.ApprovalStatusObj = new ApprovalStatusViewModel(); SP.ApprovalStatusObj.ApprovalStatusList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <ApprovalStatusViewModel> ApprovalStatus = Mapper.Map <List <ApprovalStatus>, List <ApprovalStatusViewModel> >(_approvalStatusBusiness.GetAllApprovalStatus()); foreach (ApprovalStatusViewModel BL in ApprovalStatus) { if (BL.Code != "4") { if (BL.Description != "Paid") { selectListItem.Add(new SelectListItem { Text = BL.Description, Value = BL.Code, Selected = false }); } else { selectListItem.Add(new SelectListItem { Text = BL.Description, Value = BL.Code, Disabled = true }); } } } SP.ApprovalStatusObj.ApprovalStatusList = selectListItem; //-------------5.Approve Status-------------------// SP.ApproveStatusObj = new ApprovalStatusViewModel(); SP.ApproveStatusObj.ApprovalStatusList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); foreach (ApprovalStatusViewModel BL in ApprovalStatus) { if (BL.Code != "4") { selectListItem.Add(new SelectListItem { Text = BL.Description, Value = BL.Code, Selected = false }); } } SP.ApproveStatusObj.ApprovalStatusList = selectListItem; return(View(SP)); }
public ActionResult Index(string id) { AppUA _appUA = Session["AppUA"] as AppUA; ViewBag.Currentdate = _appUA.DateTime.ToString("dd-MMM-yyyy"); ViewBag.value = id; List <SelectListItem> selectListItem = new List <SelectListItem>(); CustomerPaymentsViewModel CP = new CustomerPaymentsViewModel(); //-------------1.CustomerList-------------------// CP.customerObj = new CustomerViewModel(); CP.customerObj.CustomerList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <CustomerViewModel> CustList = Mapper.Map <List <Customer>, List <CustomerViewModel> >(_customerBusiness.GetAllCustomers()); foreach (CustomerViewModel Cust in CustList) { selectListItem.Add(new SelectListItem { Text = Cust.CompanyName, Value = Cust.ID.ToString(), Selected = false }); } CP.customerObj.CustomerList = selectListItem; //-------------2.PaymentModes-------------------// CP.PaymentModesObj = new PaymentModesViewModel(); CP.PaymentModesObj.PaymentModesList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <PaymentModesViewModel> PaymentModeList = Mapper.Map <List <PaymentModes>, List <PaymentModesViewModel> >(_paymentmodesBusiness.GetAllPaymentModes()); foreach (PaymentModesViewModel PMVM in PaymentModeList) { selectListItem.Add(new SelectListItem { Text = PMVM.Description, Value = PMVM.Code, Selected = false }); } CP.PaymentModesObj.PaymentModesList = selectListItem; //-------------3.BanksList-------------------// CP.bankObj = new BankViewModel(); CP.bankObj.BanksList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <BankViewModel> BankList = Mapper.Map <List <Bank>, List <BankViewModel> >(_bankBusiness.GetAllBanks()); foreach (BankViewModel BL in BankList) { selectListItem.Add(new SelectListItem { Text = BL.Name, Value = BL.Code, Selected = false }); } CP.bankObj.BanksList = selectListItem; //-------------4.CompanyList-------------------// CP.CompanyObj = new CompaniesViewModel(); CP.CompanyObj.CompanyList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <CompaniesViewModel> CompaniesList = Mapper.Map <List <Companies>, List <CompaniesViewModel> >(_companiesBusiness.GetAllCompanies()); foreach (CompaniesViewModel BL in CompaniesList) { selectListItem.Add(new SelectListItem { Text = BL.Name, Value = BL.Code, Selected = false }); } CP.CompanyObj.CompanyList = selectListItem; return(View(CP)); }
public ActionResult Index(string id) { OtherIncomeViewModel otherIncomeViewModalObj = null; ViewBag.value = id; try { otherIncomeViewModalObj = new OtherIncomeViewModel(); otherIncomeViewModalObj.accountCodeList = new List <SelectListItem>(); Settings s = new Settings(); otherIncomeViewModalObj.Today = DateTime.Today.ToString(s.dateformat); List <SelectListItem> selectListItem = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <BankViewModel> PayTermList = Mapper.Map <List <Bank>, List <BankViewModel> >(_bankBusiness.GetAllBanks()); foreach (BankViewModel bvm in PayTermList) { selectListItem.Add(new SelectListItem { Text = bvm.Name, Value = bvm.Code, Selected = false }); } otherIncomeViewModalObj.bankList = selectListItem; otherIncomeViewModalObj.companiesList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <CompaniesViewModel> companiesList = Mapper.Map <List <Companies>, List <CompaniesViewModel> >(_companiesBusiness.GetAllCompanies()); foreach (CompaniesViewModel cvm in companiesList) { selectListItem.Add(new SelectListItem { Text = cvm.Name, Value = cvm.Code.ToString(), Selected = false }); } otherIncomeViewModalObj.companiesList = selectListItem; otherIncomeViewModalObj.paymentModeList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <PaymentModesViewModel> PaymentList = Mapper.Map <List <PaymentModes>, List <PaymentModesViewModel> >(_paymentModeBusiness.GetAllPaymentModes()); foreach (PaymentModesViewModel PMVM in PaymentList) { selectListItem.Add(new SelectListItem { Text = PMVM.Description, Value = PMVM.Code, Selected = false }); } otherIncomeViewModalObj.paymentModeList = selectListItem; otherIncomeViewModalObj.accountCodeList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <ChartOfAccountsViewModel> AccountList = Mapper.Map <List <ChartOfAccounts>, List <ChartOfAccountsViewModel> >(_chartOfAccountsBusiness.GetChartOfAccountsByType("OI")); foreach (ChartOfAccountsViewModel COAVM in AccountList) { selectListItem.Add(new SelectListItem { Text = COAVM.TypeDesc, Value = COAVM.Code + ":" + COAVM.ISEmploy, Selected = false }); } otherIncomeViewModalObj.accountCodeList = selectListItem; //selectListItem = new List<SelectListItem>(); //List<EmployeeViewModel> empList = Mapper.Map<List<Employee>, List<EmployeeViewModel>>(_otherExpenseBusiness.GetAllEmployees()); //foreach (EmployeeViewModel evm in empList) //{ // selectListItem.Add(new SelectListItem // { // Text = evm.Name, // Value = evm.ID.ToString(), // Selected = false // }); //} //otherIncomeViewModalObj.EmployeeList = selectListItem; otherIncomeViewModalObj.EmployeeTypeList = new List <SelectListItem>(); selectListItem = new List <SelectListItem>(); List <EmployeeTypeViewModel> empTypeList = Mapper.Map <List <EmployeeType>, List <EmployeeTypeViewModel> >(_otherExpenseBusiness.GetAllEmployeeTypes()); foreach (EmployeeTypeViewModel etvm in empTypeList) { selectListItem.Add(new SelectListItem { Text = etvm.Name, Value = etvm.Code, Selected = false }); } otherIncomeViewModalObj.EmployeeTypeList = selectListItem; } catch (Exception ex) { throw ex; } return(View(otherIncomeViewModalObj)); }