public ActionResult In_Create(object message) { var model = new tongs_entity(); this.TryUpdateModel <tongs_entity>(model); model.RegDate = DateTime.Now; this.ToolManageService.Savetongs_entity(model); return(this.RefreshParent()); }
public void Savetongs_entity(tongs_entity Data) { using (var dbContext = new ToolManageDbContext()) { if (Data.ID > 0) { dbContext.Update <tongs_entity>(Data); } else { dbContext.Insert <tongs_entity>(Data); } } }
public ActionResult Information_Edit(tongs_entity Data) { var ImagePath = Data.ImagePath; if (ImagePath != null) { string filename = DateTime.Now.Ticks + ImagePath.FileName; string truepath = Server.MapPath(@"/Upload/"); string filepath = truepath + filename; string urlfilepath = @"/Upload/" + filename; ImagePath.SaveAs(filepath); Data.Photo = urlfilepath; } else { Data.Photo = ToolManageService.Gettongs_entity(Data.ID).Photo; } this.ToolManageService.Savetongs_entity(Data); return(this.RefreshParent()); }
public ActionResult In_Create() { var model = new tongs_entity(); return(View(model)); }
public ActionResult Repair_Edit(tongs_entity Data) { this.ToolManageService.Savetongs_entity(Data); return(this.RefreshParent()); }