public static Boolean varifyLocationEmpMapping(string loc, string EmpID) { Boolean status = false; StoreEmpMappingDB smpdb = new StoreEmpMappingDB(); List <storeempmapping> LocList = smpdb.getStockEmpMapping(); foreach (storeempmapping smp in LocList) { if (smp.StoreLocationID == loc) { if (smp.EmployeeID == EmpID) { return(true); } } } return(status); }
public static void fillLocationCombo(ComboBox cmb) { StoreEmpMappingDB smpdb = new StoreEmpMappingDB(); List <storeempmapping> LocList = smpdb.getStockEmpMapping(); foreach (storeempmapping smp in LocList) { Boolean status = true; foreach (string itm in cmb.Items) { if (itm == smp.StoreLocationID + "-" + smp.Description) { status = false; } } if (status) { cmb.Items.Add(smp.StoreLocationID + "-" + smp.Description); } } }
public static void fillLocationComboNew(ComboBox cmb) { StoreEmpMappingDB smpdb = new StoreEmpMappingDB(); List <storeempmapping> LocList = smpdb.getStockEmpMapping(); foreach (storeempmapping smp in LocList) { Boolean status = true; foreach (Structures.ComboBoxItem itm in cmb.Items) { if ((itm.HiddenValue + "-" + itm.ToString()).Equals(smp.StoreLocationID + "-" + smp.Description)) { status = false; } } if (status) { Structures.ComboBoxItem cbitem = new Structures.ComboBoxItem(smp.Description, smp.StoreLocationID); cmb.Items.Add(cbitem); //cmb.Items.Add(smp.StoreLocationID + "-" + smp.Description); } } }