Beispiel #1
0
        private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            var dr  = PriceListGrid.GetRow(e.RowHandle) as GetPriceListDet_Result;
            var pld = _db.PriceListDet.Find(dr.PlDetId);

            if (e.Column.FieldName == "Price")
            {
                //dr.MatId
                pld.Price = Convert.ToDecimal(e.Value);
            }

            if (e.Column.FieldName == "Discount")
            {
                pld.Discount = Convert.ToDecimal(e.Value);
            }

            if (e.Column.FieldName == "Notes")
            {
                pld.Notes = Convert.ToString(e.Value);
            }

            if (e.Column.FieldName == "WId")
            {
                pld.WId = Convert.ToInt32(e.Value);
            }
        }
Beispiel #2
0
        private void PriceListGrid_RowStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e)
        {
            if (e.RowHandle < 0)
            {
                return;
            }

            var wh_row = PriceListGrid.GetRow(e.RowHandle) as GetPriceListDet_Result;

            if (wh_row != null && wh_row.Price < wh_row.LastInPrice)
            {
                e.Appearance.ForeColor = Color.Red;
            }
        }
Beispiel #3
0
        private void barButtonItem10_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            for (int i = 0; PriceListGrid.RowCount > i; i++)
            {
                var row = PriceListGrid.GetRow(i) as GetPriceListDet_Result;
                if (row != null)
                {
                    var wbd = _db.PriceListDet.Find(row.PlDetId);

                    wbd.Num = i + 1;
                }
            }

            _db.SaveChanges();

            GetDetail();
        }