Exemple #1
0
 public void Update(SysItemDetail sysItemDetail)
 {
     using (MAction action = new MAction(tableName))
     {
         action.Data.LoadFrom(sysItemDetail);
         action.Update();
     }
 }
Exemple #2
0
 public void Insert(SysItemDetail sysItemDetail)
 {
     using (MAction action = new MAction(tableName))
     {
         action.Data.LoadFrom(sysItemDetail);
         action.Insert();
     }
 }
Exemple #3
0
        public ActionResult GetForm(string primaryKey)
        {
            SysItemDetail entity = itemDetaillogic.Get(primaryKey);

            entity.IsDefault = entity.IsDefault == "1" ? "true" : "false";
            entity.IsEnabled = entity.IsEnabled == "1" ? "true" : "false";
            return(Content(entity.ToJson()));
        }
Exemple #4
0
        public SysItemDetail GetObjectByCondition(string where)
        {
            SysItemDetail sysItemDetail = new SysItemDetail();

            using (MAction action = new MAction(tableName))
            {
                if (action.Fill(where))
                {
                    sysItemDetail = action.Data.ToEntity <SysItemDetail>();
                }
            }
            return(sysItemDetail);
        }
Exemple #5
0
 public ActionResult Form(SysItemDetail model)
 {
     if (model.Id.IsNullOrEmpty())
     {
         int row = itemDetaillogic.Insert(model);
         return(row > 0 ? Success() : Error());
     }
     else
     {
         int row = itemDetaillogic.Update(model);
         return(row > 0 ? Success() : Error());
     }
 }
Exemple #6
0
 public int Insert(SysItemDetail model)
 {
     using (var db = GetInstance())
     {
         model.Id         = Guid.NewGuid().ToString().Replace("-", "");
         model.IsEnabled  = model.IsEnabled == null ? "0" : "1";
         model.IsDefault  = model.IsDefault == null ? "0" : "1";
         model.DeleteMark = "0";
         model.CreateUser = OperatorProvider.Instance.Current.Account;
         model.CreateTime = DateTime.Now;
         model.ModifyUser = model.CreateUser;
         model.ModifyTime = model.CreateTime;
         return(db.Insertable <SysItemDetail>(model).ExecuteCommand());
     }
 }
Exemple #7
0
 public int Update(SysItemDetail model)
 {
     using (var db = GetInstance())
     {
         model.IsEnabled  = model.IsEnabled == null ? "0" : "1";
         model.IsDefault  = model.IsDefault == null ? "0" : "1";
         model.ModifyUser = OperatorProvider.Instance.Current.Account;
         model.ModifyTime = DateTime.Now;
         return(db.Updateable <SysItemDetail>(model).UpdateColumns(it => new
         {
             it.ItemId,
             it.EnCode,
             it.Name,
             it.IsDefault,
             it.SortCode,
             it.IsEnabled,
             it.ModifyUser,
             it.ModifyTime
         }).ExecuteCommand());
     }
 }
Exemple #8
0
 public void Update(SysItemDetail sysItemDetail)
 {
     sysItemDetailDal.Update(sysItemDetail);
 }
Exemple #9
0
 public void Insert(SysItemDetail sysItemDetail)
 {
     sysItemDetailDal.Insert(sysItemDetail);
 }