Ejemplo n.º 1
0
 public Order1 SaveOrderCon1(Order1 ord)
 {
     try
     {
         Global obj_g = new Global();
         if (ord.FDName == "" || ord.FDName == null || ord.FDName == "ORDR")
         {
             ord.FDName = "ORDR";
             if (ord.series == "" || ord.series == null)
             {
                 VC objVC = gbc_con.Db_vc.Where(p => p.FDNAME == "ORDR").Take(1).SingleOrDefault();
                 if (objVC == null)
                 {
                     ord.series = "O2";
                 }
                 else
                 {
                     ord.series = objVC.SER;
                 }
             }
         }
         return(obj_g.SaveOrder1(ord));
     }
     catch (Exception ex)
     {
         Order1 ord1 = new Order1();
         ord1.pcode = ex.Message + " Inner Exception Message " + ex.InnerException.InnerException.ToString().Split('\n')[0].ToString();
         return(ord1);
     }
 }
Ejemplo n.º 2
0
    private void HandleInventoriesAndOrder()
    {
        _sourceBuild = GetStructureSrcAndDestinyExpImp();
        if (_sourceBuild == null)
        {
            return;
        }

        //need to pull left from Dispatch bz Order1 is passed by Value not Ref
        var left        = WhatIsLeft();
        var carryWeight = _person.HowMuchICanCarry() < left?_person.HowMuchICanCarry() : left;

        var amt = Order1.ApproveThisAmt(carryWeight);

        _person.ExchangeInvetoryItem(_sourceBuild, _person, Order1.Product, amt, _sourceBuild);
        //will add to processed order only if actually took something...

        if (_person.Inventory.ReturnAmtOfItemOnInv(Order1.Product) > 0 && _export)
        {
            var amtTaken = _person.Inventory.ReturnAmtOfItemOnInv(Order1.Product);
            //and will report actually only was he physically took from it
            _person.Work.Dispatch1.AddToOrderAmtProcessed(Order1, amtTaken);
            //Debug.Log(_person.MyId + " Docker got from:" + Order1.SourceBuild + " : " + Order1.Product + ".amt:" + amt);
        }
        else if (_import)
        {
            _person.Work.Dispatch1.AddToOrderAmtProcessed(Order1, amt);
        }

        _sourceBuild.CheckIfCanBeDestroyNow(Order1.Product);
        _person.Body.UpdatePersonalForWheelBa();
    }
Ejemplo n.º 3
0
        public ucOrderTakeOut1(mPOSControl x, String row, String fooid, String qty, ref Order1 ord, ref List <OrderSpecial> lords, ref List <OrderTopping> lordt, FrmTakeOut4 frmtakeout4
                               , List <NoodleMake> lnooNoodle, List <NoodleMake> lnooWater, List <NoodleMake> lnooOptNoodle, List <NoodleMake> lnooNoodleMeatBall, List <NoodleMake> lnooNoodleSea
                               , List <NoodleMake> lnooNoodleMeat, List <NoodleMake> lnooNoodleVagetable)
        {
            InitializeComponent();
            mposC = x;
            //fooName = foodsname;
            this.qty = qty;
            //this.price = price;
            this.row         = row;
            this.fooid       = fooid;
            this.ord         = ord;
            this.frmtakeout4 = frmtakeout4;
            this.lordt       = lordt;
            this.lords       = lords;

            this.lnooNoodle          = lnooNoodle;
            this.lnooWater           = lnooWater;
            this.lnooOptNoodle       = lnooOptNoodle;
            this.lnooNoodleMeatBall  = lnooNoodleMeatBall;
            this.lnooNoodleSea       = lnooNoodleSea;
            this.lnooNoodleMeat      = lnooNoodleMeat;
            this.lnooNoodleVagetable = lnooNoodleVagetable;
            initConfig();
        }
Ejemplo n.º 4
0
        private void setGrf(String id, String name, String price, String qty, String remark, String printer)
        {
            String re = "";

            if (!name.Equals(""))
            {
                //String[] ext = name.Split('#');
                Order1 ord1 = new Order1();
                Row    row  = grf.Rows.Add();
                row[colFooName]     = name;
                row[colPrice]       = price;
                row[colFooId]       = id;
                row[colRemark]      = remark;
                row[colNo]          = grf.Rows.Count - 2;
                row[colPrinterName] = printer;
                row[colFooName1]    = name;
                ord1.order_id       = "";
                ord1.price          = price;
                ord1.qty            = "1";
                ord1.status_bill    = "0";
                ord1.foods_id       = id;
                ord1.foods_name     = name;
                ord1.remark         = remark;
                ord1.row1           = grf.Rows.Count.ToString();
                ord1.printer_name   = printer;
                ord1.sumPrice       = price;
                ord1.toppingPrice   = "";
                ord1.topping        = "";
                ord1.special        = "";
                lOrd.Add(ord1);
                UpdateTotals();
            }
        }
Ejemplo n.º 5
0
 private void setFooNameRemark()
 {
     foreach (Row row in grf.Rows)
     {
         try
         {
             if (row[colFooName] == null)
             {
                 continue;
             }
             int    rowid1 = 0;
             String fooname = "", rowid = "", spec = "";
             fooname = row[colFooName].ToString();
             rowid   = row[colNo].ToString();
             spec    = row[colRemark].ToString();
             if (!spec.Equals(""))
             {
                 if (int.TryParse(rowid, out rowid1))
                 {
                     Order1 ord = new Order1();
                     ord            = lOrd[rowid1];
                     ord.foods_name = fooname;
                     ord.remark     = spec;
                 }
             }
         }
         catch (Exception ex)
         {
         }
     }
 }
Ejemplo n.º 6
0
        private void btnSaveO_Click(object sender, RoutedEventArgs e)
        {
            Order1 order = null;

            if (action == ActionState.New)
            {
                try
                {
                    Customer1  customer  = (Customer1)cmbCustomer1.SelectedItem;
                    Inventory1 inventory = (Inventory1)cmbInventory1.SelectedItem;
                    //instantiem Order entity
                    order = new Order1()
                    {
                        CustId = customer.CustId,
                        CarId  = inventory.CarId
                    };
                    //adaugam entitatea nou creata in context
                    ctx.Order1.Add(order);
                    customerViewSource.View.Refresh();
                    //salvam modificarile
                    ctx.SaveChanges();
                }
                catch (DataException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Ejemplo n.º 7
0
        private IList <Order1> FillOrder1Model(DataTable dtOrders)
        {
            var order1List = new List <Order1>();

            if (null != dtOrders && dtOrders.Rows.Count > 0)
            {
                foreach (DataRow row in dtOrders.Rows)
                {
                    var order1 = new Order1();
                    order1.CustVendorAdminID = Convert.ToInt32(row["CUST_VEND_ADMIN_ID"]);
                    order1.OrderID           = Convert.ToInt32(row["ORDER_ID"]);
                    order1.OrderPlacedDate   = Convert.ToDateTime(row["ORDER_PLACED_DATE"]);
                    order1.OrderstatusDesc   = Convert.ToString(row["ORDER_STATUS_DESC"]);
                    order1.IssueDetails      = Convert.ToString(row["ISSUE_DTLS"]);
                    order1.mobileCompany     = Convert.ToString(row["MOBILE_CMPNY_DESC"]);
                    order1.mobileversion     = Convert.ToString(row["MOBILE_VER_DESC"]);
                    order1.FinalCost         = Convert.ToInt32(row["FINAL_COST"]);



                    order1List.Add(order1);
                }
            }
            return(order1List);
        }
Ejemplo n.º 8
0
 protected void OnSave(Order1 order)
 {
     //order.AccountId = AccountId;
     order.Demo       = OrderDemo;
     order.Address    = this.InnerObject.Address;
     order.SubmitTime = DateTime.Now;
     order.TotalMoney = Detials.Sum(x => x.price * x.Amount);
 }
Ejemplo n.º 9
0
        public void MapFieldTest1()
        {
            SourceObject1 source = new SourceObject1();
            Order1        order  = Map.ObjectToObject <Order1>(source);

            Assert.AreEqual("1 Main", order.Address.Street);
            Assert.AreEqual("Bigtown", order.Address.City);
            Assert.AreEqual("XX", order.Address.State);
            Assert.AreEqual("00000", order.Address.Zip);
        }
Ejemplo n.º 10
0
        //public Order getemailOrder(Order order)
        //{
        //    string fetchOrder = $"SELECT * FROM ORDER_TABLE ot INNER JOIN USER_TBL ut ON ut.CUST_VEND_ADMIN_ID=ot.FK_CUST_VEND_ADMIN_ID WHERE LOWER(LOGIN_ID) = '{order.LoginId.ToLowerInvariant()}' ";

        //    var dtResult = MySqlOrderHelper.ExecuteQuery(fetchOrder);
        //    var orderemail = FillOrderModel(dtResult);
        //    return orderemail.FirstOrDefault<Order>();

        //}
        public IList <Order1> getemailOrder(Order1 order)
        {
            //string fetchOrder = $"SELECT * FROM ORDER_TABLE ot INNER JOIN USER_TBL ut ON ut.CUST_VEND_ADMIN_ID=ot.FK_CUST_VEND_ADMIN_ID WHERE LOWER(LOGIN_ID) = '{order.LoginId.ToLowerInvariant()}' ";
            //string fetchOrder = $"SELECT ORDER_ID, ORDER_PLACED_DATE,ORDER_STATUS_DESC, FINAL_COST FROM USER_TBL ut INNER JOIN ORDER_TABLE ot ON ut.CUST_VEND_ADMIN_ID=ot.FK_CUST_VEND_ADMIN_ID  INNER JOIN ORDER_STATUS os ON ut.CUST_VEND_ADMIN_ID=os.FK_CUST_VEND_ADMIN_ID  WHERE LOWER(LOGIN_ID) = '{order.LoginId.ToLowerInvariant()}'";
            string fetchOrder = $"SELECT CUST_VEND_ADMIN_ID,ORDER_ID, ORDER_PLACED_DATE,ORDER_STATUS_DESC,ISSUE_DTLS,MOBILE_CMPNY_DESC,MOBILE_VER_DESC, FINAL_COST FROM USER_TBL ut INNER JOIN ORDER_TABLE ot ON ut.CUST_VEND_ADMIN_ID=ot.FK_CUST_VEND_ADMIN_ID INNER JOIN ORDER_STATUS os ON ot.ORDER_ID=os.FK_ORDER_ID INNER JOIN MOBILE_TYPE mt ON os.ORDER_STATUS_ID=mt.FK_ORDER_STATUS_ID INNER JOIN MOBILE_VER_TYPE mv ON mt.MOBILE_CMPNY_ID=mv.FK_MOBILE_CMPNY_ID WHERE CUST_VEND_ADMIN_ID = '{order.CustVendorAdminID}'";
            var    dtResult   = MySqlOrderHelper.ExecuteQuery(fetchOrder);
            var    orderemail = FillOrder1Model(dtResult);

            return(orderemail);
        }
Ejemplo n.º 11
0
        public IHttpActionResult getemailOrder([FromBody] Order1 order)
        {
            var orderRepo  = new OrderRepository();
            var orderemail = orderRepo.getemailOrder(order);

            if (orderemail == null)
            {
                return(NotFound());
            }
            return(Ok(orderemail));
        }
Ejemplo n.º 12
0
 public static Domain.Models.CxOrder Map(Order1 Cx)
 {
     return(new Domain.Models.CxOrder()
     {
         OrderId = Cx.OrderId,
         CustId = Cx.CustId,
         StoreId = Cx.StoreId,
         Price = Cx.Price,
         OrderDate = Cx.OrderDate
     });
 }
Ejemplo n.º 13
0
        private void initConfig()
        {
            //MessageBox.Show("FrmTakeOut initConfig 1", "");
            fEdit  = new Font(mposC.iniC.grdViewFontName, mposC.grdViewFontSize + 5, FontStyle.Regular);
            fEditB = new Font(mposC.iniC.grdViewFontName, mposC.grdViewFontSize, FontStyle.Bold);
            fEdit1 = new Font(mposC.iniC.grdViewFontName, mposC.grdViewFontSize + 5, FontStyle.Regular + 2);

            C1ThemeController.ApplicationTheme = mposC.iniC.themeApplication;
            theme1.Theme = C1ThemeController.ApplicationTheme;
            //theme1.SetTheme(sB, "BeigeOne");
            foreach (Control c in panel3.Controls)
            {
                theme1.SetTheme(c, "Office2013Red");
            }

            bg = txtTableCode.BackColor;
            fc = txtTableCode.ForeColor;
            ff = txtTableCode.Font;
            //MessageBox.Show("FrmTakeOut initConfig 2", "");
            lfooT = new List <Foods>();
            lfooR = new List <Foods>();
            lOrd  = new List <Order1>();
            foo   = new Foods();
            ord   = new Order1();
            lfooT = mposC.mposDB.fooDB.getlFoods1();
            lfooR = mposC.mposDB.fooDB.getlFoodsRecommend();

            btnVoid.Enabled = false;
            //MessageBox.Show("FrmTakeOut initConfig 3", "");
            if (mposC.iniC.pnOrderborderstyle.Equals("0"))
            {
                pnOrder.BorderStyle = BorderStyle.None;
            }
            else if (mposC.iniC.pnOrderborderstyle.Equals("1"))
            {
                pnOrder.BorderStyle = BorderStyle.Fixed3D;
            }
            else if (mposC.iniC.pnOrderborderstyle.Equals("2"))
            {
                pnOrder.BorderStyle = BorderStyle.FixedSingle;
            }

            btnPay.Click     += BtnPay_Click;
            btnVoid.Click    += BtnVoid_Click;
            btnSpec.Click    += BtnSpec_Click;
            btnTopping.Click += BtnTopping_Click;
            btnVoidAll.Click += BtnVoidAll_Click;
            //MessageBox.Show("FrmTakeOut initConfig", "");
            initGrf();
            initTC();
            flagModi = false;
            setBtnEnable(flagModi);
            this.FormBorderStyle = FormBorderStyle.None;
        }
Ejemplo n.º 14
0
        //public List<Order1> getlFoods1()
        //{
        //    List<Order1> lfoo1 = new List<Order1>();
        //    DataTable dt = new DataTable();
        //    dt = selectAll();
        //    foreach (DataRow row in dt.Rows)
        //    {
        //        Order1 itm1 = new Order1();
        //        itm1.order_id = row[ord.order_id].ToString();
        //        itm1.row1 = row[ord.row1].ToString();
        //        itm1.foods_code = row[ord.foods_code].ToString();
        //        itm1.price = row[ord.price].ToString();
        //        itm1.lot_id = row[ord.lot_id].ToString();
        //        itm1.foods_id = row[ord.foods_id].ToString();
        //        itm1.status_foods_1 = row[ord.status_foods_1].ToString();
        //        lfoo1.Add(itm1);
        //    }
        //    return lfoo1;
        //}
        //public void getlFoods()
        //{
        //    //lDept = new List<Position>();
        //    lOrd.Clear();
        //    DataTable dt = new DataTable();
        //    dt = selectAll();
        //    foreach (DataRow row in dt.Rows)
        //    {
        //        Order1 itm1 = new Order1();
        //        itm1.order_id = row[ord.order_id].ToString();
        //        itm1.row1 = row[ord.row1].ToString();

        //        lOrd.Add(itm1);
        //    }
        //}
        //public String getList(String id)
        //{
        //    String re = "";
        //    if (lOrd.Count <= 0) getlFoods();
        //    foreach (Order1 sex in lOrd)
        //    {
        //        if (sex.order_id.Equals(id))
        //        {
        //            re = sex.row1;
        //            break;
        //        }
        //    }
        //    return re;
        //}
        private void chkNull(Order1 p)
        {
            long    chk  = 0;
            Decimal chk1 = 0;

            p.date_modi   = p.date_modi == null ? "" : p.date_modi;
            p.date_cancel = p.date_cancel == null ? "" : p.date_cancel;
            p.user_create = p.user_create == null ? "" : p.user_create;
            p.user_modi   = p.user_modi == null ? "" : p.user_modi;
            p.user_cancel = p.user_cancel == null ? "" : p.user_cancel;

            p.row1       = p.row1 == null ? "" : p.row1;
            p.foods_code = p.foods_code == null ? "" : p.foods_code;
            p.order_date = p.order_date == null ? "" : p.order_date;
            //p.table_id = p.table_id == null ? "0" : p.table_id;
            //p.price = p.price == null ? "" : p.price;
            //p.area_id = p.area_id == null ? "0" : p.area_id;
            //p.res_id = p.res_id == null ? "0" : p.res_id;
            p.status_foods_2    = p.status_foods_2 == null ? "" : p.status_foods_2;
            p.status_foods_1    = p.status_foods_1 == null ? "" : p.status_foods_1;
            p.status_foods_3    = p.status_foods_3 == null ? "" : p.status_foods_3;
            p.status_bill       = p.status_bill == null ? "" : p.status_bill;
            p.bill_check_date   = p.bill_check_date == null ? "" : p.bill_check_date;
            p.status_cook       = p.status_cook == null ? "" : p.status_cook;
            p.cook_receive_date = p.cook_receive_date == null ? "" : p.cook_receive_date;
            p.cook_finish_date  = p.cook_finish_date == null ? "" : p.cook_finish_date;
            p.void_date         = p.void_date == null ? "" : p.void_date;
            p.status_void       = p.status_void == null ? "" : p.status_void;
            p.printer_name      = p.printer_name == null ? "" : p.printer_name;
            p.status_to_go      = p.status_to_go == null ? "" : p.status_to_go;
            //p.bill_id = p.bill_id == null ? "" : p.bill_id;
            p.order_user      = p.order_user == null ? "" : p.order_user;
            p.status_closeday = p.status_closeday == null ? "" : p.status_closeday;
            //p.closeday_id = p.closeday_id == null ? "" : p.closeday_id;
            p.cnt_cust   = p.cnt_cust == null ? "" : p.cnt_cust;
            p.foods_name = p.foods_name == null ? "" : p.foods_name;

            p.host_id   = long.TryParse(p.host_id, out chk) ? chk.ToString() : "0";
            p.branch_id = long.TryParse(p.branch_id, out chk) ? chk.ToString() : "0";
            p.device_id = long.TryParse(p.device_id, out chk) ? chk.ToString() : "0";

            p.foods_id    = long.TryParse(p.foods_id, out chk) ? chk.ToString() : "0";
            p.lot_id      = long.TryParse(p.lot_id, out chk) ? chk.ToString() : "0";
            p.bill_id     = long.TryParse(p.bill_id, out chk) ? chk.ToString() : "0";
            p.area_id     = long.TryParse(p.area_id, out chk) ? chk.ToString() : "0";
            p.res_id      = long.TryParse(p.res_id, out chk) ? chk.ToString() : "0";
            p.table_id    = long.TryParse(p.table_id, out chk) ? chk.ToString() : "0";
            p.closeday_id = long.TryParse(p.closeday_id, out chk) ? chk.ToString() : "0";

            p.price           = Decimal.TryParse(p.price, out chk1) ? chk1.ToString() : "0";
            p.qty             = Decimal.TryParse(p.qty, out chk1) ? chk1.ToString() : "0";
            p.price_plus_togo = Decimal.TryParse(p.price_plus_togo, out chk1) ? chk1.ToString() : "0";
        }
Ejemplo n.º 15
0
        private void initConfig()
        {
            lOrd           = new List <Order1>();
            ord            = new Order1();
            ord.order_id   = "order_id";
            ord.lot_id     = "lot_id";
            ord.row1       = "row1";
            ord.foods_id   = "foods_id";
            ord.foods_code = "foods_code";
            ord.foods_name = "foods_name";
            ord.order_date = "order_date";
            ord.price      = "price";
            ord.qty        = "qty";

            ord.active      = "active";
            ord.remark      = "remark";
            ord.sort1       = "sort1";
            ord.date_cancel = "date_cancel";
            ord.date_create = "date_create";
            ord.date_modi   = "date_modi";
            ord.user_cancel = "user_cancel";
            ord.user_create = "user_create";
            ord.user_modi   = "user_modi";
            ord.host_id     = "host_id";
            ord.branch_id   = "branch_id";
            ord.device_id   = "device_id";

            ord.table_id       = "table_id";
            ord.res_id         = "res_id";
            ord.area_id        = "area_id";
            ord.status_foods_1 = "status_foods_1";
            ord.status_foods_2 = "status_foods_2";

            ord.status_foods_3    = "status_foods_3";
            ord.status_bill       = "status_bill";
            ord.bill_check_date   = "bill_check_date";
            ord.status_cook       = "status_cook";
            ord.cook_receive_date = "cook_receive_date";
            ord.cook_finish_date  = "cook_finish_date";
            ord.void_date         = "void_date";
            ord.status_void       = "status_void";
            ord.printer_name      = "printer_name";
            ord.status_to_go      = "status_to_go";
            ord.bill_id           = "bill_id";
            ord.order_user        = "******";
            ord.status_closeday   = "status_closeday";
            ord.closeday_id       = "closeday_id";
            ord.cnt_cust          = "cnt_cust";
            ord.price_plus_togo   = "price_plus_togo";

            ord.pkField = "order_id";
            ord.table   = "t_order";
        }
Ejemplo n.º 16
0
        private Order1 setArea1(DataTable dt)
        {
            Order1 dept1 = new Order1();

            if (dt.Rows.Count > 0)
            {
                dept1.order_id = dt.Rows[0][ord.order_id].ToString();
                dept1.row1     = dt.Rows[0][ord.row1].ToString();
            }

            return(dept1);
        }
Ejemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int customerid = Convert.ToInt32(Session["customerid"].ToString());

            EntityManager<Order1> pcat = new EntityManager<Order1>();
            Order1 procat = new Order1();
            procat.CustomerID = customerid;
            List<Order1> prodcatID = pcat.Search(procat);

            gv_Product.DataSource = prodcatID;
            gv_Product.DataBind();
        }
Ejemplo n.º 18
0
        public async Task <Order1> CreateOrderAsync(string buyerEmail, int deliveryMethodId, string basketId, Address shippingAddress)
        {
            // get basket from the repo
            var basket = await _basketRepo.GetBasketAsync(basketId);

            // get items from the product repo
            var items = new List <OrderItem1>();

            foreach (var item in basket.Items)
            {
                var productItem = await _unitOfWork.Repository <Item>().GetByIdAsync(item.Id);

                var itemOrdered = new ProductItemOrdered1(productItem.Id, productItem.Name, productItem.PictureUrl);
                var orderItem   = new OrderItem1(itemOrdered, productItem.NewPrice, item.Quantity);
                items.Add(orderItem);
            }

            // get delivery method from repo
            var deliveryMethod = await _unitOfWork.Repository <DeliveryMethod>().GetByIdAsync(deliveryMethodId);

            // calculate subtotal
            var subtotal = items.Sum(item => item.Price * item.Quantity);

            //// check to see if order exists
            //var spec = new OrderByPaymentIntentIdSpecification(basket.PaymentIntentId);
            //var existingOrder = await _unitOfWork.Repository<Order>().GetEntityWithSpec(spec);

            //if (existingOrder != null)
            //{
            //    _unitOfWork.Repository<Order>().Delete(existingOrder);
            //    await _paymentService.CreateOrUpdatePaymentIntent(basket.PaymentIntentId);
            //}

            // create order
            var order = new Order1(items, buyerEmail, shippingAddress, deliveryMethod, subtotal /*, basket.PaymentIntentId*/);

            _unitOfWork.Repository <Order1>().Add(order);

            // save to db
            var result = await _unitOfWork.Complete();

            if (result <= 0)
            {
                return(null);
            }

            // delete basket
            await _basketRepo.DeleteBasketAsync(basketId);

            // return order
            return(order);
        }
Ejemplo n.º 19
0
 private float WhatIsLeft()
 {
     if (import())
     {
         //bz is gets completed b4 hits this and was checked already for the amt
         return(Order1.Amount);
     }
     if (Dock() != null)
     {
         return(Dock().Dispatch1.LeftOnThisOrder(Order1));
     }
     return(Order1.Left());
 }
Ejemplo n.º 20
0
        public Order1 selectByPk1(String copId)
        {
            Order1    cop1 = new Order1();
            DataTable dt   = new DataTable();
            String    sql  = "select foo.* " +
                             "From " + ord.table + " foo " +
                             //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " +
                             "Where foo." + ord.pkField + " ='" + copId + "' ";

            dt   = conn.selectData(conn.conn, sql);
            cop1 = setFoods(dt);
            return(cop1);
        }
Ejemplo n.º 21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int customerid = Convert.ToInt32(Session["customerid"].ToString());

            EntityManager <Order1> pcat = new EntityManager <Order1>();
            Order1 procat = new Order1();

            procat.CustomerID = customerid;
            List <Order1> prodcatID = pcat.Search(procat);

            gv_Product.DataSource = prodcatID;
            gv_Product.DataBind();
        }
Ejemplo n.º 22
0
        private void setGrfSpecialTopping()
        {
            int    row = 0;
            String topping = "", name = "";

            if (int.TryParse(txtRow.Text, out row))
            {
                //topping = grf[row, colTopping] == null ? "" : grf[row, colTopping].ToString();
                //name = grf[row, colFooName1] == null ? "" : grf[row, colFooName1].ToString();
                if (!mposC.fooName.Equals(""))
                {
                    Order1 ord = lOrd[row - 1];
                    //ord.special = mposC.fooSpec;
                    //ord.topping = mposC.fooTopping;
                    ord.sumPrice     = mposC.foosumprice;
                    ord.toppingPrice = mposC.toppingPrice;
                    if (mposC.fooTopping.Equals(""))
                    {
                        //Order1 ord = lOrd[row - 1];
                        //ord.special = mposC.fooSpec;
                        if (!mposC.fooSpec.Equals(""))
                        {
                            grf[row, colFooName] = mposC.fooName + " + " + mposC.fooSpec;
                        }
                        else
                        {
                            grf[row, colFooName] = mposC.fooName;
                        }
                        grf[row, colPrice] = ord.sumPrice;
                    }
                    else
                    {
                        ord.topping = mposC.fooTopping;
                        if (mposC.fooSpec.Equals(""))
                        {
                            grf[row, colFooName] = mposC.fooName + " + " + mposC.fooTopping;
                        }
                        else
                        {
                            grf[row, colFooName] = mposC.fooName + " + " + mposC.fooTopping + " + " + mposC.fooSpec;
                        }
                        grf[row, colPrice] = ord.sumPrice;
                    }
                }
                if (!mposC.fooSpec.Equals(""))
                {
                    grf[row, colRemark] = mposC.fooSpec;
                }
            }
            UpdateTotals();
        }
Ejemplo n.º 23
0
        public List <Order1> Order1_history(string PtCode, string AppType, string PCode = "")
        {
            string    SerPath;
            GBCCon    gbc_con = new GBCCon();
            List <OB> list_ord;

            if (PCode == "")
            {
                list_ord = gbc_con.db_ob.Where(p => p.FromUserId == PtCode && p.AppType == AppType).OrderByDescending(p => p.VrDate).ToList();
            }
            else
            {
                list_ord = gbc_con.db_ob.Where(p => p.FromUserId == PtCode && p.AppType == AppType && p.ToUserId == PCode).OrderByDescending(p => p.VrDate).ToList();
            }
            List <Order1> ord = new List <Order1>();

            foreach (var item in list_ord)
            {
                Order1 obj_ord = new Order1();
                obj_ord.NameP    = gbc_con.db_patient.SingleOrDefault(p => p.PtCode == PtCode).PtName;
                SerPath          = gbc_con.db_SerReg.SingleOrDefault(p => p.Pcode == item.ToUserId).ServicePath;
                obj_ord.pcode    = gbc_con.db_SerReg.SingleOrDefault(p => p.Pcode == item.ToUserId).Name;
                obj_ord.TotalAmt = item.OrdAmt.ToString();
                obj_ord.vrdate   = Convert.ToDateTime(item.VrDate).ToString("dd/MM/yyyy");
                obj_ord.vrno     = item.VrNo;
                obj_ord.imgName  = item.ImgName;
                List <ItemMaster> li_Oi = new List <ItemMaster>();
                List <OI>         OI    = gbc_con.db_oi.Where(p => p.VrId == item.VrId).ToList();
                foreach (var oi_item in OI)
                {
                    try
                    {
                        ItemMaster obj_oi = new ItemMaster();
                        obj_oi.INAME = oi_item.IName;
                        obj_oi.Qty   = oi_item.OrdQty.ToString();
                        obj_oi.free  = oi_item.FreeQty.ToString();
                        obj_oi.Rate  = oi_item.Rate.ToString();
                        obj_oi.ICODE = oi_item.Value.ToString();
                        li_Oi.Add(obj_oi);
                    }
                    catch
                    {
                    }
                }
                obj_ord.items  = li_Oi;
                obj_ord.status = GetStatus(obj_ord.vrno, SerPath);
                ord.Add(obj_ord);
            }
            ord = ord.OrderByDescending(p => p.vrdate).OrderByDescending(p => p.vrno).ToList();
            return(ord);
        }
Ejemplo n.º 24
0
        protected void Button3_Click(object sender, EventArgs e)
        {
            Order1 o = new Order1(TextBox22.Text.ToString(), Session["Id"].ToString());

            o.findOrder();
            if (o.Flag == 1)
            {
                Response.Write("<script>alert('ההזמנה שולמה');</script>");
            }
            else
            {
                o.updateOrder();
            }
        }
Ejemplo n.º 25
0
        public String insertOrder(Order1 p, String userId)
        {
            String re = "";

            if (p.order_id.Equals(""))
            {
                re = insert(p, "");
            }
            else
            {
                re = update(p, "");
            }

            return(re);
        }
Ejemplo n.º 26
0
        static void Main(string[] args)
        {
            /*
             * You've heard it before 'favor composition over inheritance.
             * I take that to mean tha when you inherit, you are making a lot of assumptions about the future. When the 'base' class evolves, so will
             * everything 'downstream' on the inheritance chain. This could be desirable or it could create a bunch of un-used properties when dealing
             * with edge cases.
             *
             * I tend to prefer composition. Meaning that rather than inherit, I just implement an inteface multiple times to better tailor the modeling.
             * In this way you can evolve each piece separately and not have to deal with the baggage of inheritance.
             */

            //the base class
            var order1 = new Order1();

            //inheritance
            var order1EnhancedInherited = new EnhancedOrder1Inherited();

            //composition
            var order1EnhancedComposed = new EnhancedOrder1Composed();

            //another way to compose is to wrap the original that I tend to prefer
            var order1EnhancedComposedAlternate = new EnhancedOrder1ComposedAlternate
            {
                Order = new Order1()
            };


            //only to show each one being used
            var processor = new OrderProcessor();

            //base
            processor.Process(order1);

            //inherited
            processor.Process((IOrder)order1EnhancedInherited);
            processor.Process((IOrderEnhanced)order1EnhancedInherited);

            //composed
            processor.Process((IOrder)order1EnhancedComposed);
            processor.Process((IOrderEnhanced)order1EnhancedComposed);

            //composed alternate
            processor.Process(order1EnhancedComposedAlternate.Order);
            processor.Process(order1EnhancedComposedAlternate);

            Console.ReadKey();
        }
        //Save Order details to the DataTable
        internal DataTable SaveOrderDetails(Order1 order1)
        {
            SqlParameter[] parameters = new SqlParameter[9];
            parameters[0] = DataLayer.DataAccess.AddParameter("@UserName", order1.Username, System.Data.SqlDbType.VarChar, 100);
            parameters[1] = DataLayer.DataAccess.AddParameter("@FirstName", order1.FirstName, System.Data.SqlDbType.VarChar, 100);
            parameters[2] = DataLayer.DataAccess.AddParameter("@LastName", order1.LastName, System.Data.SqlDbType.VarChar, 50);
            parameters[3] = DataLayer.DataAccess.AddParameter("@Address", order1.Address, System.Data.SqlDbType.VarChar, 500);
            parameters[4] = DataLayer.DataAccess.AddParameter("@City", order1.City, System.Data.SqlDbType.VarChar, 100);
            parameters[5] = DataLayer.DataAccess.AddParameter("@State", order1.State, System.Data.SqlDbType.VarChar, 100);
            parameters[6] = DataLayer.DataAccess.AddParameter("@PostalCode", order1.PostalCode, System.Data.SqlDbType.VarChar, 100);
            parameters[7] = DataLayer.DataAccess.AddParameter("@Country", order1.Country, System.Data.SqlDbType.VarChar, 100);
            parameters[8] = DataLayer.DataAccess.AddParameter("@CustomerEmailAddress", order1.Email, System.Data.SqlDbType.VarChar, 100);

            DataTable dt = DataLayer.DataAccess.ExcuteDTByProcedure("SP_SaveOrderDetails", parameters);

            return(dt);
        }
Ejemplo n.º 28
0
    private void HandleInventoriesAndOrder()
    {
        //need to pull left from Dispatch bz Order1 is passed by Value not Ref
        var left = WhatIsLeft();
        var amt  = Order1.ApproveThisAmt(left);

        if (_person.Inventory.ReturnAmtOfItemOnInv(Order1.Product) > 0 && export())
        {
            var amtTaken = _person.Inventory.ReturnAmtOfItemOnInv(Order1.Product);
            //and will report actually only was he physically took from it
            Dock().Dispatch1.AddToOrderAmtProcessed(Order1, amtTaken);
        }
        else if (import())
        {
            Dock().Dispatch1.AddToOrderAmtProcessed(Order1, amt);
        }
        Dock().Dispatch1.CleanOrdersIfNeeded();
    }
Ejemplo n.º 29
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter client data:");
            Console.Write("Name: ");
            string clientName = Console.ReadLine();

            Console.Write("E-mail: ");
            string email = Console.ReadLine();

            Console.Write("BirthDate: ");
            DateTime birthDate = DateTime.Parse(Console.ReadLine());

            Console.WriteLine("Enter order data: ");
            Console.Write("Status: ");
            OrderStatus status = (OrderStatus)Enum.Parse(typeof(OrderStatus), Console.ReadLine(), true);

            Client client = new Client(clientName, email, birthDate);
            Order1 order  = new Order1(DateTime.Now, status, client);


            Console.Write("How many items to this order? ");
            int n = int.Parse(Console.ReadLine());

            for (int i = 1; i <= n; i++)
            {
                Console.WriteLine($"Enter #{i} item data:");
                Console.Write("Product name: ");
                string prdName = Console.ReadLine();
                Console.Write("Product price: ");
                double prdPrice = double.Parse(Console.ReadLine());

                Product product = new Product(prdName, prdPrice);

                Console.Write("Quantity: ");
                int prdQuantity = int.Parse(Console.ReadLine());

                OrderItem orderItem = new OrderItem(prdQuantity, prdPrice, product);
                order.AddItem(orderItem);
            }

            Console.WriteLine();
            Console.WriteLine("ORDER SUMMARY: ");
            Console.Write(order);
        }
        public ActionResult AddOrder(List <OrderDetail> arr, Order1 data2)
        {
            int orderID = 0;

            data2.CreateDate = DateTime.Now;
            db.Order1.Add(data2);
            db.SaveChanges();
            orderID = data2.OrderID;
            foreach (OrderDetail item in arr)
            {
                item.OrderID = orderID;
            }
            db.OrderDetails.AddRange(arr.AsEnumerable());
            db.SaveChanges();

            int?   total   = 0;
            string content = System.IO.File.ReadAllText(Server.MapPath("~/Areas/client/template/email.html"));

            foreach (var item in arr)
            {
                content = content.Replace("{{NameProduct}}", item.Name);
                content = content.Replace("{{soluong}}", item.Quantity.ToString());
                string.Format("{0:#,##0}", total += item.Quantity * item.Price);
            }
            string shipEmail = data2.ShipEmail;
            string recipient = shipEmail;

            content = content.Replace("{{CustomerName}}", data2.ShipName);
            content = content.Replace("{{Phone}}", data2.ShipMobile);
            content = content.Replace("{{Email}}", data2.ShipEmail);
            content = content.Replace("{{Address}}", data2.ShipAddress);
            content = content.Replace("{{Total}}", total.ToString());

            WebMail.SmtpServer = "smtp.gmail.com";
            WebMail.SmtpPort   = 587;
            WebMail.SmtpUseDefaultCredentials = true;
            WebMail.EnableSsl = true;
            WebMail.UserName  = "******";
            WebMail.Password  = "******";
            WebMail.Send(to: recipient, subject: "Đơn Hàng Từ SWE", body: content);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 31
0
        private void printOrder()
        {
            List <String> lprn = new List <String>();

            iprn = 1;
            foreach (Order1 ord in lOrd)
            {
                //String printername = "";
                //printername = ord.printer_name;
                ord1 = ord;
                PrintDocument document = new PrintDocument();
                //MessageBox.Show("ord1.printer_name "+ ord1.printer_name, "");
                document.PrinterSettings.PrinterName = ord1.printer_name;
                document.PrintPage += new PrintPageEventHandler(printDocument1_PrintPage);
                //This is where you set the printer in your case you could use "EPSON USB"
                //or whatever it is called on your machine, by Default it will choose the default printer
                //document.PrinterSettings.PrinterName = mposC.iniC.printerBill;
                document.Print();
                Application.DoEvents();
                iprn++;
            }
        }