Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 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);
         }
     }
 }
Esempio n. 3
0
        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());
        }
Esempio n. 4
0
        public ActionResult In_Create()
        {
            var model = new tongs_entity();

            return(View(model));
        }
Esempio n. 5
0
 public ActionResult Repair_Edit(tongs_entity Data)
 {
     this.ToolManageService.Savetongs_entity(Data);
     return(this.RefreshParent());
 }