public ActionResult Create(MasterBranchDealviewModel model) { ValidateMasterDistributorDealviewModel(model); TravelSession obj = (TravelSession)Session["TravelPortalSessionInfo"]; string DistributorCode = mDealProvider.GetDistributorCodeByDistributorId(obj.LoginTypeId); try { if (!ModelState.IsValid) { model.CreatedBy = obj.AppUserId; model.BranchOfficeId = obj.LoginTypeId; model.DistributorCode = DistributorCode; if (model.CopyDeal == true) { mDealProvider.CopyDealFromOneToAnotherForMobileDistributor(model.DealName, model.DealMasterId, 3, model.BranchOfficeId, model.CreatedBy); } else { mDealProvider.AddDistributorDealMaster(model, 3); } return(RedirectToAction("Index", "DistributorsDealSetup")); } else { return(RedirectToAction("Index", "DistributorsDealSetup")); } } catch { return(RedirectToAction("Index", "DistributorsDealSetup")); } }