public ActionResult Create(ClientVisitSaveDataModel model) { model.Comment = model.Comment + Environment.NewLine + " Место выдачи: " + model.DeliveryCenters.Where(a => a.Value == model.DeliveryCenterId.ToString()).Select(b => b.Text).FirstOrDefault() + Environment.NewLine + " Категория клиента: " + model.UralsibClientCategories.Where(a => a.Value == model.ClientCategoryId.ToString()).Select(b => b.Text).FirstOrDefault() + Environment.NewLine; model.Registrator = new UserModel(userBusinessLogic.User_GetByLogin(this.HttpContext.User.Identity.Name)); model.Validate(new ModelValidationContext() { currenUser = CurrentUser }); model.IsSuccessfullySaved = model.IsValid(); if (model.IsValid()) { ClientVisitSaveResult result = clientBusinessLogic.ClientVisit_Save(CurrentUser, model.GetClientVisitSaveData()); model.VisitGroupId = result.VisitGroupId; model.VisitId = result.ClientVisitID; model.ClientId = result.ClientID; if (!string.IsNullOrEmpty(model.TemporaryPolicyNumber)) { BSOSaveDataModel bsoSaveDataModel = new BSOSaveDataModel(bsoBusinessLogic.BSO_GetByNumber(model.TemporaryPolicyNumber)); bsoBusinessLogic.BSO_Save((bsoSaveDataModel.UpdateBSOIssuedClient(model, CurrentUser)).GetBSOSaveData()); } //return RedirectToAction("Details", "Client", new { id = result.ClientID }); model.SetFlagPrintReport(); return(View(model)); } else { return(View(model)); } }
public ActionResult GoToBSOHistory(string temporaryPolicyNumber) { BSO bso = bsoBusinessLogic.BSO_GetByNumber(temporaryPolicyNumber); if (bso != null) { return(RedirectToAction("BSOHistory", "BSO", new { id = bso.Id })); } else { return(RedirectToAction("Index")); } }