Example #1
0
        private void ItemButtonEdit人员_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            string    sSQL = "select FCode as 编码,FName as 姓名 from  UFDLImport..EmployeeInfo order by FCode";
            DataTable dt   = clsSQLCommond.ExecQuery(sSQL);
            Frm列表参照   f    = new Frm列表参照(dt);

            f.ShowDialog();
            if (f.DialogResult == DialogResult.Yes)
            {
                string    s  = f.sKey;
                DataRow[] dr = dt.Select(" 编码 = '" + s + "' ");
                gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridCol人员, dr[0][1].ToString().Trim());
            }
        }
Example #2
0
        private void ItemButtonEdit母件编码_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            string sSQL = @"    
select distinct bas.InvCode as 母件编码,i.cInvName as 母件名称,i.cInvStd as 母件规格
from @u8.bom_bom b
   left join @u8.bom_parent bP on b.BomId=bP.BomId left join @u8.bas_part bas on bas.PartId = bP.ParentId 
   left join @u8.bom_opcomponent bOP on bOp.BomId = b.BomId left join @u8.bas_part bas2 on bOP.ComponentId = bas2.partid left join @u8.Inventory i on i.cInvCode =bas.InvCode
where bas2.Invcode = '111111'
order by bas.InvCode";

            sSQL = sSQL.Replace("111111", gridView1.GetRowCellDisplayText(gridView1.FocusedRowHandle, gridCol物料编码).ToString().Trim());
            DataTable dt = clsSQLCommond.ExecQuery(sSQL);
            Frm列表参照   f  = new Frm列表参照(dt);

            f.ShowDialog();
            if (f.DialogResult == DialogResult.Yes)
            {
                string    s  = f.sKey;
                DataRow[] dr = dt.Select(" 母件编码 = '" + s + "' ");
                gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridCol母件编码, dr[0][0].ToString().Trim());
                gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridCol母件名称, dr[0][1].ToString().Trim());
            }
        }