Esempio n. 1
0
 private void tsbAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (order.IsEdit() == true)
         {
             var res = System.Windows.Forms.MessageBox.Show("数据已修改,是否保存?", "提示", MessageBoxButtons.YesNoCancel);
             if (res == DialogResult.Yes)
             {
                 order.Save();
                 order.Add();
                 ordermerge.ShowForm2();
             }
             else if (res == DialogResult.No)
             {
                 order.Add();
                 ordermerge.ShowForm2();
             }
             else if (res == DialogResult.Cancel)
             {
             }
         }
         else
         {
             order.Add();
             ordermerge.ShowForm2();
         }
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
Esempio n. 2
0
 private void tsbDel_Click(object sender, EventArgs e)
 {
     try
     {
         if (!MyLove.PermissionsBalidation(this.Text, "02"))
         {
             return;
         }
         if (sheet_no != null && sheet_no != "")
         {
             if (YesNoForm.ShowFrom("确认删除单据[" + sheet_no + "]?") == System.Windows.Forms.DialogResult.Yes)
             {
                 IBLL.IInOutBLL bll = new BLL.InOutBLL();
                 bll.DeleteInOut(sheet_no, update_time);
                 IOrder ins = this;
                 ins.Add();
             }
         }
     }
     catch (Exception ex)
     {
         MsgForm.ShowFrom("删除单据异常[" + ex.Message + "]");
         Helper.LogHelper.writeLog("frmOtherInOutSheet->tsbDel_Click()", ex.ToString(), sheet_no);
     }
 }
Esempio n. 3
0
        private void tsbDel_Click(object sender, EventArgs e)
        {
            try
            {
                if (!MyLove.PermissionsBalidation(this.Text, "02"))
                {
                    return;
                }
                if (txtsheet_no.Text.Trim() != "")
                {
                    string sheet_no = txtsheet_no.Text.Trim();

                    if (YesNoForm.ShowFrom("确认删除单据" + sheet_no + "?") == DialogResult.Yes)
                    {
                        IBLL.ICashOrder bll = new BLL.CashOrder();
                        bll.Delete(sheet_no);
                        IOrder ins = this;
                        ins.Add();
                    }
                }
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
        }
 public IActionResult Create(Order model)
 {
     if (ModelState.IsValid)
     {
         _Order.Add(model);
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
Esempio n. 5
0
        public frmStockInit()
        {
            InitializeComponent();


            IOrder ins = this;

            ins.Add();
        }
Esempio n. 6
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(TravelAgent.Model.Order model)
        {
            int lineid = 0;

            if (dal.Add(model) > 0)
            {
                lineid = dal.GetMaxID("Id");
            }
            return(lineid);
        }
Esempio n. 7
0
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            if (!MyLove.PermissionsBalidation(this.Text, "01"))
            {
                return;
            }
            IOrder ins = this;

            ins.Add();
        }
Esempio n. 8
0
        public ContentResult Post([FromBody] OrderModel value)
        {
            if (value == null)
            {
                return(Content("Bad Request"));
            }

            _orderRepository.Add(value);

            return(Content("Order has created."));
        }
Esempio n. 9
0
 public static bool Add(OrderInfo orderInfo)
 {
     if (SiteConfig.ConfigInfo().ShopConfig.IsSetFunctionary)
     {
         string str = string.Empty;
         foreach (AdministratorInfo info in Administrators.GetAdminListByOperateCode(0, Administrators.GetTotalOfAdmin(), 0x614719c))
         {
             str = str + info.AdminName + ",";
         }
         orderInfo.Functionary = AllotFunctionary(str.TrimEnd(new char[] { ',' }));
     }
     return(dal.Add(orderInfo));
 }
Esempio n. 10
0
 private void tsbAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (!MyLove.PermissionsBalidation(this.Text, "01"))
         {
             return;
         }
         if (order.IsEdit() == true)
         {
             var res = YesNoForm.ShowFrom("数据已修改,是否保存?");
             if (res == DialogResult.Yes)
             {
                 order.Save();
                 order.Add();
                 ordermerge.ShowForm2();
             }
             else if (res == DialogResult.No)
             {
                 order.Add();
                 ordermerge.ShowForm2();
             }
             else if (res == DialogResult.Cancel)
             {
             }
         }
         else
         {
             order.Add();
             ordermerge.ShowForm2();
         }
     }
     catch (Exception ex)
     {
         MsgForm.ShowFrom(ex);
         Helper.LogHelper.writeLog("frmIOMaster->tsbAdd_Click()", ex.ToString());
     }
 }
Esempio n. 11
0
        public async Task <IActionResult> Checkout()
        {
            var user = await _userManager.GetUserAsync(User);

            var basket = _basket.GetBasketById(user.Id);
            List <BasketItem> items = _basket.GetItems(basket.Id);

            if (items.Count == 0)
            {
                TempData["ErrorMessage"] = "Shopping Cart is empty";
                return(RedirectToAction("CartPage"));
            }
            basket.TotalCost = 0;

            foreach (BasketItem item in items)
            {
                var product = await _context.GetById(item.ItemId);

                item.Product      = product;
                basket.TotalCost += Convert.ToDecimal(item.Quantity) * product.Price;
            }

            if (_order.Get(basket.Id) == null)
            {
                Order newOrder = new Order
                {
                    UserId   = user.Id,
                    BasketId = basket.Id,
                    Subtotal = basket.TotalCost,
                };

                await _order.Add(newOrder);
            }

            Order order = _order.Get(basket.Id);

            order.Subtotal = basket.TotalCost;

            await _basket.SaveBasket(basket);

            await _order.Update(order);

            CheckoutViewModel cvm = new CheckoutViewModel();

            order.Items = items;
            cvm.Order   = order;

            return(View(cvm));
        }
Esempio n. 12
0
 public IActionResult Payment(Order Order)
 {
     if (HttpContext.Session.GetString("Username") != null)
     {
         var currentUser = _user.GetById(HttpContext.Session.GetString("Username"));
         if (!ModelState.IsValid)
         {
             ViewData["Name"] = "Thanh toán / Payment";
             return(View());
         }
         else
         {
             Double total = Double.Parse(HttpContext.Session.GetString("TOTAL"));
             if (total == 0)
             {
                 ViewData["Name"] = "Thanh toán / Payment";
                 ViewBag.ERROR    = "Giỏ hàng của bạn không tồn tại";
                 return(View());
             }
             else
             {
                 if (currentUser.Email.Equals(Order.Email))
                 {
                     Order.CustomerId = HttpContext.Session.GetString("Username");
                     Order.Price      = Double.Parse(HttpContext.Session.GetString("TOTAL"));
                     //Console.WriteLine(Order.Fullname);
                     Order.Accept = false;
                     var cart = _cart.GetByUSerId(Order.CustomerId);
                     _cart.RemoveAll(HttpContext.Session.GetString("Username"));
                     _order.Add(Order);
                     //HttpContext.Session.Remove("ERROREMAIL");
                     return(RedirectToAction("List"));
                 }
                 else
                 {
                     ViewData["Name"] = "Thanh toán / Payment";
                     ViewBag.ERROR    = "Email bạn nhập phải khớp với email của bạn";
                     //HttpContext.Session.SetString("ERROREMAIL", "Your email must match with current email");
                     return(View());
                 }
             }
         }
     }
     else
     {
         return(RedirectToAction("Login", "Home"));
     }
 }
        public ActionResult Create(Order order)
        {
            order.OrderDate   = DateTime.Now;
            order.Rating      = 0;
            order.RatingNotes = "";
            order.ServiceId   = (int)TempData["ServiceID"];
            order.OrderStatus = "Opened";
            order.CustomerId  = HttpContext.User.Identity.GetUserId();

            if (ModelState.IsValid)
            {
                orderRepository.Add(order);
                return(RedirectToAction(nameof(CustomerOrders), new { customerId = order.CustomerId }));
            }
            return(View());
        }
Esempio n. 14
0
        public ActionResult Post(Order Model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest("Data can not be saved"));
                }

                if (OrderRepository.AlreadyExists(Model.EventId, Model.UserId))
                {
                    return(BadRequest("Record already exists"));
                }

                OrderRepository.Add(Model);
                OrderRepository.Save();

                return(Ok("Record Saved"));
            }
            catch (Exception ex) { return(BadRequest("Record can not be saved")); }
        }
Esempio n. 15
0
        private void tsbDel_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtsheet_no.Text.Trim() != "")
                {
                    string sheet_no = txtsheet_no.Text.Trim();

                    if (System.Windows.Forms.MessageBox.Show("确认删除单据" + sheet_no + "?", "提示", MessageBoxButtons.YesNo) == DialogResult.Yes)
                    {
                        IBLL.ICusPriceOrder bll = new BLL.CusPriceOrderBLL();
                        bll.Delete(sheet_no);
                        IOrder ins = this;
                        ins.Add();
                    }
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
Esempio n. 16
0
        private void tsbDel_Click(object sender, EventArgs e)
        {
            if (!MyLove.PermissionsBalidation(this.Text, "02"))
            {
                return;
            }
            if (string.IsNullOrEmpty(this.txtSheet_no.Text))
            {
                return;
            }

            if (YesNoForm.ShowFrom("确认要删除吗?") == DialogResult.Yes)
            {
                IBLL.ICheckBLL bll = new BLL.CheckBLL();
                bll.DeleteChectInitSheet(new ic_t_check_init()
                {
                    sheet_no = this.txtSheet_no.Text, update_time = DateTime.Now
                });

                IOrder order = this;
                order.Add();
            }
        }
Esempio n. 17
0
        public frmOtherInOutSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("other3");
            tb.Columns.Add("stock_qty", typeof(decimal));
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("discount", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("other1");
            tb.Columns.Add("valid_date", typeof(DateTime));
            tb.Columns.Add("price", typeof(decimal));//参考进价

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("stock_qty", "库存", "", 80, 3, "0.00", false);
            editGrid1.AddColumn("in_qty", "数量", "", 80, 3, "0.00", true);
            editGrid1.AddColumn("valid_price", "单价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sub_amount", "金额", "", 100, 3, "0.00", false);
            //editGrid1.AddColumn("", "特价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("other1", "备注", "", 150, 1, "", true);
            //editGrid1.AddColumn("", "生产批号", "", 120, 3, "0.00", true);
            //editGrid1.AddColumn("", "库位", "", 120, 3, "0.00", true);
            editGrid1.AddColumn("price", "参考进价", "", 100, 3, "0.00", false);
            editGrid1.SetTotalColumn("in_qty,sub_amount");//合计项
            editGrid1.DataSource = tb;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        //
                        var branch = bll2.GetBranchList();

                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });
                        DataTable dt2 = new DataTable();
                        dt2.Columns.Add("trans_no");
                        dt2.Columns.Add("trans_name");
                        dt2.Rows.Add("01", "其它入库");
                        dt2.Rows.Add("02", "归还");
                        dt2.Rows.Add("03", "其它出库");
                        dt2.Rows.Add("04", "领用出库");
                        dt2.Rows.Add("05", "报损出库");
                        dt2.Rows.Add("06", "借出");
                        dt2.Rows.Add("07", "报溢入库");
                        dt2.Rows.Add("09", "库存调整");

                        this.txt_trans_no.Invoke((MethodInvoker) delegate
                        {
                            txt_trans_no.Bind(dt2, 250, 200, "trans_no", "trans_no:编码:80,trans_name:业务类型:100", "trans_no/trans_name->Text");
                        });

                        var deal = bll2.GetPeopleList();
                        this.txt_deal_man.Invoke((MethodInvoker) delegate
                        {
                            txt_deal_man.Bind(deal, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmOtherInOutSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmOtherInOutSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 18
0
 private void OrderMerge_Shown(object sender, EventArgs e)
 {
     order.Add();
 }
        public frmCusPriceOrder()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("price", typeof(decimal));
            tb.Columns.Add("old_price", typeof(decimal));
            tb.Columns.Add("old_price2", typeof(decimal));
            tb.Columns.Add("old_price3", typeof(decimal));
            tb.Columns.Add("new_price", typeof(decimal));
            tb.Columns.Add("new_price2", typeof(decimal));
            tb.Columns.Add("new_price3", typeof(decimal));

            editGrid1.AddColumn("item_subno", "货号", "", 90, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 110, 1, "", false);
            editGrid1.AddColumn("price", "参考成本", "", 110, 3, "0.00", false);
            editGrid1.AddColumn("old_price", "原价", "一级批发价", 90, 3, "0.00", false);
            editGrid1.AddColumn("new_price", "新价", "一级批发价", 90, 3, "0.00", true);
            editGrid1.AddColumn("old_price2", "原价", "二级批发价", 90, 3, "0.00", false);
            editGrid1.AddColumn("new_price2", "新价", "二级批发价", 90, 3, "0.00", true);
            editGrid1.AddColumn("old_price3", "原价", "三级批发价", 90, 3, "0.00", false);


            editGrid1.AddColumn("new_price3", "新价", "三级批发价", 100, 3, "0.00", true);
            editGrid1.DataSource = tb;
            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        BLL.CusPriceOrderBLL bll = new BLL.CusPriceOrderBLL();
                        IBLL.ICommonBLL bll2     = new BLL.CommonBLL();

                        var branch_tb = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text");
                        });

                        var people_tb = bll2.GetPeopleList();
                        this.txtpeople.Invoke((MethodInvoker) delegate
                        {
                            txtpeople.Bind(people_tb, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmCusPriceOrder", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 20
0
 public static int Add(OrderInfo entity)
 {
     return(dal.Add(entity));
 }
Esempio n. 21
0
        public frmSaleSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("other3");
            tb.Columns.Add("sale_qnty", typeof(decimal));
            tb.Columns.Add("real_price", typeof(decimal));
            tb.Columns.Add("sale_money", typeof(decimal));
            tb.Columns.Add("other5");

            editGrid1.AddColumn("item_subno", "货号", "", 120, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("other3", "赠送", "", 60, 2, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("sale_qnty", "数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("real_price", "实际价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sale_money", "实际金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("other5", "备注明细", "", 150, 1, "", true);

            editGrid1.SetTotalColumn("sale_qnty,sale_money");//合计项
            editGrid1.DataSource = tb;
            editGrid1.BindCheck("other3");
            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();

                        var branch = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text");
                        });

                        var sale = bll2.GetPeopleList();
                        this.txt_sale_man.Invoke((MethodInvoker) delegate
                        {
                            txt_sale_man.Bind(sale, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text");
                        });

                        var cust = bll2.GetAllCustList();
                        this.txt_cust.Invoke((MethodInvoker) delegate
                        {
                            txt_cust.Bind(cust, 350, 200, "supcust_no", "supcust_no:编号:80,sup_name:名称:200", "supcust_no/sup_name->Text");
                        });

                        IBLL.IInOutBLL bll3 = new BLL.InOutBLL();
                        var order           = bll3.GetImportSSSheet();
                        this.txt_voucher_no.Invoke((MethodInvoker) delegate
                        {
                            this.txt_voucher_no.Bind(order, 350, 200, "sheet_no", "sheet_no:单据号:110,supcust:客户:100,branch:仓库:100,oper_date:日期:150", "sheet_no->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmSaleSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmSaleSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 22
0
        public frmIOMaster()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("ret_qnty", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("cost_price", typeof(decimal));
            tb.Columns.Add("num1", typeof(decimal));//参考进价

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("in_qty", "数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("ret_qnty", "实拣数", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("valid_price", "调拨价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sub_amount", "调拨金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("cost_price", "调出价", "", 150, 3, "0.00", false);
            editGrid1.AddColumn("num1", "调出金额", "", 100, 3, "0.00", false);
            editGrid1.SetTotalColumn("in_qty,ret_qnty,sub_amount,num1");//合计项
            editGrid1.DataSource = tb;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        var branch           = bll2.GetBranchList();
                        this.txtBranchIn.Invoke((MethodInvoker) delegate
                        {
                            txtBranchIn.Bind(branch, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });

                        var branchout = bll2.GetBranchList();
                        this.txt_BranchOut.Invoke((MethodInvoker) delegate
                        {
                            txt_BranchOut.Bind(branchout, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmIOMaster", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmIOMaster()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 23
0
        public frmSupSettle()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("select_flag");
            tb.Columns.Add("path");
            tb.Columns.Add("voucher_no");
            tb.Columns.Add("voucher_first");
            tb.Columns.Add("sheet_amount", typeof(decimal));
            tb.Columns.Add("paid_amount", typeof(decimal));
            tb.Columns.Add("paid_free", typeof(decimal));
            tb.Columns.Add("yf_amount", typeof(decimal));
            tb.Columns.Add("pay_amount", typeof(decimal));
            tb.Columns.Add("pay_free", typeof(decimal));
            tb.Columns.Add("pay_date", typeof(DateTime));
            tb.Columns.Add("memo");
            tb.Columns.Add("voucher_type");

            editGrid1.AddColumn("select_flag", "核销", "", 50, 2, "", false);
            editGrid1.AddColumn("path", "方向", "", 50, 2, "{-1:-,1:+}", false);
            editGrid1.AddColumn("voucher_no", "业务单号", "", 150, 1, "", false);
            editGrid1.AddColumn("voucher_first", "业务类型", "", 90, 2, IvyTransFunction.tran_no_str, false);
            editGrid1.AddColumn("sheet_amount", "单据金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("paid_amount", "已付金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("paid_free", "已免付金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("yf_amount", "应付金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("pay_amount", "本次付款金额", "", 120, 3, "0.00", true);
            editGrid1.AddColumn("pay_free", "免付金额", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("pay_date", "限付日期", "", 100, 3, "yyyy-MM-dd", false);
            editGrid1.AddColumn("memo", "备注", "", 180, 1, "", true);
            editGrid1.AddColumn("voucher_type", "业务描述", "", 100, 1, "", false);

            editGrid1.SetTotalColumn("pay_amount,pay_free");
            editGrid1.BindCheck("select_flag");
            editGrid1.DataSource = tb;
            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        BLL.SupFY bll = new BLL.SupFY();

                        var sup = bll.GetSupList();
                        this.txtsup.Invoke((MethodInvoker) delegate
                        {
                            this.txtsup.Bind(sup, 300, 200, "supcust_no", "supcust_no:货商编码:100,sup_name:货商名称:150", "supcust_no/sup_name->Text");
                        });

                        IBLL.IPayment paymentBLL = new BLL.PaymentBLL();
                        var pay_way = paymentBLL.GetAllList();
                        this.txtpay_way.Invoke((MethodInvoker) delegate
                        {
                            txtpay_way.Bind(pay_way, 300, 200, "pay_way", "pay_way:付款代码:100,pay_name:付款方式:100", "pay_way/pay_name->Text");
                            txtpay_way.GetDefaultValue();
                        });

                        var visa = bll.GetBankList();
                        this.txtvisa.Invoke((MethodInvoker) delegate
                        {
                            txtvisa.Bind(visa, 300, 200, "visa_id", "visa_id:编号:100,visa_nm:名称:130", "visa_id/visa_nm->Text");
                            txtvisa.GetDefaultValue();
                        });

                        var branch = bll.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text");
                        });

                        IBLL.IPeople peopleBLL = new BLL.PeopleBLL();
                        int tmp;
                        var people = peopleBLL.GetDataTable("", "", 1, 1, 20000, out tmp);

                        this.txtpeople.Invoke((MethodInvoker) delegate
                        {
                            txtpeople.Bind(people, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text");
                            txtpeople.GetDefaultValue();
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmSupSettle", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 24
0
        public frmCGOrder()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("order_qnty", typeof(decimal));
            tb.Columns.Add("in_price", typeof(decimal));
            tb.Columns.Add("discount", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("other1");

            editGrid1.AddColumn("item_subno", "货号", "", 120, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 60, 2, "", false);
            editGrid1.AddColumn("order_qnty", "总数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("in_price", "单价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("discount", "折扣", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("sub_amount", "金额", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("other1", "备注", "", 150, 1, "", true);
            editGrid1.SetTotalColumn("order_qnty,sub_amount");//合计项
            editGrid1.DataSource = tb;
            editGrid1.IsShowIco  = true;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                Thread th = new Thread(() =>
                {
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        var branch_tb        = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });
                        var sup_tb = bll2.GetAllSupList();
                        this.txt_sup.Invoke((MethodInvoker) delegate
                        {
                            txt_sup.Bind(sup_tb, 350, 200, "supcust_no", "supcust_no:编号:80,sup_name:名称:200", "supcust_no/sup_name->Text");
                        });
                        var deal_tb = bll2.GetPeopleList();
                        this.txt_order_man.Invoke((MethodInvoker) delegate
                        {
                            txt_order_man.Bind(deal_tb, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        LogHelper.writeLog("frmCGOrder", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmCGOrder()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 25
0
        public frmSaleInSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("other1");
            tb.Columns.Add("valid_date", typeof(DateTime));
            tb.Columns.Add("price", typeof(decimal));//参考进价

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("in_qty", "数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("valid_price", "单价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sub_amount", "金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("other1", "备注", "", 150, 1, "", true);
            editGrid1.AddColumn("price", "参考进价", "", 100, 3, "0.00", false);
            editGrid1.SetTotalColumn("in_qty,sub_amount");//合计项
            editGrid1.DataSource = tb;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //


                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();

                        var branch = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });

                        var cust = bll2.GetAllCustList();
                        this.txt_cust.Invoke((MethodInvoker) delegate
                        {
                            txt_cust.Bind(cust, 350, 200, "supcust_no", "supcust_no:编号:80,sup_name:名称:200", "supcust_no/sup_name->Text");
                        });

                        var deal = bll2.GetPeopleList();
                        this.txt_deal_man.Invoke((MethodInvoker) delegate
                        {
                            txt_deal_man.Bind(deal, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmSaleInSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmSaleInSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 26
0
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            IOrder ins = this;

            ins.Add();
        }
Esempio n. 27
0
        public frmCashOrder()
        {
            InitializeComponent();

            Helper.GlobalData.InitForm(this);
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //
                Thread th = new Thread(() =>
                {
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.IPayment paymentBLL = new BLL.PaymentBLL();
                        var pay_way_tb           = paymentBLL.GetAllList();
                        this.txtpay_way.Invoke((MethodInvoker) delegate
                        {
                            this.txtpay_way.Bind(pay_way_tb, 300, 200, "pay_way", "pay_way:类型编码:100,pay_name:付款类型:150",
                                                 "pay_way/pay_name->Text");
                        });
                        IBLL.IBank bankBLL = new BLL.BankBLL();
                        var bank_tb        = bankBLL.GetAllList();
                        this.txtpay_way.Invoke((MethodInvoker) delegate
                        {
                            this.txtvisa.Bind(bank_tb, 300, 200, "visa_id", "visa_id:编号:100,visa_nm:名称:130",
                                              "visa_id/visa_nm->Text");
                        });
                        var bank_tb2 = bankBLL.GetAllList();
                        this.txtvisa2.Invoke((MethodInvoker) delegate
                        {
                            txtvisa2.Bind(bank_tb2, 300, 200, "visa_id", "visa_id:编号:100,visa_nm:名称:130",
                                          "visa_id/visa_nm->Text");
                        });
                        IBLL.IBranch branchBLL = new BLL.BranchBLL();
                        var branch_tb          = branchBLL.GetAllList(4);
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text");
                        });
                        IBLL.IPeople peopleBLL = new BLL.PeopleBLL();
                        int tmp;
                        var people_tb = peopleBLL.GetDataTable("", "", 1, 1, 20000, out tmp);
                        this.txtpeople.Invoke((MethodInvoker) delegate
                        {
                            txtpeople.Bind(people_tb, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        LogHelper.writeLog("frmCashOrder", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Helper.GlobalData.windows.CloseLoad(this);
                    Cursor.Current = Cursors.Default;
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 28
0
        public frmCGInSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("other3");
            tb.Columns.Add("in_qty", typeof(decimal));
            tb.Columns.Add("valid_price", typeof(decimal));
            tb.Columns.Add("discount", typeof(decimal));
            tb.Columns.Add("sub_amount", typeof(decimal));
            tb.Columns.Add("other1");
            tb.Columns.Add("valid_date", typeof(DateTime));
            tb.Columns.Add("price", typeof(decimal));//参考进价

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("in_qty", "数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("valid_price", "单价", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("discount", "折扣", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sub_amount", "金额", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("other1", "备注", "", 150, 1, "", true);
            editGrid1.AddColumn("valid_date", "有效期", "", 100, 1, "yyyy-MM-dd", true);
            editGrid1.AddColumn("price", "参考进价", "", 100, 3, "0.00", false);
            editGrid1.SetTotalColumn("in_qty,sub_amount");//合计项
            editGrid1.DataSource = tb;
            editGrid1.IsShowIco  = true;
            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                Thread th = new Thread(() =>
                {
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        var branch_tb        = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });
                        DataTable dt2 = new DataTable();
                        dt2.Columns.Add("sale_no");
                        dt2.Columns.Add("sale_name");
                        dt2.Rows.Add("A", "购销");
                        dt2.Rows.Add("B", "代销");
                        dt2.Rows.Add("C", "联营");
                        dt2.Rows.Add("E", "联营进货");
                        dt2.Rows.Add("Z", "租赁");

                        this.txt_sale_no.Invoke((MethodInvoker) delegate
                        {
                            txt_sale_no.Bind(dt2, 250, 200, "sale_no", "sale_no:编码:80,sale_name:代销方式:100", "sale_no/sale_name->Text");
                        });
                        var sup_tb = bll2.GetAllSupList();
                        this.txt_sup.Invoke((MethodInvoker) delegate
                        {
                            txt_sup.Bind(sup_tb, 350, 200, "supcust_no", "supcust_no:编号:80,sup_name:名称:200", "supcust_no/sup_name->Text");
                        });
                        var deal_tb = bll2.GetPeopleList();
                        this.txt_deal_man.Invoke((MethodInvoker) delegate
                        {
                            txt_deal_man.Bind(deal_tb, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        IBLL.IInOutBLL bll3 = new BLL.InOutBLL();
                        var order           = bll3.GetImportCGOrder();
                        this.txt_voucher_no.Invoke((MethodInvoker) delegate
                        {
                            this.txt_voucher_no.Bind(order, 350, 200, "sheet_no", "sheet_no:单据号:110,supcust:供应商:100,branch:仓库:100,oper_date:日期:150", "sheet_no->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        LogHelper.writeLog("frmCGInSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmCGInSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 29
0
        public frmSupFY()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("kk_no");
            tb.Columns.Add("kk_name");
            tb.Columns.Add("kk_cash");
            tb.Columns.Add("pay_kind");
            tb.Columns.Add("other1");

            editGrid1.AddColumn("kk_no", "费用代码", "", 90, 1, "", true);
            editGrid1.AddColumn("kk_name", "费用名称", "", 140, 1, "", false);
            editGrid1.AddColumn("kk_cash", "费用(金额)", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("pay_kind", "应收增减", "", 75, 2, "{0:-,1:+}", false);
            editGrid1.AddColumn("other1", "备注", "", 250, 1, "", true);
            editGrid1.DataSource = tb;
            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //


                System.Threading.Thread th = new System.Threading.Thread(() =>
                {
                    Cursor.Current = Cursors.WaitCursor;
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        BLL.SupFY bll = new BLL.SupFY();

                        var editgrid = bll.GetSZList();
                        this.editGrid1.Invoke((MethodInvoker) delegate
                        {
                            var edgrid = editgrid.Copy();
                            foreach (DataRow dr in edgrid.Rows)
                            {
                                dr["pay_kind"] = dr["pay_kind"].ToInt32() == 0 ? "-" : "+";
                            }
                            editGrid1.Bind("kk_no", edgrid, 400, 200, "pay_way", "pay_way:费用代码:80,pay_name:费用名称:150,pay_kind:方向:60", "pay_way->kk_no,pay_name->kk_name,pay_kind->pay_kind");
                        });

                        var cus = bll.GetSupList();
                        this.txtcus.Invoke((MethodInvoker) delegate
                        {
                            this.txtcus.Bind(cus, 300, 200, "supcust_no", "supcust_no:客户编码:100,sup_name:客户名称:150", "supcust_no/sup_name->Text");
                        });

                        var visa = bll.GetBankList();
                        this.txtvisa.Invoke((MethodInvoker) delegate
                        {
                            txtvisa.Bind(visa, 300, 200, "visa_id", "visa_id:编号:100,visa_nm:名称:130", "visa_id/visa_nm->Text");
                            txtvisa.GetDefaultValue();
                        });

                        var branch = bll.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch, 300, 200, "branch_no", "branch_no:机构号:80,branch_name:机构名:140", "branch_no/branch_name->Text");
                        });

                        IBLL.IPeople peopleBLL = new BLL.PeopleBLL();
                        int tmp;
                        var people = peopleBLL.GetDataTable("", "", 1, 1, 20000, out tmp);

                        this.txtpeople.Invoke((MethodInvoker) delegate
                        {
                            txtpeople.Bind(people, 250, 200, "oper_id", "oper_id:职员编号:80,oper_name:姓名:80", "oper_id/oper_name->Text");
                            txtpeople.GetDefaultValue();
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        IvyBack.Helper.LogHelper.writeLog("frmSupFY", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Cursor.Current = Cursors.Default;
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }
Esempio n. 30
0
        public frmCheckSheet()
        {
            InitializeComponent();
            //
            Helper.GlobalData.InitForm(this);
            //
            var tb = new DataTable();

            tb.Columns.Add("item_no");
            tb.Columns.Add("item_subno");
            tb.Columns.Add("barcode");
            tb.Columns.Add("item_name");
            tb.Columns.Add("unit_no");
            tb.Columns.Add("item_size");
            tb.Columns.Add("item_pack");
            tb.Columns.Add("stock_qty", typeof(decimal));
            tb.Columns.Add("real_qty", typeof(decimal));
            tb.Columns.Add("packqty", typeof(decimal));
            tb.Columns.Add("sgqty", typeof(decimal));
            tb.Columns.Add("balance_qty", typeof(decimal));
            tb.Columns.Add("in_price", typeof(decimal));
            tb.Columns.Add("real_amount", typeof(decimal));
            tb.Columns.Add("sale_price", typeof(decimal));

            editGrid1.AddColumn("item_subno", "货号", "", 100, 1, "", true);
            editGrid1.AddColumn("barcode", "条码", "", 120, 1, "", true);
            editGrid1.AddColumn("item_name", "商品名称", "", 150, 1, "", false);
            editGrid1.AddColumn("unit_no", "单位", "", 60, 2, "", false);
            editGrid1.AddColumn("item_size", "规格", "", 80, 1, "", false);
            editGrid1.AddColumn("stock_qty", "系统库存", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("real_qty", "实际盘点数量", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("item_pack", "包装数量", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("packqty", "箱数", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("sgqty", "零数", "", 100, 3, "0.00", true);
            editGrid1.AddColumn("balance_qty", "盈亏数量", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("in_price", "成本价", "", 100, 3, "0.00", false);
            editGrid1.AddColumn("real_amount", "盈亏金额", "", 100, 3, "0.00", false);

            editGrid1.SetTotalColumn("balance_qty,real_amount");//合计项
            editGrid1.DataSource = tb;

            //
            try
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;
                //

                Thread th = new Thread(() =>
                {
                    Helper.GlobalData.windows.ShowLoad(this);
                    try
                    {
                        IBLL.ICommonBLL bll2 = new BLL.CommonBLL();
                        var branch_tb        = bll2.GetBranchList();
                        this.txtbranch.Invoke((MethodInvoker) delegate
                        {
                            txtbranch.Bind(branch_tb, 300, 200, "branch_no", "branch_no:编号:80,branch_name:名称:140", "branch_no/branch_name->Text");
                        });

                        var deal_tb = bll2.GetPeopleList();
                        this.txt_deal_man.Invoke((MethodInvoker) delegate
                        {
                            txt_deal_man.Bind(deal_tb, 250, 200, "oper_id", "oper_id:编号:80,oper_name:姓名:100", "oper_id/oper_name->Text");
                        });

                        IBLL.ICheckBLL bll = new BLL.CheckBLL();
                        var check_tb       = bll.GetCheckInitList();
                        this.txt_check_no.Invoke((MethodInvoker) delegate
                        {
                            txt_check_no.Bind(check_tb, 250, 200, "sheet_no", "sheet_no:单据号:120,branch_name:机构:120,oper_name:操作员:120,begin_date:起始日期:120", "sheet_no->Text");
                        });

                        this.Invoke((MethodInvoker) delegate
                        {
                            IOrder ins = this;
                            ins.Add();
                        });
                    }
                    catch (Exception ex)
                    {
                        LogHelper.writeLog("frmCheckSheet", ex.ToString());
                        MsgForm.ShowFrom(ex);
                    }
                    Helper.GlobalData.windows.CloseLoad(this);
                });
                th.Start();
            }
            catch (Exception ex)
            {
                MsgForm.ShowFrom(ex);
                Helper.LogHelper.writeLog("frmCheckSheet()", ex.ToString());
            }
            finally
            {
                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default;
            }
        }