Ejemplo n.º 1
0
        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")));
        }
Ejemplo n.º 2
0
 public BaseCheckPretensionModel()
 {
     ListClientPretensionModel = new List <ClientPretensionModel>();
     Search    = new SearchCheckPretensionModel();
     listUsers = ReferencesProvider.GetUsers(null, true);
     PageSize  = 100;
 }
Ejemplo n.º 3
0
 public BaseCheckFileHistoryModel()
 {
     ListFundFileHistoryModel = new List <FundFileHistoryModel>();
     Search       = new SearchCheckFileHistoryModel();
     listStatuses = ReferencesProvider.GetReferences(Constants.FundFileHistoryStatusRef, null, true);
     listUsers    = ReferencesProvider.GetUsers(null, true);
     PageSize     = 100;
 }
Ejemplo n.º 4
0
 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);
 }
Ejemplo n.º 5
0
 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);
 }
Ejemplo n.º 6
0
        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")));
        }