Beispiel #1
0
        private void barButtonItem5_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            for (int i = 0; WaybillDetOutGridView.RowCount > i; i++)
            {
                var row = WaybillDetOutGridView.GetRow(i) as GetWayBillDetOut_Result;
                if (row.PosType == 0)
                {
                    var wbd = _db.WaybillDet.Find(row.PosId);
                    wbd.Num = i + 1;
                }
                if (row.PosType == 1)
                {
                    var wds = _db.WayBillSvc.Find(row.PosId);
                    wds.Num = i + 1;
                }

                if (row.PosType == 2)
                {
                    var wbt = _db.WayBillTmc.Find(row.PosId);
                    wbt.Num = i + 1;
                }
            }
            _db.SaveChanges();
            RefreshDet();
        }
Beispiel #2
0
        private void EditMaterialBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var dr = WaybillDetOutGridView.GetRow(WaybillDetOutGridView.FocusedRowHandle) as GetWayBillDetOut_Result;

            if (dr != null)
            {
                new frmWBReturnDetOut(_db, dr.PosId, wb, (int)KagentComboBox.EditValue).ShowDialog();

                RefreshDet();
            }
        }
Beispiel #3
0
        private void EditMaterialBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var dr = WaybillDetOutGridView.GetRow(WaybillDetOutGridView.FocusedRowHandle) as GetWayBillDetOut_Result;

            if (dr != null)
            {
                using (var frm = new frmWriteOffDet(_db, dr.PosId, wb))
                {
                    frm.ShowDialog();
                }
                RefreshDet();
            }
        }
Beispiel #4
0
        private void DelMaterialBtn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var dr = WaybillDetOutGridView.GetRow(WaybillDetOutGridView.FocusedRowHandle) as GetWayBillMakeDet_Result;

            if (dr != null)
            {
                DelRsvBarBtn.PerformClick();

                _db.DeleteWhere <WaybillDet>(w => w.PosId == dr.PosId);
                _db.SaveChanges();

                RefreshDet();
            }
        }
Beispiel #5
0
        private void WaybillDetOutGridView_RowCellStyle(object sender, RowCellStyleEventArgs e)
        {
            if (e.RowHandle < 0)
            {
                return;
            }

            var wh_row = WaybillDetOutGridView.GetRow(e.RowHandle) as GetWayBillDetOut_Result;

            if (wh_row != null && e.Column.FieldName == "Price")
            {
                if (wh_row.AvgInPrice > wh_row.Price)
                {
                    e.Appearance.ForeColor = Color.Red;
                }
            }
        }