public IList <Party> GetAllParty(string userCode, string type) { IList <Party> listParty = new List <Party>(); if (type.Trim().ToLower() == BusinessConstants.PARTY_TYPE_SUPPLIER.Trim().ToLower()) { IList <Supplier> listSupplier = SupplierMgr.GetSupplier(userCode); foreach (Supplier supplier in listSupplier) { listParty.Add((Party)supplier); } } else if (type.Trim().ToLower() == BusinessConstants.PARTY_TYPE_CUSTOMER.Trim().ToLower()) { IList <Customer> listCustomer = CustomerMgr.GetCustomer(userCode); foreach (Customer customer in listCustomer) { listParty.Add((Party)customer); } } else if (type.Trim().ToLower() == BusinessConstants.PARTY_TYPE_CARRIER.Trim().ToLower()) { IList <Carrier> listCarrier = CarrierMgr.GetCarrier(userCode); foreach (Carrier carrier in listCarrier) { listParty.Add((Party)carrier); } } else { listParty = null; } return(listParty); }
private List <string> GetPartyList(string planType, string userCode) { List <string> partyList = new List <string>(); if (planType == BusinessConstants.CODE_MASTER_PLAN_TYPE_VALUE_DMDSCHEDULE) { IList <Customer> custList = CustomerMgr.GetCustomer(userCode); if (custList != null && custList.Count > 0) { foreach (Customer cust in custList) { partyList.Add(cust.Code); } } } else if (planType == BusinessConstants.CODE_MASTER_PLAN_TYPE_VALUE_MPS) { IList <Region> regionList = RegionMgr.GetRegion(userCode); if (regionList != null && regionList.Count > 0) { foreach (Region region in regionList) { partyList.Add(region.Code); } } } else if (planType == BusinessConstants.CODE_MASTER_PLAN_TYPE_VALUE_MRP) { IList <Supplier> supList = SupplierMgr.GetSupplier(userCode); if (supList != null && supList.Count > 0) { foreach (Supplier sup in supList) { partyList.Add(sup.Code); } } } return(partyList); }