public ActionResult UpdateUser(UserViewModel model, HttpPostedFileBase file)
 {
     if (ModelState.IsValid)
     {
         if (file != null && file.ContentLength > 0)
         {
             CommonController common = new CommonController();
             model.User.photo = Path.GetFileName(file.FileName);
             string filePath = Path.Combine(Server.MapPath(ConfigurationManager.AppSettings["FilePath"].ToString()), Path.GetFileName(file.FileName));
             string message  = common.UploadFile(file, filePath);
             ModelState.AddModelError("User.Photo", message);
         }
         UserService.UserServiceClient Client = new UserService.UserServiceClient();
         model.User.IsActive = true;
         Client.updateUser(model.User);
         Client.UpdateUserGroupMember(model.User.UserId);
         Client.insertUserGroupmember(model.User.UserId, model.UserGroupID);
         Client.UpdateUserRole(model.User.UserId);
         Client.insertUserRole(model.User.UserId, model.RoleID);
         return(View("ListofUsers"));
     }
     else
     {
         ModelState.AddModelError("", ConfigurationManager.AppSettings["Requried"]);
     }
     return(View("ListofUsers"));
 }