示例#1
0
 private void ManufLookUpEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     if (e.Button.Index == 1)
     {
         using (var frm = new frmManufacturing(_db, 0))
         {
             if (frm.ShowDialog() == DialogResult.OK)
             {
                 iw.WbillId = frm.wb_focused_row.WbillId;
             }
         }
     }
 }
示例#2
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            using (var frm = new frmManufacturing(_db, 2))
            {
                frm.xtraTabPage14.PageVisible            = true;
                frm.xtraTabControl1.SelectedTabPageIndex = 1;

                if (frm.ShowDialog() == DialogResult.OK)
                {
                    foreach (var item in frm.manuf_list.ToList())
                    {
                        var price = (item.Price ?? 0);

                        var wbd = _db.WaybillDet.Add(new WaybillDet
                        {
                            WbillId      = wb.WbillId,
                            Num          = wb.WaybillDet.Count(),
                            MatId        = item.MatId,
                            WId          = Convert.ToInt32(WHComboBox.EditValue),
                            Amount       = item.Amount,
                            Price        = price,
                            Discount     = 0,
                            Nds          = wb.Nds,
                            CurrId       = wb.CurrId,
                            OnDate       = wb.OnDate,
                            OnValue      = wb.OnValue,
                            BasePrice    = price + Math.Round(price * wb.Nds.Value / 100, 2),
                            PosKind      = 0,
                            PosParent    = 0,
                            DiscountKind = 0
                        });
                        _db.SaveChanges();

                        wbd.WayBillDetAddProps = new WayBillDetAddProps {
                            PosId = wbd.PosId, WbMaked = item.WbillId
                        };
                        _db.Serials.Add(new Serials
                        {
                            PosId    = wbd.PosId,
                            SerialNo = item.Num,
                            InvNumb  = item.BarCode
                        });
                    }

                    _db.SaveChanges();
                    RefreshDet();
                }
            }
        }
示例#3
0
        private void ManufEditBtn_Click(object sender, EventArgs e)
        {
            using (var frm = new frmManufacturing(_db, 2))
            {
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    wbdp.WbMaked     = frm.wb_focused_row.WbillId;
                    serials.SerialNo = frm.wb_focused_row.Num;

                    MatComboBox.EditValue   = frm.wb_focused_row.MatId;
                    AmountEdit.EditValue    = (frm.wb_focused_row.AmountOut ?? 0) - (frm.wb_focused_row.ShippedAmount ?? 0);
                    BasePriceEdit.EditValue = Math.Round((frm.wb_focused_row.SummAll / frm.wb_focused_row.AmountOut) ?? 0, 4);
                    PriceEdit.EditValue     = _wbd.BasePrice;

                    MatComboBox.Enabled = false;
                    MatEditBtn.Enabled  = false;
                    //   AmountEdit.Enabled = false;

                    GetOk();
                }
            }
        }