コード例 #1
0
 public ActionResult Edit(Int32 Componentid)
 {
     using (componentCtl db = new componentCtl()){
         componentClass obj_component = db.selectById(Componentid);
         Session["EditPreviousURL"] = Convert.ToString(ControllerContext.HttpContext.Request.UrlReferrer);
         return(View(obj_component));
     }
 }
コード例 #2
0
 public ActionResult SaveRecords(FormCollection model)
 {
     if (ModelState.IsValid)
     {
         using (componentCtl db = new componentCtl()){
             var ComponentidArray   = model.GetValues("item.Componentid");
             var ComponentnameArray = model.GetValues("item.Componentname");
             for (Int32 i = 0; i < ComponentidArray.Length; i++)
             {
                 componentClass obj_update = db.selectById(Convert.ToInt32(ComponentidArray[i]));
                 if (!string.IsNullOrEmpty(Convert.ToString(ComponentidArray)))
                 {
                     obj_update.Componentid = Convert.ToInt32(ComponentidArray[i]);
                 }
                 if (!string.IsNullOrEmpty(Convert.ToString(ComponentnameArray)))
                 {
                     obj_update.Componentname = Convert.ToString(ComponentnameArray[i]);
                 }
                 db.update(obj_update);
             }
         }
     }
     return(RedirectToAction("EditTable"));
 }
コード例 #3
0
 public ActionResult Details(Int32 Componentid)
 {
     using (componentCtl db = new componentCtl()){ componentClass obj_component = db.selectById(Componentid);
                                                   return(View(obj_component)); }
 }