private void itemButton厂家代码_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (gridView发货计划明细.FocusedRowHandle != -1)
            {
                var list = gridControl发货计划明细.DataSource as List <V_ICSEOUTBILLENTRYMODEL>;
                var row  = list[gridView发货计划明细.GetDataSourceRowIndex(gridView发货计划明细.FocusedRowHandle)];

                FrmQuerySrc frm = new FrmQuerySrc(row.FITEMID);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    row.FSRCID    = frm.SelectData.FID;
                    row.FSRCNAME  = frm.SelectData.FSRCNAME;
                    row.FSRCCODE  = frm.SelectData.FSRCCODE;
                    row.FSRCMODEL = frm.SelectData.FSRCMODEL;
                    row.FSRCUNIT  = frm.SelectData.FUNIT;

                    //row.FHNAMOUNT = 0;

                    var askqty = row.FASKQTY;
                    if (frm.SelectData.FRATE != 0)
                    {
                        row.FCOMMITQTY = Math.Ceiling((row.FCOMMITQTY * row.FRATE) / frm.SelectData.FRATE);
                    }

                    row.FWEIGHT     = row.FCOMMITQTY * frm.SelectData.FWEIGHT;
                    row.FRATE       = frm.SelectData.FRATE;
                    row.FLEFTAMOUNT = askqty;

                    gridControl发货计划明细.DataSource = list;
                    gridControl发货计划明细.RefreshDataSource();

                    onCalcWeightTotal();
                }
            }
        }
        private void itemButton厂家代码_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (gridView发货计划明细.FocusedRowHandle != -1)
            {
                var list = gridControl采购订单明细.DataSource as List <V_ICPOBILLENTRYMODEL>;
                var row  = list[gridView发货计划明细.GetDataSourceRowIndex(gridView发货计划明细.FocusedRowHandle)];

                FrmQuerySrc frm = new FrmQuerySrc(row.FITEMID);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    //row.FSRCID = frm.SelectData.FID;


                    row.FSRCNAME  = frm.SelectData.FSRCNAME;
                    row.FSRCCODE  = frm.SelectData.FSRCCODE;
                    row.FSRCMODEL = frm.SelectData.FSRCMODEL;
                    //row.FSRCUNIT = frm.SelectData.FUNIT;

                    //row.FHNAMOUNT = 0;

                    /*
                     * var askqty = row.FASKQTY;
                     *
                     * if (frm.SelectData.FRATE != 0)
                     * {
                     * row.FCOMMITQTY = Math.Round((row.FCOMMITQTY * row.FRATE) / frm.SelectData.FRATE, 2);
                     *
                     * }
                     */
                    // row.FWEIGHT = row.FCOMMITQTY * frm.SelectData.FWEIGHT;
                    //  row.FRATE = frm.SelectData.FRATE;
                    //  row.FLEFTAMOUNT = askqty;

                    gridView发货计划明细.ActiveEditor.EditValue = frm.SelectData.FSRCCODE;
                    list = list.OrderBy(x => x.GG).ToList().OrderBy(x => x.GG).ToList();
                    gridControl采购订单明细.DataSource = list;
                    gridControl采购订单明细.RefreshDataSource();

                    onCalcWeightTotal();
                }
            }
        }