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

            if (notificationforUpdate != null)
            {
                try
                {
                    notificationforUpdate              = notification_Image.ToNotification_Image(notificationforUpdate);
                    notificationforUpdate.NotiId       = notification_Image.NotiId;
                    notificationforUpdate.ImageId      = notification_Image.ImageId;
                    notificationforUpdate.notification = notification_Image.notification;
                    notificationforUpdate.image        = notification_Image.image;
                    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);
        }
Beispiel #2
0
        public async Task <BaseResult> Create(Notification_Image 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);
        }
 public static Notification_Image ToNotification_Image(this Notification_Image entity, Notification_Image destination)
 {
     return(entity.MapTo(destination));
 }
 public static Notification_ImageItem ToItem(this Notification_Image entity)
 {
     return(entity.MapTo <Notification_Image, Notification_ImageItem>());
 }