コード例 #1
0
 public ActionResult Edit_Info_Submit(BasicInfo b1)
 {
     if (Session["EmpID"] != null)
     {
         if (ModelState.IsValid)
         {
             Validation_Classes.Validation v1 = new Validation_Classes.Validation();
             b1.SaveChanges(int.Parse(Session["EmpId"].ToString()));
             Employee e2 = (Employee)Session["Employee"];
             e2.EmployeeName = b1.Name;
             e2.Birthday     = DateTime.ParseExact(b1.BirthDay, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
             e2.Address      = b1.Address;
             e2.CNIC         = b1.Cnic;
             e2.Email        = b1.Email;
             e2.PhoneNumber  = b1.PhoneNumber;
         }
         else
         {
             b1 = null;
             ViewBag.OpenModel = true;
             b1 = new BasicInfo((LeaveApplication.Models.Employee)Session["Employee"]);
             return(View("Basicinfo", b1));
         }
         return(RedirectToAction("Basicinfo"));
     }
     else
     {
         return(RedirectToAction("Index", "LogIn"));
     }
 }