public JsonResult edit_form(string asset, string wcoa, string ocoa)
        {
            List <string> message = new List <string>();

            using (var db = new db_a094d4_demoEntities1())
            {
                try
                {
                    var production = new production_log();
                    production.wcoa   = wcoa;
                    production.ocoa   = ocoa;
                    production.ictags = asset;
                    db.production_log.Attach(production);
                    var entry = db.Entry(production);
                    entry.Property(e => e.ictags).IsModified = true;

                    entry.Property(e => e.ocoa).IsModified = true;


                    // other changed properties
                    db.SaveChanges();


                    message.Add("Info Has Updated for Asset ");
                }
                catch (Exception e)
                {
                    message.Add(e.InnerException.InnerException.Message);
                }
            }



            return(Json(new { message = message }, JsonRequestBehavior.AllowGet));
        }
 public ActionResult Edit([Bind(Include = "ictag,time,serial,brand,model,cpu,hdd,ram,optical_drive,location,pallet,pre_coa,refurbisher,status,orderNum,has_SSD")] rediscovery rediscovery)
 {
     if (ModelState.IsValid)
     {
         db.Entry(rediscovery).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(rediscovery));
 }
 public ActionResult Edit([Bind(Include = "time,ictags,wcoa,ocoa,Manufacture,Model,CPU,RAM,HDD,serial,channel,pre_coa,location,video_card,screen_size")] production_log production_log)
 {
     if (ModelState.IsValid)
     {
         db.Entry(production_log).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(production_log));
 }
Пример #4
0
 public ActionResult Edit([Bind(Include = "time,ictag,manu,monitor_ID,serial,size,resou,model")] monitor_log monitor_log)
 {
     if (ModelState.IsValid)
     {
         db.Entry(monitor_log).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(monitor_log));
 }
Пример #5
0
 public ActionResult Edit([Bind(Include = "ictag,time,serial,brand,model,cpu,hdd,ram,optical_drive,location")] discovery discovery)
 {
     if (ModelState.IsValid)
     {
         db.Entry(discovery).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(discovery));
 }
Пример #6
0
        public JsonResult edit_form(string asset, string time, string serial, string make, string cpu, string ram, string hdd, string model)
        {
            List <string> message = new List <string>();

            using (var db = new db_a094d4_demoEntities1()) {
                try
                {
                    var discovery = new discovery();
                    discovery.serial = serial;
                    discovery.brand  = make;
                    discovery.cpu    = cpu;
                    discovery.ram    = ram;
                    discovery.hdd    = hdd;
                    discovery.model  = model;
                    discovery.ictag  = int.Parse(asset);
                    db.discovery.Attach(discovery);
                    var entry = db.Entry(discovery);
                    entry.Property(e => e.serial).IsModified = true;
                    entry.Property(e => e.brand).IsModified  = true;
                    entry.Property(e => e.cpu).IsModified    = true;
                    entry.Property(e => e.ram).IsModified    = true;
                    entry.Property(e => e.hdd).IsModified    = true;
                    entry.Property(e => e.model).IsModified  = true;

                    // other changed properties
                    db.SaveChanges();


                    message.Add("Info Has Updated for Asset ");
                }
                catch (Exception e) {
                    message.Add(e.InnerException.InnerException.Message);
                }
            }



            return(Json(new { message = message }, JsonRequestBehavior.AllowGet));
        }
        public JsonResult edit_form(int asset, string serial, string model, string refurbisher, string sku)
        {
            List <string> message = new List <string>();

            using (var db = new db_a094d4_demoEntities1())
            {
                try
                {
                    var redis = new rediscovery();
                    redis.ictag       = asset;
                    redis.pallet      = sku;
                    redis.serial      = serial;
                    redis.model       = model;
                    redis.refurbisher = refurbisher;
                    db.rediscovery.Attach(redis);
                    var entry = db.Entry(redis);
                    entry.Property(e => e.pallet).IsModified      = true;
                    entry.Property(e => e.model).IsModified       = true;
                    entry.Property(e => e.serial).IsModified      = true;
                    entry.Property(e => e.refurbisher).IsModified = true;

                    // other changed properties
                    db.SaveChanges();


                    message.Add("Info Has Updated for Asset ");
                }
                catch (Exception e)
                {
                    message.Add(e.InnerException.InnerException.Message);
                }
            }



            return(Json(new { message = message }, JsonRequestBehavior.AllowGet));
        }