Esempio n. 1
0
        public List <GRNServiceBLL> GetByGRNId(Guid Id)
        {
            List <GRNServiceBLL>        list   = null;
            List <WarehouseServicesBLL> listWS = null;

            try
            {
                list = GRNServiceDAL.GetByGRNId(Id);
                WarehouseServicesBLL objservice = new WarehouseServicesBLL();
                listWS = objservice.GetServices();
                if (list != null)
                {
                    listWS = objservice.GetActiveServices();
                    if (listWS != null)
                    {
                        var x = from grnser in list
                                join wservice in listWS on grnser.ServiceId equals wservice.Id
                                select new { grnser.Id, grnser.GRNId, grnser.Quantity, grnser.Status, grnser.ServiceId, ServiceName = wservice.Name };
                        list = new List <GRNServiceBLL>();
                        foreach (var i in x)
                        {
                            GRNServiceBLL o = new GRNServiceBLL();
                            o.Id          = i.Id;
                            o.GRNId       = i.GRNId;
                            o.ServiceId   = i.ServiceId;
                            o.ServiceName = i.ServiceName;
                            o.Status      = i.Status;
                            o.Quantity    = i.Quantity;
                            list.Add(o);
                        }
                        return(list);
                    }
                    else
                    {
                        throw new Exception("unable to get look up information.");
                    }
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public List <WarehouseServicesBLL> GetServices()
        {
            List <WarehouseServicesBLL> list = null;

            ECXLookUp.ECXLookup  objEcxLookUp = new WarehouseApplication.ECXLookUp.ECXLookup();
            ECXLookUp.CService[] objServices  = objEcxLookUp.GetActiveServices(Utility.GetWorkinglanguage());
            if (objServices != null)
            {
                if (objServices.Count() > 0)
                {
                    list = new List <WarehouseServicesBLL>();
                    foreach (ECXLookUp.CService s in objServices)
                    {
                        WarehouseServicesBLL obj = new WarehouseServicesBLL();
                        obj.Id     = s.UniqueIdentifier;
                        obj.Name   = s.Name;
                        obj.Status = s.Status;
                        list.Add(obj);
                    }
                }
            }
            return(list);
        }