Пример #1
0
 public ActionResult SubmitForm(Sys_ItemsDetail itemsDetailEntity, string keyValue)
 {
     try
     {
         bool     i     = false;
         Sys_User uInfo = ViewData["Account"] as Sys_User;
         if (keyValue == "" || keyValue == null)
         {
             itemsDetailEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserCode;
             itemsDetailEntity.F_CreatorTime   = DateTime.Now;
             itemsDetailEntity.F_Id            = System.Guid.NewGuid().ToString();
             i = itemsDetailApp.Add(itemsDetailEntity);
         }
         else
         {
             itemsDetailEntity.F_Id = keyValue;
             itemsDetailEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserCode;
             itemsDetailEntity.F_LastModifyTime   = DateTime.Now;
             string[] notstr = { "F_CreatorUserId", "F_CreatorTime", "F_ParentId", "F_ItemId" };
             i = itemsDetailApp.Update(itemsDetailEntity, notstr);
         }
         if (i)
         {
             return(Success());
         }
         else
         {
             return(Warning());
         }
     }
     catch (Exception ex)
     {
         return(Error(ex.Message));
     }
 }
Пример #2
0
        public void SubmitForm(Sys_ItemsDetail itemsDetailEntity, string keyValue)
        {
            OperatorModel op = OperatorProvider.Provider.GetCurrent();

            if (!string.IsNullOrEmpty(keyValue))
            {
                //itemsDetailEntity.Modify(keyValue);
                itemsDetailEntity.F_Id               = keyValue;
                itemsDetailEntity.F_LastModifyTime   = DateTime.Now;
                itemsDetailEntity.F_LastModifyUserId = OperatorProvider.Provider.GetCurrent().UserId;
                itemsDetailEntity.F_DeleteMark       = false;
                service.Update(itemsDetailEntity);
                LogHelper.Info("字典:【" + itemsDetailEntity.F_ItemName + "】编辑!操作人账号:" + op.UserCode + ",操作人名称:" + op.UserName + ",操作时间" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), OpType.System, null, "", "", ViewLevel.Admin);
            }
            else
            {
                //itemsDetailEntity.Create();
                itemsDetailEntity.F_Id            = Common.GuId();
                itemsDetailEntity.F_CreatorUserId = OperatorProvider.Provider.GetCurrent().UserId;
                itemsDetailEntity.F_CreatorTime   = DateTime.Now;
                itemsDetailEntity.F_DeleteMark    = false;
                service.Insert(itemsDetailEntity);
                LogHelper.Info("字典:【" + itemsDetailEntity.F_ItemName + "】新增!操作人账号:" + op.UserCode + ",操作人名称:" + op.UserName + ",操作时间" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), OpType.System, null, "", "", ViewLevel.Admin);
            }
        }
Пример #3
0
        public object GetItemsDetail(int page, int limit, string id)
        {
            List <Sys_ItemsDetail> _ItemsDetail = new List <Sys_ItemsDetail>();
            var list = ItemsDetail.Query().Result;

            foreach (var item in list)
            {
                Sys_ItemsDetail sys_Items = new Sys_ItemsDetail();
                if (item.F_ItemId == id)
                {
                    sys_Items.F_Id          = item.F_Id;
                    sys_Items.F_ItemId      = item.F_ItemId;
                    sys_Items.F_ItemCode    = item.F_ItemCode;
                    sys_Items.F_ItemName    = item.F_ItemName;
                    sys_Items.F_SortCode    = item.F_SortCode;
                    sys_Items.F_CreatorTime = item.F_CreatorTime;
                    sys_Items.F_EnabledMark = item.F_EnabledMark;

                    _ItemsDetail.Add(sys_Items);
                }
            }
            var data = new { code = 0, msg = "", data = _ItemsDetail, count = _ItemsDetail.Count };

            return(data.ToJson());
        }
Пример #4
0
 public void SubmitForm(Sys_ItemsDetail entity, string keyValue)
 {
     if (!string.IsNullOrEmpty(keyValue))
     {
         entity.F_Id = keyValue;
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             entity.F_LastModifyUserId = LoginInfo.UserId;
         }
         entity.F_LastModifyTime = DateTime.Now;
         service.Update(entity);
     }
     else
     {
         entity.F_Id = Common.GuId();
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             entity.F_CreatorUserId = LoginInfo.UserId;
         }
         entity.F_CreatorTime = DateTime.Now;
         service.Insert(entity);
     }
 }
Пример #5
0
 public ActionResult Form(Sys_ItemsDetail model)
 {
     if (model.Id.IsNullOrEmpty())
     {
         var primaryKey = _itemsDetailService.Insert(model);
         return(primaryKey != null?Success() : Error());
     }
     else
     {
         int row = _itemsDetailService.Update(model);
         return(row > 0 ? Success() : Error());
     }
 }
Пример #6
0
        public object ItemsDetailUpdate(Itemsdetail itemsModel)
        {
            var list = new Sys_ItemsDetail {
                F_ItemName    = itemsModel.F_ItemName,
                F_CreatorTime = DateTime.Now,
                F_Id          = itemsModel.F_Id,
                F_ItemId      = itemsModel.F_ItemId,
                F_ItemCode    = itemsModel.F_ItemCode,
                F_SortCode    = int.Parse(itemsModel.F_SortCode),
                F_EnabledMark = true
            };
            var ret = ItemsDetail.Update(list).Result;

            return(ret);
        }
Пример #7
0
        public object ItemsDetailAdd([FromBody] Itemsdetail itemsModel)
        {
            var list = new Sys_ItemsDetail
            {
                F_ItemName    = itemsModel.F_ItemName,
                F_CreatorTime = DateTime.Now,
                F_Id          = Common.GuId(),
                F_ItemId      = itemsModel.F_ItemId,
                F_ItemCode    = itemsModel.F_ItemCode,
                F_SortCode    = int.Parse(itemsModel.F_SortCode),
                F_EnabledMark = true
            };
            var ret = ItemsDetail.Add(list).Result;

            return(ret);
        }
Пример #8
0
 public ActionResult SubmitForm(Sys_ItemsDetail itemsDetail, string keyValue)
 {
     itemsDetailApp.SubmitForm(itemsDetail, keyValue);
     return(Success("操作成功。"));
 }
Пример #9
0
 public bool Update(Sys_ItemsDetail obj, string[] disablestr = null)
 {
     return(dal.Update(obj, disablestr));
 }
Пример #10
0
 /// <summary>
 /// 添加
 /// </summary>
 /// <returns></returns>
 public bool Add(Sys_ItemsDetail obj, string[] disstr = null)
 {
     return(dal.Add(obj, disstr));
 }