public ActionResult Create(RoleViewModel role)
 {
     if (ModelState.IsValid)
     {
         Role model = new Role();
         model.RoleName = role.RoleName;
         if (_iServiceRole.SaveAdd(model))
         {
             SessionUserHelper.CreateSessionSuccess(ConstantStrings.AddSuccess);
         }
         else
         {
             SessionUserHelper.CreateSessionError(ConstantStrings.AddNonSuccess);
         }
         return RedirectToAction("Index");
     }
     return View(role);
 }
 public Role GetRoleModel(RoleViewModel model)
 {
     var item = new Role();
     item.Id = model.Id;
     item.RoleName = model.RoleName;
     return item;
 }
 public RoleViewModel GetRoleViewModel(int id)
 {
     var model = _iServiceRole.FindRoleById(id);
     var item = new RoleViewModel();
     item.Id = model.Id;
     item.RoleName = model.RoleName;
     return item;
 }
 public ActionResult Edit(RoleViewModel role)
 {
     if (ModelState.IsValid)
     {
         if (_iServiceRole.SaveEdit(GetRoleModel(role)))
         {
             SessionUserHelper.CreateSessionSuccess(ConstantStrings.EditSuccess);
         }
         else
         {
             SessionUserHelper.CreateSessionError(ConstantStrings.EditNonSuccess);
         }
         return RedirectToAction("Index");
     }
     return View(role);
 }