Exemple #1
0
 public ActionResult AddNewEmployee(EmployeeInfo emp)
 {
     //var newEmp = new EmployeeInfo() { FullName = "abir", Address = "CTG", Email = "*****@*****.**", Mobile = "15465454545" };
     if (emp.Id == 0)
     {
         try
         {
             if (serviceObject.AddNewEmployee(emp))
             {
                 return(RedirectToAction("Index"));
             }
             else
             {
                 return(Content("Something Went worng!"));
             }
         }
         catch (Exception)
         {
             throw;
         }
     }
     else
     {
         try
         {
             if (serviceObject.EditEmployeeById(emp))
             {
                 return(RedirectToAction("Index"));
             }
             else
             {
                 return(Content("Something Went worng!"));
             }
         }
         catch (Exception ex)
         {
             throw;
         }
     }
 }