Пример #1
0
        public void AddOrder()
        {
            ArrayList cartList = (ArrayList)Session["cartList"];

            if (cartList != null)
            {
                ShipmentModels sm        = new ShipmentModels();
                CustomerModel  cm        = new CustomerModel();
                customer       c         = cm.GetCustomer(Request.Cookies["username"].Value.ToString());
                shipment       s         = new shipment();
                String         billAddr  = c.customer_address;
                String         shipAddr  = c.customer_address;
                int            delCost   = 0;
                int            discount  = 0;
                int            calcTotal = (int)Calc_Total();
                int            finalCost = delCost + calcTotal + discount;
                String         email     = c.customer_email;

                s.time_created                  = DateTime.UtcNow;
                s.billing_address               = billAddr;
                s.shipping_address              = shipAddr;
                s.delivery_cost                 = delCost;
                s.discount                      = 0;
                s.final_price                   = finalCost;
                s.customer_customer_email       = email;
                s.payment_type_payment_type_id  = 1;
                s.shipment_type_sipment_type_id = 1;
                statusLabel.Text                = sm.CreateShipment(s) + "\n Check your orders in your profile.";
                Session["cartList"]             = null;
            }
            else
            {
                statusLabel.Text = "ERROR: DID NOT ADD ORDER";
            }
        }
Пример #2
0
        public ActionResult shipment([FromBody] shipment model)
        {
            string fvShipmentId = model.carrier.fvCarrierId + "|" + model.customer.fvCustomerId + "|" + model.shipmentIdentification.shipmentId;

            Response.Headers.Add("X-WSS-fvShipmentId", fvShipmentId);
            return(Ok());
        }
Пример #3
0
        public ActionResult shipmentevent([FromBody] shipment model)
        {
            Random random = new Random();
            int    num    = random.Next(2);

            return(StatusCode(200));
        }
Пример #4
0
        public int InsertShipment(shipment shipment)
        {
            Table <shipment> shipments = data.GetTable <shipment>();

            shipments.InsertOnSubmit(shipment);
            data.SubmitChanges();
            return(shipment.id_shipment);
        }
Пример #5
0
        public ActionResult updateshipment([FromBody] shipment model)
        {
            Random random       = new Random();
            int    num          = random.Next(2);
            string fvShipmentId = model.carrier.fvCarrierId + "|" + model.customer.fvCustomerId + "|" + model.shipmentIdentification.shipmentId;

            Response.Headers.Add("X-WSS-fvShipmentId", fvShipmentId);
            return(Ok());
        }
Пример #6
0
        public decimal totalOrdersValue()
        {
            decimal         totalSum = 0;
            ShipmentModels  s        = new ShipmentModels();
            List <shipment> shipList = s.GetAllShipments();

            for (int i = 0; i < shipList.Count; i++)
            {
                shipment ship = shipList[i];
                totalSum = totalSum + (decimal)ship.final_price;
            }
            return(totalSum);
        }
Пример #7
0
        private void dataGridViewX1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            shipment s = new shipment();

            s.id_shipment   = (int)dataGridViewX1.CurrentRow.Cells[0].Value;
            s.posion        = dataGridViewX1.CurrentRow.Cells[9].Value.ToString();
            s.unit          = dataGridViewX1.CurrentRow.Cells[8].Value.ToString();
            s.number        = (int)dataGridViewX1.CurrentRow.Cells[7].Value;
            s.ex_unit_price = (double)dataGridViewX1.CurrentRow.Cells[4].Value;
            s.man_date      = (DateTime)dataGridViewX1.CurrentRow.Cells[5].Value;
            s.exp_date      = (DateTime)dataGridViewX1.CurrentRow.Cells[6].Value;
            s.id_item       = (int)dataGridViewX1.CurrentRow.Cells[1].Value;
            ExportModule.I_Sender(s);
        }
Пример #8
0
 private void AddItem(shipment s)
 {
     if (Check(s.id_shipment))
     {
         int i = dataGridViewX1.Rows.Add();
         dataGridViewX1.Rows[i].Cells[0].Value = s.id_shipment;
         dataGridViewX1.Rows[i].Cells[1].Value = item.GetNameItem(s.id_item.Value);
         dataGridViewX1.Rows[i].Cells[2].Value = s.man_date;
         dataGridViewX1.Rows[i].Cells[3].Value = s.exp_date;
         dataGridViewX1.Rows[i].Cells[4].Value = s.number;
         dataGridViewX1.Rows[i].Cells[5].Value = 0;
         dataGridViewX1.Rows[i].Cells[6].Value = s.ex_unit_price;
         dataGridViewX1.Rows[i].Cells[7].Value = s.unit;
         dataGridViewX1.Rows[i].Cells[8].Value = s.posion;
     }
 }
Пример #9
0
        private void buttonX2_Click(object sender, EventArgs e)
        {
            im_ticket im_ticket = new im_ticket();

            im_ticket.date_im       = (new DateTime(dateTimeInput1.Value.Year, dateTimeInput1.Value.Month, dateTimeInput1.Value.Day));
            im_ticket.id_accountant = (int)textBoxUITypeEditor4.Tag;
            im_ticket.id_write      = (int)textBoxUITypeEditor2.Tag;
            im_ticket.id_shipper    = (int)textBoxUITypeEditor1.Tag;
            im_ticket.id_storager   = (int)textBoxUITypeEditor3.Tag;
            int             idTicket = im.insertImportTicket(im_ticket);
            bool            d        = true;
            List <shipment> l        = new List <shipment>();

            foreach (DataGridViewRow row in dataGridViewX1.Rows)
            {
                shipment shipment = new shipment();
                try
                {
                    shipment.id_im_ticket  = idTicket;
                    shipment.id_item       = (int)row.Cells[0].Value;
                    shipment.number        = Convert.ToInt32(row.Cells[2].Value);
                    shipment.unit          = row.Cells[3].Value.ToString();
                    shipment.ex_unit_price = Convert.ToDouble(row.Cells[5].Value);
                    shipment.im_unit_price = Convert.ToDouble(row.Cells[4].Value);
                    shipment.man_date      = Convert.ToDateTime(row.Cells[6].Value);
                    shipment.exp_date      = Convert.ToDateTime(row.Cells[7].Value);
                    shipment.posion        = row.Cells[8].Value.ToString();
                    l.Add(shipment);
                }
                catch {
                    MessageBox.Show("Có gì đó không ổn!");
                    im.deleteImportTicket(im_ticket);
                    d = false;
                    break;
                }
            }
            if (d)
            {
                MessageBox.Show("Thành công");
                shipments.InsertShipment((IEnumerable <shipment>)l);
                DevComponents.DotNetBar.TabControl ff = (DevComponents.DotNetBar.TabControl) this.Parent.Parent;
                ff.Tabs.RemoveAt(ff.SelectedTabIndex);
            }
        }
 var(shipment, shipmentError) = await _easyPostService.GetShipmentAsync(shipmentId);
Пример #11
0
    public List <Ability> buildDeck()
    {
        Initiative aggressiveNegotiation  = new aggressiveNegotiation();
        Initiative aggressiveNegotiation2 = new aggressiveNegotiation();
        Initiative archer               = new archer();
        Initiative archer2              = new archer();
        Initiative beanstalkRoyalties   = new beanstalkRoyalties();
        Initiative beanstalkRoyalties2  = new beanstalkRoyalties();
        Initiative beanstalkRoyalties3  = new beanstalkRoyalties();
        Initiative enigma               = new enigma();
        Initiative enigma2              = new enigma();
        Initiative enigma3              = new enigma();
        Initiative hadriansWall         = new hadriansWall();
        Initiative hadriansWall2        = new hadriansWall();
        Initiative hedgeFund            = new hedgeFund();
        Initiative hedgeFund2           = new hedgeFund();
        Initiative hedgeFund3           = new hedgeFund();
        Initiative hostileTakeover      = new hostileTakeover();
        Initiative hostileTakeover2     = new hostileTakeover();
        Initiative hostileTakeover3     = new hostileTakeover();
        Initiative hunter               = new hunter();
        Initiative hunter2              = new hunter();
        Initiative iceWall              = new iceWall();
        Initiative iceWall2             = new iceWall();
        Initiative iceWall3             = new iceWall();
        Initiative melangeMining        = new melangeMining();
        Initiative melangeMining2       = new melangeMining();
        Initiative padCampaign          = new padCampaign();
        Initiative padCampaign2         = new padCampaign();
        Initiative padCampaign3         = new padCampaign();
        Initiative postedBounty         = new postedBounty();
        Initiative postedBounty2        = new postedBounty();
        Initiative priorityRequisition  = new priorityRequisition();
        Initiative priorityRequisition2 = new priorityRequisition();
        Initiative priorityRequisition3 = new priorityRequisition();
        Initiative privateSecurity      = new privateSecurity();
        Initiative privateSecurity2     = new privateSecurity();
        Initiative privateSecurity3     = new privateSecurity();
        Initiative researchStation      = new researchStation();
        Initiative researchStation2     = new researchStation();
        Initiative scorchedEarth        = new scorchedEarth();
        Initiative scorchedEarth2       = new scorchedEarth();
        Initiative securitySubcontract  = new securitySubcontract();
        Initiative shadow               = new shadow();
        Initiative shadow2              = new shadow();
        Initiative shadow3              = new shadow();
        Initiative shipment             = new shipment();
        Initiative shipment2            = new shipment();
        Initiative wallofStatic         = new wallOfStatic();
        Initiative wallofStatic2        = new wallOfStatic();
        Initiative wallofStatic3        = new wallOfStatic();


        List <Ability> cards   = new List <Ability>();
        List <Ability> shuffle = new List <Ability>();
        int            rando   = 0;

        cards.Add(aggressiveNegotiation);
        cards.Add(aggressiveNegotiation2);
        cards.Add(archer);
        cards.Add(archer2);
        cards.Add(beanstalkRoyalties);
        cards.Add(beanstalkRoyalties2);
        cards.Add(beanstalkRoyalties3);
        cards.Add(enigma);
        cards.Add(enigma2);
        cards.Add(enigma3);
        cards.Add(hadriansWall);
        cards.Add(hadriansWall2);
        cards.Add(hedgeFund);
        cards.Add(hedgeFund2);
        cards.Add(hedgeFund3);
        cards.Add(hostileTakeover);
        cards.Add(hostileTakeover2);
        cards.Add(hostileTakeover3);
        cards.Add(hunter);
        cards.Add(hunter2);
        cards.Add(iceWall);
        cards.Add(iceWall2);
        cards.Add(iceWall3);
        cards.Add(melangeMining);
        cards.Add(melangeMining2);
        cards.Add(padCampaign);
        cards.Add(padCampaign2);
        cards.Add(padCampaign3);
        cards.Add(postedBounty);
        cards.Add(postedBounty2);
        cards.Add(priorityRequisition);
        cards.Add(priorityRequisition2);
        cards.Add(priorityRequisition3);
        cards.Add(privateSecurity);
        cards.Add(privateSecurity2);
        cards.Add(privateSecurity3);
        cards.Add(researchStation);
        cards.Add(researchStation2);
        cards.Add(scorchedEarth);
        cards.Add(scorchedEarth2);
        cards.Add(securitySubcontract);
        cards.Add(shadow);
        cards.Add(shadow2);
        cards.Add(shadow3);
        cards.Add(shipment);
        cards.Add(shipment2);
        cards.Add(wallofStatic);
        cards.Add(wallofStatic2);
        cards.Add(wallofStatic3);

        int count = cards.Count;

        for (int i = 0; i < count; i++)
        {
            rando = Random.Range(0, cards.Count - 1);
            shuffle.Add(cards[rando]);
            cards.RemoveAt(rando);
        }

        return(shuffle);
    }
Пример #12
0
    public List<Ability> buildDeck()
    {
        Initiative aggressiveNegotiation = new aggressiveNegotiation();
        Initiative aggressiveNegotiation2 = new aggressiveNegotiation();
        Initiative archer = new archer();
        Initiative archer2 = new archer();
        Initiative beanstalkRoyalties = new beanstalkRoyalties();
        Initiative beanstalkRoyalties2 = new beanstalkRoyalties();
        Initiative beanstalkRoyalties3 = new beanstalkRoyalties();
        Initiative enigma = new enigma();
        Initiative enigma2 = new enigma();
        Initiative enigma3 = new enigma();
        Initiative hadriansWall = new hadriansWall();
        Initiative hadriansWall2 = new hadriansWall();
        Initiative hedgeFund = new hedgeFund();
        Initiative hedgeFund2 = new hedgeFund();
        Initiative hedgeFund3 = new hedgeFund();
        Initiative hostileTakeover = new hostileTakeover();
        Initiative hostileTakeover2 = new hostileTakeover();
        Initiative hostileTakeover3 = new hostileTakeover();
        Initiative hunter = new hunter();
        Initiative hunter2 = new hunter();
        Initiative iceWall = new iceWall();
        Initiative iceWall2 = new iceWall();
        Initiative iceWall3 = new iceWall();
        Initiative melangeMining = new melangeMining();
        Initiative melangeMining2 = new melangeMining();
        Initiative padCampaign = new padCampaign();
        Initiative padCampaign2 = new padCampaign();
        Initiative padCampaign3 = new padCampaign();
        Initiative postedBounty = new postedBounty();
        Initiative postedBounty2 = new postedBounty();
        Initiative priorityRequisition = new priorityRequisition();
        Initiative priorityRequisition2 = new priorityRequisition();
        Initiative priorityRequisition3 = new priorityRequisition();
        Initiative privateSecurity = new privateSecurity();
        Initiative privateSecurity2 = new privateSecurity();
        Initiative privateSecurity3 = new privateSecurity();
        Initiative researchStation = new researchStation();
        Initiative researchStation2 = new researchStation();
        Initiative scorchedEarth = new scorchedEarth();
        Initiative scorchedEarth2 = new scorchedEarth();
        Initiative securitySubcontract = new securitySubcontract();
        Initiative shadow = new shadow();
        Initiative shadow2 = new shadow();
        Initiative shadow3 = new shadow();
        Initiative shipment = new shipment();
        Initiative shipment2 = new shipment();
        Initiative wallofStatic = new wallOfStatic();
        Initiative wallofStatic2 = new wallOfStatic();
        Initiative wallofStatic3 = new wallOfStatic();

        List<Ability> cards = new List<Ability>();
        List<Ability> shuffle = new List<Ability>();
        int rando = 0;

        cards.Add(aggressiveNegotiation);
        cards.Add(aggressiveNegotiation2);
        cards.Add(archer);
        cards.Add(archer2);
        cards.Add(beanstalkRoyalties);
        cards.Add(beanstalkRoyalties2);
        cards.Add(beanstalkRoyalties3);
        cards.Add (enigma);
        cards.Add (enigma2);
        cards.Add (enigma3);
        cards.Add(hadriansWall);
        cards.Add(hadriansWall2);
        cards.Add(hedgeFund);
        cards.Add(hedgeFund2);
        cards.Add(hedgeFund3);
        cards.Add(hostileTakeover);
        cards.Add(hostileTakeover2);
        cards.Add(hostileTakeover3);
        cards.Add(hunter);
        cards.Add(hunter2);
        cards.Add(iceWall);
        cards.Add(iceWall2);
        cards.Add(iceWall3);
        cards.Add(melangeMining);
        cards.Add(melangeMining2);
        cards.Add (padCampaign);
        cards.Add (padCampaign2);
        cards.Add (padCampaign3);
        cards.Add(postedBounty);
        cards.Add(postedBounty2);
        cards.Add(priorityRequisition);
        cards.Add(priorityRequisition2);
        cards.Add(priorityRequisition3);
        cards.Add(privateSecurity);
        cards.Add(privateSecurity2);
        cards.Add(privateSecurity3);
        cards.Add(researchStation);
        cards.Add(researchStation2);
        cards.Add(scorchedEarth);
        cards.Add(scorchedEarth2);
        cards.Add(securitySubcontract);
        cards.Add(shadow);
        cards.Add(shadow2);
        cards.Add(shadow3);
        cards.Add(shipment);
        cards.Add(shipment2);
        cards.Add(wallofStatic);
        cards.Add(wallofStatic2);
        cards.Add(wallofStatic3);

        int count = cards.Count;

        for (int i = 0; i < count; i++)
        {
            rando = Random.Range (0, cards.Count - 1);
            shuffle.Add (cards[rando]);
            cards.RemoveAt (rando);
        }

        return shuffle;
    }