public int Update(long HirCategoryId, HirCategory_Info data, IEnumerable <string> columns) { using (var db = new DBExecutor().GetDatabase()) { return(db.Update(data, HirCategoryId, columns)); } }
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)); }
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)); } }
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); } }
public long Insert(HirCategory_Info data) { long newID = 0; try { newID = new HirCategory_Repo().Insert(data); } catch (Exception ex) { log.Exception(ex); } return(newID); }
public bool Update(HirCategory_Info data) { return(new HirCategory_Repo().Update(data) > 0); }
public bool Update(long HirCategoryId, HirCategory_Info data, IEnumerable <string> columns) { return(new HirCategory_Repo().Update(HirCategoryId, data, columns) > 0); }