Example #1
0
        public ActionResult Edit([FromQuery] int Id)
        {
            ReserveInfo item = Reserve.GetItem(Id);

            if (item == null)
            {
                return(APIReturn.记录不存在_或者没有权限);
            }
            ViewBag.item = item;
            return(View());
        }
Example #2
0
        public APIReturn _Edit([FromQuery] int Id, [FromForm] int?Mroom_id, [FromForm] DateTime?Datetime1, [FromForm] short?Use_minute, [FromForm] string Username)
        {
            ReserveInfo item = Reserve.GetItem(Id);

            if (item == null)
            {
                return(APIReturn.记录不存在_或者没有权限);
            }
            item.Mroom_id    = Mroom_id;
            item.Create_time = DateTime.Now;
            item.Datetime1   = Datetime1;
            item.Use_minute  = Use_minute;
            item.Username    = Username;
            int affrows = Reserve.Update(item);

            if (affrows > 0)
            {
                return(APIReturn.成功.SetMessage($"更新成功,影响行数:{affrows}"));
            }
            return(APIReturn.失败);
        }