Exemplo n.º 1
0
 public ActionResult Edit(Int32 Labourid)
 {
     using (labourCtl db = new labourCtl()){
         labourClass obj_labour = db.selectById(Labourid);
         Session["EditPreviousURL"] = Convert.ToString(ControllerContext.HttpContext.Request.UrlReferrer);
         return(View(obj_labour));
     }
 }
Exemplo n.º 2
0
 public ActionResult SaveRecords(FormCollection model)
 {
     if (ModelState.IsValid)
     {
         using (labourCtl db = new labourCtl()){
             var LabouridArray   = model.GetValues("item.Labourid");
             var LabournameArray = model.GetValues("item.Labourname");
             for (Int32 i = 0; i < LabouridArray.Length; i++)
             {
                 labourClass obj_update = db.selectById(Convert.ToInt32(LabouridArray[i]));
                 if (!string.IsNullOrEmpty(Convert.ToString(LabouridArray)))
                 {
                     obj_update.Labourid = Convert.ToInt32(LabouridArray[i]);
                 }
                 if (!string.IsNullOrEmpty(Convert.ToString(LabournameArray)))
                 {
                     obj_update.Labourname = Convert.ToString(LabournameArray[i]);
                 }
                 db.update(obj_update);
             }
         }
     }
     return(RedirectToAction("EditTable"));
 }
Exemplo n.º 3
0
 public ActionResult Details(Int32 Labourid)
 {
     using (labourCtl db = new labourCtl()){ labourClass obj_labour = db.selectById(Labourid);
                                             return(View(obj_labour)); }
 }