Beispiel #1
0
        public IEnumerable <ModelView.ReportChartModel> ChartNumberStandsWithReservationSeparation(IConnectionHandler connectionHandler, Guid congressId)
        {
            List <ModelView.ReportChartModel> listout = new List <ModelView.ReportChartModel>();
            List <dynamic> list = GroupBy(connectionHandler,
                                          new Expression <Func <UserBooth, object> >[] { x => x.Booth.Code },
                                          new GroupByModel <UserBooth>[]
            {
                new GroupByModel <UserBooth>()
                {
                    Expression           = x => x.BoothId,
                    AggrigateFuntionType = AggrigateFuntionType.Count
                },
            }, x => x.Booth.CongressId == congressId);
            List <dynamic> allType = new BoothBO().Select(connectionHandler, new Expression <Func <Booth, object> >[]
            {
                x => x.Code,
            }, x => x.CongressId == congressId);

            foreach (dynamic item in allType)
            {
                dynamic first = list.FirstOrDefault(x => (x.Code is string) && (string)x.Code == (string)item.Code);
                listout.Add(new ModelView.ReportChartModel()
                {
                    Count = first?.CountBoothId ?? 0,
                    Value = (string)item.Code
                });
            }
            return(listout);
        }
Beispiel #2
0
        public ModelView.ModifyResult <UserBooth> UserBoothInsert(IConnectionHandler connectionHandler, IConnectionHandler paymentConnection, IConnectionHandler formGeneratorConnection, IConnectionHandler enterpriseNodeConnection, UserBooth userBooth, List <DiscountType> discountAttaches, string callBackurl,
                                                                  FormGenerator.DataStructure.FormStructure formModel, List <BoothOfficer> boothOfficers)
        {
            Dictionary <UserBooth, string> shopUsers = new Dictionary <UserBooth, string>();
            var    modifyResult   = new ModelView.ModifyResult <UserBooth>();
            Booth  booth          = new BoothBO().Get(connectionHandler, userBooth.BoothId);
            string additionalData = new CongressDiscountTypeBO().FillTempAdditionalData(connectionHandler, booth.CongressId);

            if (booth.ValidCost.ToDecimal() > 0)
            {
                string payer =
                    userBooth.EnterpriseNode.DescriptionField;
                Temp temp = new Temp
                {
                    PayerId        = userBooth.UserId,
                    CallBackUrl    = callBackurl,
                    PayerTitle     = payer,
                    Description    = Resources.Congress.PaymentBoothReserv + " " + booth.Code,
                    Amount         = new CongressDiscountTypeBO().CalulateAmountNew(paymentConnection, (booth.ValidCost.ToDecimal()), discountAttaches),
                    CurrencyType   = (byte)booth.CurrencyType.ToEnum <Radyn.Common.Definition.Enums.CurrencyType>(),
                    AdditionalData = additionalData
                };

                if (
                    !PaymentComponenets.Instance.TempTransactionalFacade(paymentConnection)
                    .Insert(temp, discountAttaches))
                {
                    return(modifyResult);
                }

                userBooth.TempId = temp.Id;
            }
            else
            {
                if (userBooth.TempId.HasValue)
                {
                    PaymentComponenets.Instance.TempTransactionalFacade(paymentConnection).Delete(userBooth.TempId);
                }
                userBooth.TempId = null;
            }

            if (userBooth.TempId == null)
            {
                userBooth.Status = (byte)Enums.RezervState.PayConfirm;
            }
            return(UserBoothInsert(connectionHandler, formGeneratorConnection, enterpriseNodeConnection, userBooth,
                                   formModel, boothOfficers));
        }