コード例 #1
0
        public bool UpdateOrder(int id, BusinessEntities.OrderMasterEntity OrderMasterEntity)
        {
            var success = false;

            if (OrderMasterEntity != null)
            {
                using (var scope = new TransactionScope())
                {
                    var city = _unitOfWork.OrderMasterRepository.GetByID(id);
                    if (city != null)
                    {
                        city.FullName    = OrderMasterEntity.FullName;
                        city.MobileNo    = OrderMasterEntity.MobileNo;
                        city.LandMark    = OrderMasterEntity.LandMark;
                        city.City        = OrderMasterEntity.City;
                        city.AddressType = OrderMasterEntity.AddressType;
                        _unitOfWork.OrderMasterRepository.Update(city);
                        _unitOfWork.Save();
                        scope.Complete();
                        success = true;
                    }
                }
            }
            return(success);
        }
コード例 #2
0
 public int CreateOrder(BusinessEntities.OrderMasterEntity OrderMasterEntity)
 {
     using (var scope = new TransactionScope())
     {
         var city = new OrderMaster
         {
             FullName    = OrderMasterEntity.FullName,
             MobileNo    = OrderMasterEntity.MobileNo,
             LandMark    = OrderMasterEntity.LandMark,
             City        = OrderMasterEntity.City,
             AddressType = OrderMasterEntity.AddressType,
         };
         _unitOfWork.OrderMasterRepository.Insert(city);
         _unitOfWork.Save();
         scope.Complete();
         return(city.Sno);
     }
 }
コード例 #3
0
        public BusinessEntities.OrderMasterEntity GetOrderById(int id)
        {
            BusinessEntities.OrderMasterEntity objOrderMaster = new BusinessEntities.OrderMasterEntity();
            if (id == 0)
            {
                return(objOrderMaster);
            }

            var city = _unitOfWork.OrderMasterRepository.GetByID(id);

            if (city != null)
            {
                Mapper.CreateMap <OrderMaster, OrderMasterEntity>();
                var OrderModel = Mapper.Map <OrderMaster, OrderMasterEntity>(city);
                return(OrderModel);
            }
            return(null);
        }