示例#1
0
        public JsonResult UpdateUser(SystemUser su)
        {
            SystemUser system = new SystemUser();

            try
            {
                int    Edit_by = Convert.ToInt32(Session["emp_id"].ToString());
                string res     = dblayer.UpdateSystemUser(su.Emp_ID, su.First_Name, su.Middle_Name, su.Last_Name, su.Email, su.Dob, su.Doj, su.Designation, su.Password
                                                          , su.Role, su.Department_Id, su.Manager_Id, su.Status, su.Last_WDay, su.contact, su.Sex, su.Start_Date, su.End_Date, Edit_by);
                string[] response = res.Split(',');
                if (response[0] == "Success")
                {
                    string resPermission = "Not updated";
                    if (su.userPermissions != null)
                    {
                        resPermission = dblayer.updateUserRolePermission(su.userPermissions.AsEnumerable(), su.Emp_ID.ToString());
                    }
                    system.success_msg = response[1];
                }
                else
                {
                    system.error_msg = response[1];
                }
            }
            catch (Exception ex)
            {
                system.error_msg = ex.Message;
            }
            return(Json(system, JsonRequestBehavior.AllowGet));
        }