Exemplo n.º 1
0
 public InputOrder()
 {
     InitializeComponent();
     MyOrder = new Model.P_Order();
     AllPart = new List <OrderPart>();
 }
Exemplo n.º 2
0
        private void button7_Click(object sender, EventArgs e)
        {
            string OrderNo = text_oldpaper.Text.Trim();
            string OrderOn = "";

            NoOut = false;
            DataTable WaitOutPaper = null;

            Model.P_Order order   = Model.P_Order.GetOrderByOrder(OrderNo);
            DataTable     tempout = null;

            if (order != null)
            {
                string pubno1 = order.OrderOn.Replace("O", "PUB");
                OrderOn      = pubno1;
                MaterialList = Model.P_MaterialList2.GetDataList("OrderOn='" + pubno1 + "' and Mtype='1'");
                if (MaterialList != null && MaterialList.Count > 0)
                {
                    List <Model.Paper_Out> OutList = new List <Model.Paper_Out>();
                    foreach (Model.P_MaterialList2 pm2 in MaterialList)
                    {
                        Model.Paper_Out po11 = new Model.Paper_Out();
                        po11.PaperName = pm2.b2;
                        po11.PaperId   = pm2.b1;
                        po11.Num       = pm2.Num;
                        OutList.Add(po11);
                    }
                    tempout = DataSource.ORMHelper.ModelListToTb <Model.Paper_Out>(OutList);
                }
                else
                {
                    MessageBox.Show("订单号错误或该订单没有纸张,请重新输入!");
                    return;
                }
            }

            //检查是否有出库;
            WaitOutPaper = Model.Paper_Out.GetDataTable(" b1='" + OrderNo + "'");
            if (WaitOutPaper != null && WaitOutPaper.Rows.Count > 0)
            {
                NoOut = false;
            }
            else
            {
                WaitOutPaper = tempout;
            }

            dataGridView1.DataSource = WaitOutPaper;
            List <string> title = Model.Paper_Out.GetColumNikeName();

            for (int i = 0; i < title.Count; i++)
            {
                dataGridView1.Columns[i].HeaderText = title[i];
            }
            dataGridView1.AutoSize = true;

            this.Cursor = Cursors.Default;
            List <Model.Paper_Out> wp = Model.Paper_Out.PaperoutTabletoList(WaitOutPaper);

            comboBox3.DataSource    = wp;
            comboBox3.DisplayMember = "PaperName";
            comboBox3.SelectedIndex = 0;
            Model.Paper_Out po = wp[0];
            textBox1.Text = po.Num.ToString();
        }
Exemplo n.º 3
0
        public string  GetOrder(string UserName, string UserNeed, string address, int deliverprice)
        {
            string result = "下单成功!订单总价:" + (AllPrice.DiscountPrice + deliverprice).ToString();

            Model.P_Order order = new Model.P_Order();
            order.CostPrice       = AllPrice.DiscountPrice + deliverprice;
            order.CustomerId      = UserName;
            order.CustomerRequest = UserNeed;
            order.InsidePrice     = AllPrice.Price;
            order.Price           = AllPrice.DiscountPrice;
            order.AddressId       = address;
            order.OrderTime       = DateTime.Now;
            order.ProductionTime  = DateTime.Now.AddDays(1);
            order.EndTime         = DateTime.Now.AddDays(7);
            order.DeliverPrice    = deliverprice;
            order.Remark          = UserRequest;

            //如果是纸杯,产品表就没有这个产品;直接是按订单完成处理;
            //if (ProductId == 8)
            //    order.Status =(int) ConstantValue.Order.OrderStatus.订单完成;
            string OrderCode = DAL.P_Order.Add(order);

            if (true)
            {
                Model.P_ProductList pro = new Model.P_ProductList();
                pro.CostPrice       = AllPrice.Price;
                pro.ProductId       = ProductId;
                pro.CustomerRequest = UserNeed;
                pro.LastPrice       = AllPrice.DiscountPrice;
                pro.PaperPrice      = AllPrice.PaperPrice;
                pro.PrintPrice      = AllPrice.PrintPrice;
                pro.ProcessPrice    = AllPrice.ProcessPrice + AllPrice.BindPrince;
                pro.OtherPrice      = AllPrice.OtherPrice;
                pro.PsPrice         = AllPrice.PsPrince;
                pro.PaperWeight     = PaperWeight;
                pro.ProductWeight   = AllWeight;
                pro.ProducSizeId    = ProductSize.Id;
                pro.productHeight   = ProductSize.Height;
                pro.ProductLength   = ProductSize.Length;
                pro.ProductNum      = ProductNum;
                pro.ProductName     = ProductName;
                pro.BindType        = BindType;
                pro.StartTime       = DateTime.Now;
                pro.EndTime         = DateTime.Now.AddDays(7);
                pro.OrderOn         = OrderCode;
                pro.AuditingTime    = DateTime.Now.AddDays(1);
                pro.ProductionTime  = DateTime.Now.AddDays(1);
                pro.Status          = 1;
                pro.Remark          = UserRequest;
                string ProCode = DAL.P_ProductList.Add(pro);
                if (ProCode != null)
                {
                    Cover.SaveUnit(ProCode);
                }
                this.ProductCode = ProCode;
                if (AllMaterial != null)
                {
                    savematerial(ProCode);
                }
                if (Process != null)
                {
                    saveprocess(ProCode);
                }
                if (PrintList != null)
                {
                    saveprintunit(ProCode);
                }
            }
            return(OrderCode);
        }