コード例 #1
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);

            int orderID = Convert.ToInt32(Request["OrderID"]);

            Order order = OrderBO.LoadOrderData(SiteContext.Current.CurrentClient.Profile.ClientId, orderID );
            if (order == null)
                throw new HttpException((int)HttpStatusCode.NotFound , "Order not found" );

            _seller = GetSellerInfo();//OrderService.GetSellerInfo();
            _profile = SiteContext.Current.CurrentClient.Profile;
            _sum = decimal.Round( order.Total * SiteContext.Current.CurrentClient.Profile.PrepaymentPercent / 100, 2 );
            _paymentName = string.Format( "{0}", OrderTracking.GetOrderDisplayNumber( order ) );
        }
コード例 #2
0
        protected void Page_PreRender(object sender, EventArgs e)
        {
            Response.Cache.SetCacheability(HttpCacheability.NoCache);

            int orderID = Convert.ToInt32(Request["OrderID"]);

            Order order = OrderBO.LoadOrderData(SiteContext.Current.CurrentClient.Profile.ClientId, orderID);
            if (order == null)
                throw new HttpException((int)HttpStatusCode.NotFound, "Order not found");

            _seller = GetSellerInfo();//OrderService.GetSellerInfo();
            _profile = SiteContext.Current.CurrentClient.Profile;
            _sum = decimal.Round(order.Total * SiteContext.Current.CurrentClient.Profile.PrepaymentPercent / 100, 2);
            _paymentName = string.Format("{0}", OrderTracking.GetOrderDisplayNumber(order));

            SupplierName = _seller.CompanyName + "," + _seller.Inn + "," + _seller.KPP + "," + _seller.Address + "," + _seller.Phone;
            ClientName = string.Join(", ", new string[] { _profile.ClientName, _profile.BankINN, _profile.KPP, _profile.ShippingAddress, _profile.ContactPhone });
            //if (source != null && !string.IsNullOrEmpty(source.ToString()))
            {
            //	string[] str = source.ToString().Split(';');
            //	int[] ids = Array.ConvertAll(str, s => int.Parse(s));

                PrintOrderLineInfo[] printLines = null;
                using (var dc = new DCFactory<StoreDataContext>())
                {
                    printLines = (from ol in dc.DataContext.OrderLines
                                  where ol.OrderID == orderID
                                  select new PrintOrderLineInfo()
                                  {
                                      Number = 0,
                                      PartNumber = ol.PartNumber,
                                      PartName = ol.PartName,
                                      Qty = ol.Qty,
                                      Price = ol.UnitPrice,
                                      Total = ol.Total
                                  }).ToArray();

                    Array.ForEach(printLines, (x) => x.Number = Array.IndexOf(printLines, x) + 1);
                }
                rptMain.DataSource = printLines;
                rptMain.DataBind();

                SumTotal = printLines.Sum(l => l.Total);
                QtyTotal = printLines.Count();
            }
        }
コード例 #3
0
ファイル: ClientBO.cs プロジェクト: dmziryanov/ApecAuto
 public static bool CanVinRequest(ClientProfile client)
 {
     return (client.TradingVolume != Acctg.TradingVolume.Retail);
 }
コード例 #4
0
ファイル: ClientBO.cs プロジェクト: dmziryanov/ApecAuto
 public static bool CanUseClientCart( EmployeeInfo manager, ClientProfile client )
 {
     if( manager == null )
         throw new ArgumentNullException( "manager" );
     if( client == null )
         throw new ArgumentNullException( "client" );
     return CanManageClient( manager, client ) && client.IsChecked && !client.IsRestricted;
 }
コード例 #5
0
ファイル: ClientBO.cs プロジェクト: dmziryanov/ApecAuto
 public static bool CanManageClient( EmployeeInfo manager, ClientProfile client )
 {
     if( manager == null )
         throw new ArgumentNullException( "manager" );
     if( client == null )
         throw new ArgumentNullException( "client" );
     return manager.EmployeeId == client.ManagerId || manager.StoreId == client.RmsStoreId;
 }
コード例 #6
0
 private ShoppingCart CreateShoppingCart(CustomPrincipal user, ClientProfile profile)
 {
     var cart = new ShoppingCart( user.UserId, user.AcctgID, profile.ClientGroup, profile.PersonalMarkup );
     cart.ContentChanged += OnCartContentChanged;
     return cart;
 }
コード例 #7
0
ファイル: HandyClientSet.cs プロジェクト: dmziryanov/ApecAuto
        private void AddClientInternal(ClientProfile profile, bool setDefault)
        {
            var cd = new ClientData()
            {
                Profile = profile,
                Status = ClientBO.GetClientStatus(profile.ClientId),
                Cart = new ShoppingCart( _managerId, profile.ClientId, profile.ClientGroup, profile.PersonalMarkup )
            };

            ManagerBO.AddClientToHandySet(_managerId, profile.ClientId, setDefault);
            _innerClients.Add(profile.ClientId, cd);
            if (setDefault)
                _defaultClientId = profile.ClientId;
        }
コード例 #8
0
ファイル: HandyClientSet.cs プロジェクト: dmziryanov/ApecAuto
 public void AddClient(ClientProfile profile, bool setDefault)
 {
     if (profile == null)
         throw new ArgumentNullException("profile");
     AddClientInternal(profile, setDefault);
 }
コード例 #9
0
ファイル: ClientProfile.cs プロジェクト: dmziryanov/ApecAuto
        public static ClientProfile Load(string clientId)
        {
            if (string.IsNullOrEmpty(clientId))
                throw new ArgumentException("ClientId cannot be empty", "clientId");

            spSelUsersByAcctgIDResult gte = null;
            using (var dc = new DCFactory<StoreDataContext>())
            {
                gte = dc.DataContext.spSelUsersByAcctgID(clientId).FirstOrDefault();
            }

            if (gte == null)
                throw new ArgumentException("Client not find", "client");

            string ManagerData = null;
            if (AcctgRefCatalog.RmsEmployees[gte.ManagerId] != null)
                ManagerData = AcctgRefCatalog.RmsEmployees[gte.ManagerId].FullName;

            ClientProfile cProfile = new ClientProfile()
            {
                AcctgId = clientId,
                UserId = gte.UserID,
                ClientId = clientId,
                ClientName = gte.ClientName,
                Category = (ClientCategory)(byte)gte.ClientCategory,
                TradingVolume = (TradingVolume)(byte)gte.TradingVolume,
                Email = gte.Email,
                CountryID = gte.CountryID ?? 0,
                Locality = gte.Locality,
                ContactPersonPosition = gte.ContactPersonPosition,
                ContactPersonName = gte.ContactPersonName,
                ContactPersonSurname = gte.ContactPersonSurname,
                ContactPersonPhone = gte.ContactPersonPhone,
                ContactPersonExtPhone = gte.ContactPersonExtPhone,
                ContactPersonFax = gte.ContactPersonFax,
                ContactPersonEmail = gte.ContactPersonEmail,
                RmsStoreId = gte.RmsStoreID,
                DeliveryAddress = gte.DeliveryAddress,
                ScopeType = gte.ScopeType,
                HowKnow = gte.HowKnow,
                CompanyName = gte.CompanyName,
                CompanyRegistrationID = gte.CompanyRegistrationID,
                CompanyAddress = gte.CompanyAddress,
                BankName = gte.BankName,
                IBAN = gte.IBAN,
                SWIFT = gte.SWIFT,
                BankAddress = gte.BankAddress,
                DirectorSurname = gte.DirectorSurname,
                DirectorName = gte.DirectorName,
                CorrespondentBankName = gte.CorrespondentBankName,
                CorrespondentIBAN = gte.CorrespondentIBAN,
                CorrespondentSWIFT = gte.CorrespondentSWIFT,
                CorrespondentBankAddress = gte.CorrespondentBankAddress,
                ManagerId = gte.ManagerId,
                ManagerDeptId = gte.ManagerDeptId,
                ClientGroup = gte.ClientGroup == 0
                    ? ((TradingVolume)(byte)gte.TradingVolume == TradingVolume.
                    Retail ? RmsAuto.Acctg.ClientGroup.DefaultRetail : RmsAuto.Acctg.ClientGroup.DefaultWholesale)
                    : (RmsAuto.Acctg.ClientGroup)gte.ClientGroup,
                IsChecked = gte.IsChecked,
                PrepaymentPercent = gte.PrepaymentPercent,
                IsRestricted = gte.IsRestricted,
                PersonalMarkup = gte.PersonalMarkup,
                ReclamationPeriod = gte.ReclamationPeriod,
                Balance = gte.Balance,
                DelayCredit = gte.DelayCredit,
                BalanceDate = gte.BalanceDate,
                InternalFranchName = gte.InternalFranchName,
                ManagerName = ManagerData != null ? ManagerData : ""
            };

            return cProfile;
        }
コード例 #10
0
ファイル: ClientProfile.cs プロジェクト: dmziryanov/ApecAuto
        public static ClientProfile Create(
            string login,
            string password,
            string clientName,
            string email,
            TradingVolume tradingVolume,
            ClientCategory clientCategory,
            int countryID,
            string locality,
            string rmsStoreID,
            string scopeType,
            string discountCardNumber,
            string howKnow,
            string managerId,
            bool isRestricted,
            string internalFranchName,
            
            string contactPersonPosition,
            string contactPersonName,
            string contactPersonSurname,
            string contactPersonPhone,
            string contactPersonExtPhone,
            string contactPersonFax,
            string contactPersonEmail,
            string deliveryAddress,
            
            string companyName,
            string companyRegistrationID,
            string companyAddress,
            
            string bankName,
            string IBAN,
            string SWIFT,
            string bankAddress,
            
            string directorName,
            string directorSurname,
            
            string correspondentBankName,
            string correspondentIBAN,
            string correspondentSWIFT,
            string correspondentBankAddress,
            int RegisterAs
            )
        {
            if ( string.IsNullOrEmpty( clientName ) )
                throw new ArgumentException( "Client name cannot be empty", "clientName" );
            //    if ( string.IsNullOrEmpty( contactPersonPhone ) )
              //          throw new ArgumentException( "Main phone number must be specified" );

            var profile = new ClientProfile()
            {
                ClientId = "",
                ClientName = clientName,
                Email = email,
                TradingVolume = tradingVolume,
                Category = clientCategory,
                CountryID = countryID,
                Locality = locality,
                RmsStoreId = rmsStoreID,
                ScopeType = scopeType,
                DiscountCardNumber = discountCardNumber,
                HowKnow = howKnow,
                IsRestricted = isRestricted,
                PrepaymentPercent = 0M,
                PersonalMarkup = 0M,
                Balance = 0M,
                DelayCredit = 0M,
                InternalFranchName = internalFranchName,

                ContactPersonPosition = contactPersonPosition,
                ContactPersonName = contactPersonName,
                ContactPersonSurname = contactPersonSurname,
                ContactPersonPhone = contactPersonPhone,
                ContactPersonExtPhone = contactPersonExtPhone,
                ContactPersonFax = contactPersonFax,
                ContactPersonEmail = contactPersonEmail,
                DeliveryAddress = deliveryAddress,

                BankName = bankName,
                IBAN = IBAN,
                SWIFT = SWIFT,
                BankAddress = bankAddress,

                DirectorName = directorName,
                DirectorSurname = directorSurname,

                CorrespondentBankName = correspondentBankName,
                CorrespondentIBAN = correspondentIBAN,
                CorrespondentSWIFT = correspondentSWIFT,
                CorrespondentBankAddress = correspondentBankAddress,
                RegisterAs = RegisterAs
            };

            RmsAuto.Acctg.ClientGroup clientGroup = tradingVolume == TradingVolume.Retail ? RmsAuto.Acctg.ClientGroup.DefaultRetail : RmsAuto.Acctg.ClientGroup.DefaultWholesale;

            using (var DC = new DCFactory<StoreDataContext>())
            {

                var rezIns = DC.DataContext.spInsUsers( login, password, clientName, email, (byte)tradingVolume, (byte)clientCategory,
                countryID, /*regionID,*/ locality, /*contactLastName, contactFirstName, contactMiddleName,
                contactPhone, contactExtPhone,*/ scopeType, howKnow, managerId, "", false, isRestricted,
                (int)clientGroup, 100M, 0M, /*contactFax, scheduleOfice, scheduleStock, shippingAddress,*/
                rmsStoreID, /*discountCardNumber, contactPosition, legalName, IPName, iNN, oGRNIP, kPP, oGRN,
                nDSAggent, oficialAddress, realAddress, account, bankBIC, bankINN, directorPosition,
                directorLastName, directorFirstName, directorMiddleName, balanceManPosition,
                balanceManLastName, balanceManFirstName, balanceManMiddleName,
                balanceManPhone, balanceManEmail,*/ internalFranchName,
                contactPersonPosition, contactPersonName, contactPersonSurname, contactPersonPhone, contactPersonExtPhone,
                contactPersonFax, contactPersonEmail, deliveryAddress, companyName, companyRegistrationID, companyAddress,
                bankName, IBAN, SWIFT, bankAddress, directorName, directorSurname, correspondentBankName,
                correspondentIBAN, correspondentSWIFT, correspondentBankAddress, RegisterAs);
                profile.UserId = rezIns.ToList().FirstOrDefault().UserID.Value;
            }

            return profile;
        }
コード例 #11
0
ファイル: FranchService.cs プロジェクト: dmziryanov/ApecAuto
 public FranchService()
 {
     acctgId = ServiceAccountDac.GetClientIDByWcfServiceAccount(CurrentIdentityName);
     Rights =  ServiceAccountDac.getRightsByClientID(acctgId);
     profile = ClientProfile.Load( acctgId );
 }