public async Task <BaseResult> Update(Notification_Order notification_Order, int updateBy = 0, string updateByUserName = "")
        {
            var rs = new BaseResult()
            {
                Result = Result.Success
            };
            var notificationforUpdate = _Repository.Query().FirstOrDefault(p => p.Id == notification_Order.Id);

            if (notificationforUpdate != null)
            {
                try
                {
                    notificationforUpdate              = notification_Order.ToNotification_Order(notificationforUpdate);
                    notificationforUpdate.NotiId       = notification_Order.NotiId;
                    notificationforUpdate.OrderId      = notification_Order.OrderId;
                    notificationforUpdate.notification = notification_Order.notification;
                    notificationforUpdate.order        = notification_Order.order;
                    notificationforUpdate              = notificationforUpdate.UpdateCommonInt(updateBy, updateByUserName);
                    await _Repository.UpdateAsync(notificationforUpdate);

                    _Repository.SaveChange();
                }
                catch (Exception ex)
                {
                    rs.Result  = Result.SystemError;
                    rs.Message = ex.ToString();
                }
            }
            else
            {
                rs.Message = "Không tìm thấy don hang cần sửa";
                rs.Result  = Result.Failed;
            }
            return(rs);
        }
        public async Task <BaseResult> Create(Notification_Order orderitem)
        {
            var rs = new BaseResult()
            {
                Result = Result.Success
            };



            try
            {
                await _Repository.InsertAsync(orderitem);
            }
            catch (Exception ex)
            {
                rs.Result  = Result.SystemError;
                rs.Message = ex.ToString();
            }
            return(rs);
        }
Exemplo n.º 3
0
 public static Notification_Order ToNotification_Order(this Notification_Order entity, Notification_Order destination)
 {
     return(entity.MapTo(destination));
 }
Exemplo n.º 4
0
 public static Notification_OrderItem ToItem(this Notification_Order entity)
 {
     return(entity.MapTo <Notification_Order, Notification_OrderItem>());
 }