예제 #1
0
 public int Update(long HirCategoryId, HirCategory_Info data, IEnumerable <string> columns)
 {
     using (var db = new DBExecutor().GetDatabase())
     {
         return(db.Update(data, HirCategoryId, columns));
     }
 }
예제 #2
0
        public JsonResult SaveHirCategory(HirCategory_Info data)
        {
            ResultBase result = new ResultBase();

            result.setMessage("Done");
            if (string.IsNullOrEmpty(data.CategoryName))
            {
                result.setErrorMessage("類別代號名稱不得為空白");
            }
            if (result.JsonReturnCode > -1)
            {
                data.LastUpdate  = DateTime.Now;
                data.LastUpdator = sessionData.trading.LoginId;
                //var olddata = OQMan.GetBySN(data.HirCategoryId);
                //checkUploadfiles(data, olddata);
                if (data.HirCategoryId > 0)
                {
                    CHMan.Update(data);
                }
                else
                {
                    CHMan.Insert(data);
                }
            }
            return(Json(result, JsonRequestBehavior.DenyGet));
        }
예제 #3
0
 public int Update(HirCategory_Info data)
 {
     using (var db = new DBExecutor().GetDatabase())
     {
         var SQLStr = Rest.Core.PetaPoco.Sql.Builder
                      .Append("Update db_HirDetail set HirName = @0", data.CategoryName)
                      .Append("WHERE HirCategoryId=@0", data.HirCategoryId);
         db.Execute(SQLStr);
         return(db.Update(data));
     }
 }
예제 #4
0
 public long Insert(HirCategory_Info data)
 {
     using (var db = new DBExecutor().GetDatabase())
     {
         long NewID  = 0;
         var  result = db.Insert(data);
         if (result != null)
         {
             long.TryParse(result.ToString(), out NewID);
         }
         return(NewID);
     }
 }
예제 #5
0
        public long Insert(HirCategory_Info data)
        {
            long newID = 0;

            try
            {
                newID = new HirCategory_Repo().Insert(data);
            }
            catch (Exception ex)
            {
                log.Exception(ex);
            }
            return(newID);
        }
예제 #6
0
 public bool Update(HirCategory_Info data)
 {
     return(new HirCategory_Repo().Update(data) > 0);
 }
예제 #7
0
 public bool Update(long HirCategoryId, HirCategory_Info data, IEnumerable <string> columns)
 {
     return(new HirCategory_Repo().Update(HirCategoryId, data, columns) > 0);
 }