public static List <SelectListModel> GetBanks() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var bankList = myshop.Gbl_Master_Bank.Where(bank => bank.IsDeleted == false).OrderBy(x => x.BankName).ToList(); if (bankList.Count > 0) { foreach (Gbl_Master_Bank currentItem in bankList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.BankName; newItem.Value = currentItem.BankId; list.Add(newItem); } } return(list); } catch (Exception ex) { throw; } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetExpenseTypeList() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var userList = myshop.Gbl_Master_ExpenseType.Where(user => user.IsDeleted == false && user.ShopId == WebSession.ShopId).OrderBy(x => x.ExpenseType).ToList(); if (userList.Count > 0) { foreach (Gbl_Master_ExpenseType currentItem in userList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.ExpenseType; newItem.Value = currentItem.Id; list.Add(newItem); } } return(list); } catch (Exception ex) { return(new List <SelectListModel>()); } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetNotificationTypeList() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var NotiTypeList = myshop.Gbl_Master_NotificationType.Where(noti => noti.IsDeleted == false && noti.ShopId == WebSession.ShopId).OrderBy(x => x.NotificationType).ToList(); if (NotiTypeList.Count > 0) { foreach (Gbl_Master_NotificationType currentItem in NotiTypeList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.NotificationType; newItem.Value = currentItem.NotificationTypeId; list.Add(newItem); } } return(list); } catch (Exception ex) { throw ex; } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetCustomerType() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var custTypeList = myshop.Gbl_Master_CustomerType.Where(custType => custType.IsDeleted == false && custType.ShopId == WebSession.ShopId).OrderBy(x => x.CustomerType).ToList(); if (custTypeList.Count > 0) { foreach (Gbl_Master_CustomerType currentItem in custTypeList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.CustomerType; newItem.Value = currentItem.CustomerTypeId; list.Add(newItem); } } return(list); } catch (Exception ex) { throw; } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetUserList() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var userList = myshop.Gbl_Master_User.Where(user => user.IsDeleted == false && user.ShopId == WebSession.ShopId).OrderBy(x => x.Firstname).ToList(); if (userList.Count > 0) { foreach (Gbl_Master_User currentItem in userList) { SelectListModel newItem = new SelectListModel(); newItem.Text = string.Format("{0} {1}", currentItem.Firstname, currentItem.Lastname); newItem.Value = currentItem.UserId; list.Add(newItem); } } return(list); } catch (Exception ex) { return(new List <SelectListModel>()); } 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> GetPayMode() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var PayList = myshop.Gbl_Master_PayMode.Where(pay => pay.IsDeleted == false).OrderBy(x => x.PayMode).ToList(); if (PayList.Count > 0) { foreach (Gbl_Master_PayMode currentItem in PayList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.PayMode; newItem.Value = currentItem.PayModeId; list.Add(newItem); } } return(list); } catch (Exception ex) { throw; } 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> 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> 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> GetCheques() { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var chequeList = myshop.Gbl_Master_BankCheque.Where(bank => bank.IsDeleted == false).OrderBy(x => x.PageStartNo).ToList(); if (chequeList.Count > 0) { foreach (Gbl_Master_BankCheque currentItem in chequeList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.PageStartNo.ToString(); newItem.Value = currentItem.PageEndNo; list.Add(newItem); } } return(list); } catch (Exception ex) { throw; } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetDocProofs(int DocProofTypeId) { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var DocProofList = myshop.Gbl_Master_DocProof.Where(type => type.IsDeleted == false && type.DocProofTypeId.Equals(DocProofTypeId)).OrderBy(x => x.DocProof).ToList(); if (DocProofList.Count > 0) { foreach (Gbl_Master_DocProof currentItem in DocProofList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.DocProof; newItem.Value = currentItem.DocProofId; list.Add(newItem); } } return(list); } catch (Exception ex) { throw; } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetCity(int StateId) { try { myshop = new MyshopDb(); List <SelectListModel> list = new List <SelectListModel>(); var cityList = myshop.Gbl_Master_City.Where(state => !state.IsDeleted && state.StateId.Equals(StateId)).OrderBy(x => x.CityName).ToList(); if (cityList.Count > 0) { foreach (Gbl_Master_City currentItem in cityList) { SelectListModel newItem = new SelectListModel(); newItem.Text = currentItem.CityName; newItem.Value = currentItem.CityId; list.Add(newItem); } } return(list); } catch (Exception ex) { throw ex; } finally { if (myshop != null) { myshop = null; } } }
public static List <SelectListModel> GetSingleSelectList() { List <SelectListModel> list = new List <SelectListModel>(); SelectListModel item = new SelectListModel() { Text = "No Data", Value = 0 }; list.Add(item); return(list); }