public ActionResult GetBSOInvoice(BSOSaveDataModel model) { List <ReferenceUniversalItem> DP = referenceBusinessLogic.GetUniversalList(Constants.DeliveryPointRef); string deliveryPointName = DP.Where(m => m.Id == model.DeliveryPointId).FirstOrDefault().Name; long? deliveryPointHeadId = DP.Where(m => m.Id == model.DeliveryPointId).FirstOrDefault().DeliveryPointHeadId; List <SelectListItem> Users = ReferencesProvider.GetUsers(); string fio; if (deliveryPointHeadId != null) { fio = Users.Where(a => a.Value == deliveryPointHeadId.ToString()).Select(b => b.Text).FirstOrDefault(); } else { fio = CurrentUser.Fullname; } List <string> listBsoNumber = new List <string>(); listBsoNumber.Add(model.TemporaryPolicyNumber); BSOInvoice printedForm = new BSOInvoice(listBsoNumber, fio, deliveryPointName); return(File(printedForm.GetExcel(), System.Net.Mime.MediaTypeNames.Application.Octet, string.Format("Накладная БСО (ВС).xls"))); }
public BaseCheckPretensionModel() { ListClientPretensionModel = new List <ClientPretensionModel>(); Search = new SearchCheckPretensionModel(); listUsers = ReferencesProvider.GetUsers(null, true); PageSize = 100; }
public BaseCheckFileHistoryModel() { ListFundFileHistoryModel = new List <FundFileHistoryModel>(); Search = new SearchCheckFileHistoryModel(); listStatuses = ReferencesProvider.GetReferences(Constants.FundFileHistoryStatusRef, null, true); listUsers = ReferencesProvider.GetUsers(null, true); PageSize = 100; }
public ClientVisitListModel() { this.SearchCriteriaModel = new ClientVisitSearchCriteriaModel(); DeliveryCenters = ReferencesProvider.GetReferences(Constants.DeliveryCenterRef, null, false); DeliveryPoints = ReferencesProvider.GetReferences(Constants.DeliveryPointRef, null, false); ClientVisitStatuses = ReferencesProvider.GetReferences(Constants.ClientVisitStatusRef, null, false); Scenaries = ReferencesProvider.GetReferences(Constants.ScenarioRef, null, false); UserS = ReferencesProvider.GetUsers(null, true); }
public FundRequestIndexModel() { ClientVisits = new List <ClientVisitFundInfoModel>(); FundResponses = new List <FundResponseModel>(); DeliveryCenters = ReferencesProvider.GetReferences(Constants.DeliveryCenterForOperatorRef, null, true); DeliveryPoints = ReferencesProvider.GetReferences(Constants.DeliveryPointRef, null, false); ClientVisitStatuses = ReferencesProvider.GetReferences(Constants.ClientVisitStatusRef, null, true); SearchCriteriaModel = new ClientVisitSearchCriteriaModel(); ScenarioList = ReferencesProvider.GetReferences(Constants.ScenarioRef, null, true); UserS = ReferencesProvider.GetUsers(null, true); }
public ActionResult GetBSOInvoiceS(BSOListModel model) { List <ReferenceUniversalItem> DP = referenceBusinessLogic.GetUniversalList(Constants.DeliveryPointRef); string deliveryPointName = DP.Where(m => m.Id == model.SearchCriteriaModel.NewDeliveryPointId).FirstOrDefault().Name; long? deliveryPointHeadId = DP.Where(m => m.Id == model.SearchCriteriaModel.NewDeliveryPointId).FirstOrDefault().DeliveryPointHeadId; List <SelectListItem> Users = ReferencesProvider.GetUsers(); string fio; if (deliveryPointHeadId != null) { fio = Users.Where(a => a.Value == deliveryPointHeadId.ToString()).Select(b => b.Text).FirstOrDefault(); } else { fio = CurrentUser.Fullname; } model.SearchCriteriaModel.StatusId = model.SearchCriteriaModel.CurrentStatusId; model.SearchCriteriaModel.DeliveryPointIds = new List <long>(); model.SearchCriteriaModel.DeliveryPointIds.Add(model.SearchCriteriaModel.NewDeliveryPointId.Value); BSOSearchCriteria criteria = model.SearchCriteriaModel.GetBSOSearchCriteria(); List <BSOInfo> bsos = bsoBusinessLogic.BSO_Find( criteria, new List <SortCriteria <BSOSortField> >(), new PageRequest() { PageNumber = 1, PageSize = int.MaxValue }).Data; List <string> listBsoNumber = new List <string>(); foreach (var elem in bsos) { listBsoNumber.Add(elem.TemporaryPolicyNumber); } BSOInvoice printedForm = new BSOInvoice(listBsoNumber, fio, deliveryPointName); return(File(printedForm.GetExcel(), System.Net.Mime.MediaTypeNames.Application.Octet, string.Format("Накладная БСО (ВС).xls"))); }