コード例 #1
0
        public static bool ClientReport(string file, ClientList Clients, ShipmentList Shipments, PurchaseHistoryList PurHisList)
        {
            List <string> Names  = new List <string>();
            List <int>    Counts = new List <int>();
            List <int>    Costs  = new List <int>();

            for (int i = 0; i < Clients.Count; i++)
            {
                Names.Add(Clients[i].ClientLastName + " " + Clients[i].ClientFirstName);
                Counts.Add(0);
                Costs.Add(0);
                foreach (PurchaseHistory PH in PurHisList.ListOfHistory)
                {
                    if (PH.ClientID == Clients[i].ClientID)
                    {
                        Counts[i] += PH.Count;
                        foreach (Shipment SH in Shipments.Shipments)
                        {
                            if (SH.ShipmentID == PH.ShipmentID)
                            {
                                Costs[i] += SH.Price * PH.Count;
                                break;
                            }
                        }
                    }
                }
            }

            PDF.CreateClientReport(file, Names, Counts, Costs);
            return(true);
        }
コード例 #2
0
        public static bool ShipmentReport(string file, ShipmentList Shipments, PurchaseHistoryList PurHisList)
        {
            List <string> Titles = new List <string>();
            List <int>    Prices = new List <int>();
            List <int>    Counts = new List <int>();
            List <int>    Costs  = new List <int>();

            for (int i = 0; i < Shipments.Count; i++)
            {
                Titles.Add(Shipments[i].ShipmentName);
                Prices.Add(Shipments[i].Price);
                Counts.Add(0);
                foreach (PurchaseHistory PH in PurHisList.ListOfHistory)
                {
                    if (Shipments[i].ShipmentID == PH.ShipmentID)
                    {
                        Counts[i] += PH.Count;
                    }
                }
                Costs.Add(Shipments[i].Price * Counts[i]);
            }

            PDF.CreateShipmentReport(file, Titles, Prices, Counts, Costs);
            return(true);
        }
コード例 #3
0
 public BackupClass(ClientList Clients, ProviderList Providers, ShipmentList Shipments, ProviderShipmentList ProviderShipment, PurchaseHistoryList PurchaseHistory)
 {
     this.Clients          = Clients;
     this.Providers        = Providers;
     this.Shipments        = Shipments;
     this.ProviderShipment = ProviderShipment;
     this.PurchaseHistory  = PurchaseHistory;
 }
コード例 #4
0
 public static void OutputIntoSQL(SQLiteConnection DataFile, ShipmentList ShipList, ClientList CList, ProviderList ProvList, ProviderShipmentList ProvShipList, PurchaseHistoryList PurHisList)
 {
     ShipmentsIntoSQL(DataFile, ShipList);
     ClientsIntoSQL(DataFile, CList);
     ProvidersIntoSQL(DataFile, ProvList);
     ProviderShipmentsIntoSQL(DataFile, ProvShipList);
     PurchaseHistoryIntoSQL(DataFile, PurHisList);
 }
コード例 #5
0
        public static void OutputIntoXML(string file, ShipmentList ShipList, ClientList ClList, ProviderList ProvList, ProviderShipmentList ProvShipList, PurchaseHistoryList PurHisList)
        {
            BackupClass.BackupClass BC      = new BackupClass.BackupClass(ClList, ProvList, ShipList, ProvShipList, PurHisList);
            StreamWriter            NewFile = new StreamWriter(file);
            XmlSerializer           XMLSer  = new XmlSerializer(typeof(BackupClass.BackupClass));

            XMLSer.Serialize(NewFile, BC);
            NewFile.Close();
        }
コード例 #6
0
        private static void ShipmentsIntoSQL(SQLiteConnection DataFile, ShipmentList ShipList)
        {
            SQLiteCommand insert = new SQLiteCommand(DataFile);

            for (int i = 0; i < ShipList.Count; i++)
            {
                insert.CommandText = "insert into Shipment values(" + ShipList[i].ShipmentID.ToString() + ", '" + ShipList[i].ShipmentName + "', " + ShipList[i].Price.ToString() + ", '" + ShipList[i].PhotoLink + "')";
                insert.ExecuteNonQuery();
            }
        }
コード例 #7
0
        /// <summary>
        /// Binds the shipments grid.
        /// </summary>
        private void BindShipmentsGrid()
        {
            object dataSource = GetShipmentsDataSource();

            if (dataSource != null)
            {
                ShipmentList.DataSource = dataSource;
                ShipmentList.DataBind();
            }
        }
コード例 #8
0
        public void TestList()
        {
            ShipmentList shipmentList = Shipment.List();

            Assert.AreNotEqual(0, shipmentList.shipments.Count);

            ShipmentList nextShipmentList = shipmentList.Next();

            Assert.AreNotEqual(shipmentList.shipments[0].id, nextShipmentList.shipments[0].id);
        }
コード例 #9
0
        public IEnumerable <ShipmentItem> GetShipmentItems(int shipmentListId)
        {
            ShipmentList shipmentList = shipmentRespository.ShipmentList.FirstOrDefault(s => s.Id == shipmentListId);

            //返回空的出货项列表
            if (shipmentList == null)
            {
                return(new List <ShipmentItem>());
            }
            return(shipmentList.ShipmentItems.AsEnumerable());
        }
コード例 #10
0
        public async Task <ActionResult> ListSubmit(ShipmentList model)
        {
            //switch (this.GetAction())
            //{
            //}

            this.SetPagingState(ModelFactory.CreatePagingStateFilter(model.Filter));

            model = await GetShipmentListAsync();

            return(View("List", model));
        }
コード例 #11
0
        public void TestList()
        {
            ShipmentList shipmentList = Shipment.List(null, new Dictionary <string, object>()
            {
                { "page_size", 1 }
            });

            Assert.AreNotEqual(0, shipmentList.shipments.Count);

            ShipmentList nextShipmentList = shipmentList.Next(null);

            Assert.AreNotEqual(shipmentList.shipments[0].id, nextShipmentList.shipments[0].id);
        }
コード例 #12
0
        private void BindShipmentList(Order order)
        {
            List <OrderShipment> firstTwoShipments = new List <OrderShipment>();

            firstTwoShipments.Add(order.Shipments[0]);
            if (order.Shipments.Count > 1)
            {
                firstTwoShipments.Add(order.Shipments[1]);
            }
            ShipmentList.DataSource = firstTwoShipments;
            ShipmentList.DataBind();
            MoreShipmentsLink.Visible     = order.Shipments.Count > 2;
            MoreShipmentsLink.NavigateUrl = GetShipmentDetailsUrl(order);
        }
コード例 #13
0
        private void OFD_FileOk(object sender, CancelEventArgs e)
        {
            string file = OFD.FileName;

            BackupClass.BackupClass Backup = InputList.InputList.Backup(file);

            Shipments          = Backup.Shipments;
            Clients            = Backup.Clients;
            Providers          = Backup.Providers;
            ProvidersShipments = Backup.ProviderShipment;
            PurchaseHistoryL   = Backup.PurchaseHistory;

            MessageBox.Show("Списки успешно перезаписаны");
        }
コード例 #14
0
        public static ShipmentList Shipment(SQLiteConnection DataFile)
        {
            ShipmentList  ShipList = new ShipmentList();
            SQLiteCommand input    = new SQLiteCommand(DataFile);

            input.CommandText = "select * from Shipment";
            SQLiteDataReader sdr = input.ExecuteReader();

            while (sdr.Read())
            {
                ShipList.Add(Convert.ToInt32(sdr.GetValue(0)), sdr.GetValue(1).ToString(), Convert.ToInt32(sdr.GetValue(2)), sdr.GetValue(3).ToString());
            }
            return(ShipList);
        }
コード例 #15
0
        public bool SaveShipmentList(ShipmentList shipmentList)
        {
            ShipmentList s = context.ShipmentList.Find(shipmentList.Id);

            if (s == null)
            {
                context.ShipmentList.Add(shipmentList);
            }
            else
            {
                context.Entry(shipmentList).CurrentValues.SetValues(shipmentList);
            }
            context.SaveChanges();
            return(true);
        }
コード例 #16
0
        public JsonResult Shipment(List <ShipmentItem> shipmentItemList, int dealerId)
        {
            decimal      TotalPrice   = shipmentItemList.Sum(p => p.Quantity * p.SellPrice);
            ShipmentList shipmentList = new ShipmentList
            {
                DealersId     = dealerId,
                ShipmentTime  = DateTime.Now,
                ShipmentItems = shipmentItemList,
                TotalPrice    = TotalPrice
            };
            bool result = shipmentService.SaveShipmentList(shipmentList);

            new Thread(delegate()
            {
                WSController.SendWarnings(warningService);
            }).Start();
            return(Json(result));
        }
コード例 #17
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            String[] _mns   = { "Bic", "Promex", "TPromo", "Azure", "Xerox" };
            String[] _dates = { "7/11/1878", "10/01/1912", "1/5/2001", "8/16/1954", "4/30/1989" };
            //List<Manufacturer> manList = new List<Manufacturer>();
            List <Manufacturer> manList  = ManufacturerList.GenerateDefault();
            List <Shipment>     shipList = ShipmentList.GenerateDefault();

            foreach (var shipTransaction in shipList)
            {
                shipTransaction._display(1);
            }


            // 1 окно - Все производители
            foreach (Manufacturer manufacturer in manList)
            {
                manufacturer._display();
            }

            Console.Write("\n\n");

            // 2 окно - Все производители, рейтинг которых ОТ
            foreach (Manufacturer manufacturer in manList)
            {
                if (manufacturer.TrustRating > 3)
                {
                    manufacturer._display();
                }
            }

            Console.Write("\n\n");

            // 3 окно - Все НЕПУСТЫЕ производители
            foreach (Manufacturer manufacturer in manList)
            {
                if (!manufacturer.IsEmpty())
                {
                    manufacturer._display();
                }
            }
        }
コード例 #18
0
        private void StartScreen_Load(object sender, EventArgs e)
        {
            if (!File.Exists("mySQLiteLab.sqlite"))
            {
                SQLiteConnection.CreateFile("mySQLiteLab.sqlite");
            }
            DataFile.Open();

            CreateTable.CreateAll(DataFile);

            Shipments          = InputList.InputList.Shipment(DataFile);
            Providers          = InputList.InputList.Provider(DataFile);
            Clients            = InputList.InputList.Client(DataFile);
            ProvidersShipments = InputList.InputList.ProviderShipment(DataFile);
            PurchaseHistoryL   = InputList.InputList.PurchaseHistory(DataFile);

            MaxShipmentID        = SearchMaxID.SearchMaxID.FindMaxID(DataFile, "prod");
            MaxClientID          = SearchMaxID.SearchMaxID.FindMaxID(DataFile, "cl");
            MaxProviderID        = SearchMaxID.SearchMaxID.FindMaxID(DataFile, "prov");
            MaxPurchaseHistoryID = SearchMaxID.SearchMaxID.FindMaxID(DataFile, "ph");
        }
コード例 #19
0
        protected void SubmitButton_Click(object sender, System.EventArgs e)
        {
            ShippingEstimatePopup.Show();
            if (Page.IsValid && PostalCodeIsValid())
            {
                // ENSURE THE BASKET IS PACKAGED
                IBasketService preCheckoutService = AbleContext.Resolve <IBasketService>();
                preCheckoutService.Package(_Basket);
                _ShipmentCount = _Basket.Shipments.Count;

                // BUILD THE ADDRESS OBJECT TO USE FOR THE RATE ESTIMATE
                _EstimateAddress             = new Address();
                _EstimateAddress.CountryCode = Country.SelectedValue;
                if (phProvinceField.Visible)
                {
                    _EstimateAddress.Province = Province.SelectedValue;
                }
                if (phCityField.Visible)
                {
                    _EstimateAddress.City = StringHelper.StripHtml(City.Text);
                }
                if (phPostalCodeField.Visible)
                {
                    string safePostalCode = StringHelper.StripHtml(PostalCode.Text);
                    safePostalCode              = Regex.Replace(safePostalCode.ToUpperInvariant(), "[^-A-Z0-9]", string.Empty);
                    PostalCode.Text             = safePostalCode;
                    _EstimateAddress.PostalCode = safePostalCode;
                }
                _EstimateAddress.Residence = _User.IsAnonymous ? !this.AssumeCommercialRates : _BillingAddress.Residence;

                // PREPARE AND DISPLAY THE RATE QUOTE INFORMATION
                phResultPanel.Visible            = true;
                MultipleShipmentsMessage.Visible = this.MultiShipmentDisplay;
                ShipmentList.DataSource          = _Basket.Shipments;
                ShipmentList.DataBind();
            }
        }
コード例 #20
0
        protected void Page_Init(object sender, EventArgs e)
        {
            // LOCATE THE USER THAT THE ORDER IS BEING PLACED FOR
            _UserId = AlwaysConvert.ToInt(Request.QueryString["UID"]);
            _User   = UserDataSource.Load(_UserId);
            if (_User == null)
            {
                Response.Redirect("CreateOrder1.aspx");
            }
            _Basket = _User.Basket;
            MiniBasket1.BasketId = _Basket.Id;
            if (!Page.IsPostBack)
            {
                IBasketService preCheckoutService = AbleContext.Resolve <IBasketService>();
                preCheckoutService.Recalculate(_Basket);
            }

            // INITIALIZE THE CAPTION
            string userName = _User.IsAnonymous ? "Unregistered User" : _User.UserName;

            Caption.Text = string.Format(Caption.Text, userName);

            // SHOW BILLING ADDRESS
            BillToAddress.Text             = _User.PrimaryAddress.ToString(true);
            EditAddressesLink.NavigateUrl += "?UID=" + _UserId;

            // SHOW REGISTRATION PANEL IF USER IS ANONYMOUS
            if (_User.IsAnonymous)
            {
                RegisterPanel.Visible = true;
                string       billToEmail   = _User.PrimaryAddress.Email;
                IList <User> matchingUsers = UserDataSource.LoadForEmail(billToEmail, false);
                bool         userExists    = (matchingUsers.Count > 0);
                if (userExists)
                {
                    _ExistingUser        = matchingUsers[0];
                    AccountUserName.Text = _ExistingUser.UserName;
                    AccountEmail.Text    = _ExistingUser.Email;
                }
                else
                {
                    AccountUserName.Text = billToEmail;
                    AccountEmail.Text    = billToEmail;
                }
                RegisteredUserHelpText.Visible   = userExists;
                UnregisteredUserHelpText.Visible = !userExists;
                LinkAccountLabel.Visible         = userExists;
                CreateAccountLabel.Visible       = !userExists;
                trAccountPassword.Visible        = !userExists;
                trForceExpiration.Visible        = !userExists;
            }

            // SHOW SHIPPING METHODS IF NECESSARY
            ShippingMethodPanel.Visible = _Basket.Items.HasShippableProducts();
            if (ShippingMethodPanel.Visible)
            {
                tdShipTo.Visible = true;
                Address shipAddress = this.ShippingAddress;
                if (shipAddress != null)
                {
                    ShipToAddress.Text = shipAddress.ToString(true);
                }
                if (!Page.IsPostBack)
                {
                    // ONLY BIND SHIPMENT LIST ON FIRST VISIT
                    ShipmentList.DataSource = _Basket.Shipments;
                    ShipmentList.DataBind();
                }
            }
        }
コード例 #21
0
 public static GrpcShipmentList Present(ShipmentList list) =>
 new ShipmentListPresenter(list).GetPresented();
コード例 #22
0
 public ShipmentListPresenter(ShipmentList list)
 {
     List = list;
 }
コード例 #23
0
 public bool SaveShipmentList(ShipmentList shipmentList)
 {
     return(shipmentRespository.SaveShipmentList(shipmentList));
 }
コード例 #24
0
        public static bool PurchaseHistoryReport(string file, ShipmentList Shipments, PurchaseHistoryList PurHisList)
        {
            List <string> Dates  = new List <string>();
            List <int>    Counts = new List <int>();
            List <int>    Costs  = new List <int>();

            for (int i = 0; i < PurHisList.Count; i++)
            {
                if (Dates.Count == 0)
                {
                    Dates.Add(FormatDate.GetDate(PurHisList[i].Day, PurHisList[i].Month, PurHisList[i].Year));
                    Counts.Add(PurHisList[i].Count);
                    foreach (Shipment SH in Shipments.Shipments)
                    {
                        if (SH.ShipmentID == PurHisList[i].ShipmentID)
                        {
                            Costs.Add(PurHisList[i].Count * SH.Price);
                            break;
                        }
                    }
                }
                else
                {
                    int numberOfDate = -1;
                    for (int j = 0; j < Dates.Count; j++)
                    {
                        if (FormatDate.GetDate(PurHisList[i].Day, PurHisList[i].Month, PurHisList[i].Year) == Dates[j])
                        {
                            numberOfDate = j;
                            break;
                        }
                    }
                    if (numberOfDate != -1)
                    {
                        Counts[numberOfDate] += PurHisList[i].Count;
                        foreach (Shipment SH in Shipments.Shipments)
                        {
                            if (SH.ShipmentID == PurHisList[i].ShipmentID)
                            {
                                Costs[numberOfDate] += PurHisList[i].Count * SH.Price;
                                break;
                            }
                        }
                    }
                    else
                    {
                        Dates.Add(FormatDate.GetDate(PurHisList[i].Day, PurHisList[i].Month, PurHisList[i].Year));
                        Counts.Add(PurHisList[i].Count);
                        foreach (Shipment SH in Shipments.Shipments)
                        {
                            if (SH.ShipmentID == PurHisList[i].ShipmentID)
                            {
                                Costs.Add(PurHisList[i].Count * SH.Price);
                                break;
                            }
                        }
                    }
                }
            }

            PDF.CreatePurchaseHistoryReport(file, Dates, Counts, Costs);
            return(true);
        }
コード例 #25
0
 /// <summary>
 /// Handles the OnNeedRebind event of the ShipmentList control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="oArgs">The <see cref="System.EventArgs"/> instance containing the event data.</param>
 public void ShipmentList_OnNeedRebind(object sender, System.EventArgs oArgs)
 {
     ShipmentList.DataBind();
 }