public static List <SelectListModel> GetPayModes() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var venList = myshop.Gbl_Master_PayMode.Where(pay => pay.IsDeleted == false).OrderBy(x => x.PayMode).ToList(); if (venList.Count > 0) { foreach (Gbl_Master_PayMode currentItem in venList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.PayMode; newItem.Value = currentItem.PayModeId; list.Add(newItem); } } return(list); } catch (Exception ex) { return(GlobalMethod.GetSingleSelectList()); } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetUnit() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var unitList = myshop.Gbl_Master_Unit.Where(unit => unit.ShopId.Equals(WebSession.ShopId) && unit.IsDeleted == false).OrderBy(x => x.UnitName).ToList(); if (unitList.Count > 0) { foreach (Gbl_Master_Unit currentItem in unitList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.UnitName; newItem.Value = currentItem.UnitId; list.Add(newItem); } } return(list); } catch (Exception ex) { return(GlobalMethod.GetSingleSelectList()); } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetVendors() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var venList = myshop.Gbl_Master_Vendor.Where(brand => brand.ShopId.Equals(WebSession.ShopId) && brand.IsDeleted == false).OrderBy(x => x.VendorName).ToList(); if (venList.Count > 0) { foreach (Gbl_Master_Vendor currentItem in venList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.VendorName; newItem.Value = currentItem.VendorId; list.Add(newItem); } } return(list); } catch (Exception ex) { return(GlobalMethod.GetSingleSelectList()); } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetDdEmpList() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var empList = myshop.Gbl_Master_Employee.Where(role => role.IsDeleted == false && role.ShopId.Equals(WebSession.ShopId)).OrderBy(x => x.FirstName).ToList(); if (empList.Count > 0) { foreach (Gbl_Master_Employee currentItem in empList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.FirstName + " " + currentItem.LastName; newItem.Value = currentItem.RoleId; list.Add(newItem); } } return(list); } catch (Exception ex) { return(GlobalMethod.GetSingleSelectList()); } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetSubCatogaries(int catId, int ShopId = 0) { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var subCatList = myshop.Gbl_Master_SubCategory.Where(cat => cat.ShopId.Equals(WebSession.ShopId) && cat.CatId.Equals(catId) && cat.IsDeleted == false && (ShopId == 0 || cat.ShopId == ShopId)).OrderBy(x => x.SubCatName).ToList(); if (subCatList.Count > 0) { foreach (Gbl_Master_SubCategory currentItem in subCatList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.SubCatName; newItem.Value = currentItem.SubCatId; list.Add(newItem); } } return(list); } catch (Exception ex) { return(GlobalMethod.GetSingleSelectList()); } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetChequeNoByAccNo(int AccId, bool isAllCheque) { try { if (AccId > 0) { myshop = new MyshopDb(); var result = ( from bc in myshop.Gbl_Master_BankCheque.Where(pay => pay.IsDeleted == false && pay.BankAccId.Equals(AccId) && pay.ShopId == WebSession.ShopId) from cb in myshop.Gbl_Master_BankChequeDetails.Where(y => y.IsDeleted == false && (isAllCheque == true || y.IsUsed == false) && bc.ChequeId.Equals(y.ChequeBookId)) orderby cb.ChequeNo select new SelectListModel { Text = cb.ChequeNo.ToString(), Value = cb.ChequePageId } ).ToList(); var venList = myshop.Gbl_Master_BankCheque.Where(pay => pay.IsDeleted == false && pay.BankAccId.Equals(AccId) && pay.ShopId == WebSession.ShopId).ToList(); if (result.Count > 0) { return(result); } else { return(GlobalMethod.GetSingleSelectList()); } } else { throw new Exception(); } } catch (Exception ex) { return(GlobalMethod.GetSingleSelectList()); } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetProUnit(int SubCatId) { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var unitList = (from pro in myshop.Gbl_Master_Product.Where(pro => pro.ShopId.Equals(WebSession.ShopId) && pro.IsDeleted == false && pro.SubCatId == SubCatId) from unt in myshop.Gbl_Master_Unit.Where(un => un.UnitId.Equals(pro.UnitId)) orderby unt.UnitName select new SelectListModel { Text = unt.UnitName, Value = unt.UnitId } ).ToList(); if (unitList.Count > 0) { return(list); } else { return(GlobalMethod.GetSingleSelectList()); } } catch (Exception ex) { return(GlobalMethod.GetSingleSelectList()); } finally { if (myshop != null) { myshop = null; } } }