Example #1
0
        public decimal GetQty(ProInfo proinfo, decimal qty, bool CanDelete, bool CanEditQty)
        {
            // ucProInfo1.LeftField = "单价:" + new DALProInfo().GetPrice(proinfo.ProID, GlobalValue.GShop.AreaInfo.AreaID).Price.ToString("0.00");
            ucProInfo1.ProInfo = proinfo;
            if (qty != 0)
            {
                ucProInfo1.RightField = "数量:" + qty.ToString("0.00");
            }
            //ucProInfo1.LoadProInfo();

            this.btnDelete.Visible = CanDelete;
            ucProInfo1.Enabled = btnGet.Enabled = btnOK.Enabled = CanEditQty;
            decimal q = 0;

            switch (ShowDialog())
            {

                case DialogResult.Cancel:
                    q = 0;
                    break;
                case DialogResult.Ignore:
                    q = -1;
                    break;

                default:
                    decimal.TryParse(numInupt1.InputValue, out q);
                    break;
            }
            return q;
        }
Example #2
0
        void g_OnAddItem(ProInfo t, Rectangle position, Control gridcontainer)
        {
            uc.ucProInfo pi = new uc.ucProInfo();
            pi.Left = position.Left;
            pi.Top = position.Top;
            pi.Size = position.Size;

            pi.ProInfo = t;
            pi.OnSelectPro += new uc.ucProInfo.SelectPro(pi_OnSelectPro);
            gridcontainer.Controls.Add(pi);
        }
Example #3
0
 void pi_OnSelectPro(object sender, ProInfo proinfo)
 {
     this.Hide();
     //显示输入产品数量的窗口
     lbErrorInfo.Text = "";
     decimal qty = new ProQtyInput().GetQty(proinfo, 0, false);
     if (qty == 0)
     {
         this.Show();
         return;
     }
     else
     {
         if (OnProSelectQty != null)
         {
             if (!OnProSelectQty(proinfo, qty))
             {
                 lbErrorInfo.Text = "产品已经选择,不能重复选择";
                 this.Show();
             }
         }
     }
 }
Example #4
0
 public decimal GetQty(ProInfo proinfo, decimal qty, bool CanDelete)
 {
     return GetQty(proinfo, qty, CanDelete, true);
 }
Example #5
0
        bool proselect_OnProSelectQty(ProInfo proinfo, decimal qty)
        {
            if (sa.Where(x => x.ProInfo.ProID == proinfo.ProID).ToList().Count != 0)
            {
                return false;
            }
            Shop_AskData sad = new Shop_AskData();
            sad.ProInfo = proinfo;
            sad.Qty = qty;
            sad.ShopInfo = GlobalValue.GShop;
            sa.Add(sad);
            new DALShopAskData().Save(sad);
            //重画界面
            //跳转到当前类别的页面!
            bool isExistInCate = false;

            foreach (TabPage tp in tabControl1.TabPages)
            {
                if (tp.Text == proinfo.ProCate)
                { isExistInCate = true;
                tabControl1.SelectedTab = tp;
                    break; }
            }
            if (!isExistInCate)

            {
                TabPage tp = new TabPage();
                tp.Text = proinfo.ProCate;
                tp.Tag = 0;
                tabControl1.TabPages.Add(tp);
                tabControl1.SelectedTab = tp;

            }

            tabControl1.SelectedTab.Tag = 100;
            ShowByCateAndPageNo(tabControl1.SelectedTab,true);
            return true;
        }
Example #6
0
        void pi_OnSelectPro(object sender, ProInfo proinfo)
        {
            //显示输入产品数量的窗口
            uc.ucProInfo upi = (uc.ucProInfo)sender;
            Shop_AskData sad = (Shop_AskData)upi.Tag;

            decimal qty = new ProQtyInput().GetQty(proinfo, sad.Qty, true, true);
            if (qty == 0)
            {
                return;
            }
            else if (qty == -1)
            {
                sa.Remove(sad);
                new DALShopAskData().Delete(sad);
            }
            else
            {
                sad.Qty = qty;
                upi.RightField = "数量:" + qty.ToString("0.00");
                upi.LoadProInfo();
            }
        }
Example #7
0
 bool proselect_OnProSelectQty(ProInfo proinfo, decimal qty)
 {
     if (selllist.Details.Where(x => x.Pro.ProID == proinfo.ProID).ToList().Count != 0)
     {
         return false;
     }
     Shop_SellDetail ss = new Shop_SellDetail();
     ss.Pro = proinfo;
     ss.Price = proinfo.ProPrices.Single<ProPrice>(x => x.AreaInfo.AreaID == GlobalValue.GShop.AreaInfo.AreaID).Price;
     ss.Amount = qty;
     selllist.Details.Add(ss);
     //增加了一个产品,需要重新计算金额!
     lbAmount.Text = GetSumAmount();
     pnlselldetail.Tag = 100;
     //重画界面
     ShowSellDetailByPageNo(true);
     return true;
 }
Example #8
0
        void pi_OnSelectPro(object sender, ProInfo proinfo)
        {
            //进行修改数量,与删除的操作
            uc.ucProInfo pi = (uc.ucProInfo)((Control)sender).Parent;
            Shop_SellDetail ssd = (Shop_SellDetail)(pi.Tag);

            decimal qty = new ProQtyInput().GetQty(proinfo, ssd.Amount, true, string.IsNullOrEmpty(selllist.BackBillNo));
            if (qty == 0)
            {
                return;
            }
            else if (qty == -1)
            {
                //删除操作
                if (!string.IsNullOrEmpty(selllist.BackBillNo))
                {
                    ReMoveDetails.Add(ssd);
                }
                selllist.Details.Remove(ssd);
                ShowSellDetailByPageNo(true);
            }
            else
            {
                ssd.Amount = qty;
                pi.RightField = "数量:" + qty.ToString("0.00");
                pi.LoadProInfo();
            }
            lbAmount.Text = GetSumAmount();
        }