Example #1
0
 public ActionResult ManageDistributorUsers(DistributorCommon dcommon)
 {
     RemoveAgentValidation(dcommon);
     RemoveContactPersonValidation(dcommon);
     if (!string.IsNullOrEmpty(dcommon.UserId))
     {
         ModelState.Remove("Password");
         ModelState.Remove("ConfirmPassword");
     }
     if (ModelState.IsValid)
     {
         if (!string.IsNullOrEmpty(dcommon.UserId))
         {
             dcommon.UserId = dcommon.UserId.DecryptParameter();
         }
         if (!string.IsNullOrEmpty(dcommon.AgentID))
         {
             dcommon.AgentID = dcommon.AgentID.DecryptParameter();
         }
         LoadDropDownList(dcommon);
         CommonDbResponse dbresp = _distributor.ManageUser(dcommon);
         if (dbresp.Code == shared.Models.ResponseCode.Success)
         {
             this.ShowPopup(0, "Save Succesfully");
             return(RedirectToAction("ViewDistributorUser", new { DistId = dcommon.AgentID.EncryptParameter() }));
         }
     }
     this.ShowPopup(1, "Save unsuccessful.Please try again!");
     return(View(dcommon));
 }