private void BindStoreNameDropdown(int UserID) { IQCareUtils theUtils = new IQCareUtils(); ddlStoreName.Items.Clear(); IMasterList objProgramlist = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM"); DataTable theDT = objProgramlist.GetStoreByUser(UserID); DataView theDV = new DataView(theDT); BindFunctions theBind = new BindFunctions(); if ((GblIQCare.theArea == "PO") || (GblIQCare.theArea == "GRN")) { theDV.RowFilter = "CentralStore=1"; } else if ((GblIQCare.theArea == "Dispense") || (GblIQCare.theArea == "IV") || (GblIQCare.theArea == "CR")) { theDV.RowFilter = "CentralStore=0"; } DataTable theStoreDT = theDV.ToTable(); theBind.Win_BindCombo(ddlStoreName, theStoreDT, "StoreName", "StoreId"); if (theDT.Rows.Count == 2) { ddlStoreName.SelectedIndex = 1; ddlStoreName.Enabled = false; } }
private void BindStoreNameDropdown(int UserID) { IQCareUtils theUtils = new IQCareUtils(); ddlStoreName.Items.Clear(); IMasterList objProgramlist = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM"); DataTable theDT = objProgramlist.GetStoreByUser(UserID); DataView theDV = new DataView(theDT); BindFunctions theBind = new BindFunctions(); switch (GblIQCare.CurrentMenu) { case MenuChoice.PurchaseOrder: //purchase order or good received note case MenuChoice.GoodReceived: case MenuChoice.POWithGRN: theDV.RowFilter = "StoreCategory = 'Purchasing' OR StoreCategory = 'Purchasing and Dispensing' "; break; case MenuChoice.Dispense: theDV.RowFilter = "StoreCategory = 'Dispensing' OR StoreCategory = 'Purchasing and Dispensing' "; break; case MenuChoice.CounterRequistion: //counter requisition case MenuChoice.CRWithIV: theDV.RowFilter = "StoreCategory <> 'Purchasing' OR StoreCategory <> 'Purchasing and Dispensing' "; break; } /*switch (GblIQCare.theArea) * { * case "PO": //purchase order or good received note * case "GRN": * theDV.RowFilter = "StoreCategory = 'Purchasing' "; * break; * case "Dispense": * theDV.RowFilter = "StoreCategory = 'Dispensing' "; * break; * case "CR": //counter requisition * theDV.RowFilter = "StoreCategory <> 'Purchasing' "; * break; * }*/ DataTable theStoreDT = theDV.ToTable(); theBind.Win_BindCombo(ddlStoreName, theStoreDT, "StoreName", "StoreId", "StoreName"); if (theDT.Rows.Count == 1) { ddlStoreName.SelectedIndex = 0; //ddlStoreName.Enabled = false; } }