public CustomerStatusResult Create(CustomerStatusParam param)
        {
            Data.Entity.CustomerStatus entity = CustomerStatusParamConverter.Convert(param, null);
            CustomerStatusDao.Save(entity);

            return(CustomerStatusResultConverter.Convert(entity));
        }
        public CustomerStatusResult Find(long id)
        {
            Data.Entity.CustomerStatus entity = CustomerStatusDao.Find(id);
            CustomerStatusResult       result = CustomerStatusResultConverter.Convert(entity);

            return(result);
        }
Exemplo n.º 3
0
        public Data.Entity.CustomerStatus Save(Data.Entity.CustomerStatus entity)
        {
            CustomerStatusStorage.CustomerStatusList.Add(entity);
            CustomerStatusStorage.CustomerStatusDictionary.Add(entity.Id, entity);

            return(entity);
        }
        static CustomerStatusStorage()
        {
            Data.Entity.CustomerStatus CustomerStatus1 = new Data.Entity.CustomerStatus
            {
            };

            Data.Entity.CustomerStatus CustomerStatus2 = new Data.Entity.CustomerStatus
            {
            };

            Data.Entity.CustomerStatus CustomerStatus3 = new Data.Entity.CustomerStatus
            {
            };
            Data.Entity.CustomerStatus CustomerStatus4 = new Data.Entity.CustomerStatus
            {
            };
            Data.Entity.CustomerStatus CustomerStatus5 = new Data.Entity.CustomerStatus
            {
            };
            Data.Entity.CustomerStatus CustomerStatus6 = new Data.Entity.CustomerStatus
            {
            };
            Data.Entity.CustomerStatus CustomerStatus7 = new Data.Entity.CustomerStatus
            {
            };
            Data.Entity.CustomerStatus CustomerStatus8 = new Data.Entity.CustomerStatus
            {
            };
            Data.Entity.CustomerStatus CustomerStatus9 = new Data.Entity.CustomerStatus
            {
            };
            Data.Entity.CustomerStatus CustomerStatus10 = new Data.Entity.CustomerStatus
            {
            };

            CustomerStatusList.Add(CustomerStatus1);
            CustomerStatusList.Add(CustomerStatus2);
            CustomerStatusList.Add(CustomerStatus3);
            CustomerStatusList.Add(CustomerStatus4);
            CustomerStatusList.Add(CustomerStatus5);
            CustomerStatusList.Add(CustomerStatus6);
            CustomerStatusList.Add(CustomerStatus7);
            CustomerStatusList.Add(CustomerStatus8);
            CustomerStatusList.Add(CustomerStatus9);
            CustomerStatusList.Add(CustomerStatus10);

            CustomerStatusDictionary.Add(CustomerStatus1.Id, CustomerStatus1);
            CustomerStatusDictionary.Add(CustomerStatus2.Id, CustomerStatus2);
            CustomerStatusDictionary.Add(CustomerStatus3.Id, CustomerStatus3);
            CustomerStatusDictionary.Add(CustomerStatus4.Id, CustomerStatus4);
            CustomerStatusDictionary.Add(CustomerStatus5.Id, CustomerStatus5);
            CustomerStatusDictionary.Add(CustomerStatus6.Id, CustomerStatus6);
            CustomerStatusDictionary.Add(CustomerStatus7.Id, CustomerStatus7);
            CustomerStatusDictionary.Add(CustomerStatus8.Id, CustomerStatus8);
            CustomerStatusDictionary.Add(CustomerStatus9.Id, CustomerStatus9);
            CustomerStatusDictionary.Add(CustomerStatus10.Id, CustomerStatus10);
        }
        public void Update(List <CustomerStatusParam> param)
        {
            List <Data.Entity.CustomerStatus> entity = new List <Data.Entity.CustomerStatus>();

            foreach (var item in param)
            {
                Data.Entity.CustomerStatus oldEntity = CustomerStatusDao.Find(item.Id);
                Data.Entity.CustomerStatus newEntity = CustomerStatusParamConverter.Convert(item, null);
                CustomerStatusDao.Update(newEntity);
            }
        }
        public CustomerStatusResult Convert(Data.Entity.CustomerStatus param)
        {
            CustomerStatusResult result = new CustomerStatusResult()
            {
                Code        = param.Code,
                Id          = param.Id,
                Description = param.Description,
                Name        = param.Name
            };

            return(result);
        }
        public Data.Entity.CustomerStatus Convert(CustomerStatusParam param, Data.Entity.CustomerStatus oldentity)
        {
            Data.Entity.CustomerStatus entity = null;

            if (oldentity != null)
            {
                entity = oldentity;
            }
            else
            {
                entity = new Data.Entity.CustomerStatus
                {
                    Code        = param.Code,
                    Id          = param.Id,
                    Description = param.Description,
                    Name        = param.Name
                };
            }

            return(entity);
        }
 public void Update(long id, CustomerStatusParam param)
 {
     Data.Entity.CustomerStatus oldEntity = CustomerStatusDao.Find(id);
     Data.Entity.CustomerStatus newEntity = CustomerStatusParamConverter.Convert(param, null);
     CustomerStatusDao.Update(newEntity);
 }
Exemplo n.º 9
0
 public Data.Entity.CustomerStatus Update(Data.Entity.CustomerStatus entity)
 {
     Delete(entity.Id);
     Save(entity);
     return(entity);
 }
Exemplo n.º 10
0
 public void Delete(Data.Entity.CustomerStatus entity)
 {
     CustomerStatusStorage.CustomerStatusList.Remove(entity);
     CustomerStatusStorage.CustomerStatusDictionary.Remove(entity.Id);
 }
Exemplo n.º 11
0
 public void Delete(long id)
 {
     Data.Entity.CustomerStatus entity = Find(id);
     Delete(entity);
 }