private void frmProductProcess_Shown(object sender, EventArgs e) { strBillFlag = "PS"; strMTable = "t_ProductProcess"; strMasterSQL = "select * from t_ProductProcess where F_BillID = @Value"; strSlaverSQL = "select * from t_ProductProcessDetail where F_BillID = @Value"; strSaveSlaverSQL = "select * from t_ProductProcessDetail where F_BillID = @Value"; SetDropSource(); if (strBillID == "") { NewBill(); } else { BindData(); DataRow dr = ((DataRowView)binMaster.Current).Row; DataLib.sysClass myClass = new DataLib.sysClass(); DataRow drItem = myClass.FindItem(dr["F_ItemID"].ToString()); if (drItem != null) { editControl7.SetValue(drItem["F_Name"].ToString()); editControl8.SetValue(drItem["F_Spec"].ToString()); editControl9.SetValue(drItem["F_Unit"].ToString()); } } }
private void frmInstall_Shown(object sender, EventArgs e) { strBillFlag = "IT"; strMTable = "t_Install"; strMasterSQL = "select * from t_Install where F_BillID = @Value"; strSlaverSQL = "select a.*,b.F_Name as F_ItemName,b.F_Spec,F_Material,b.F_Brand,(select F_Name from t_Class where F_ID = b.F_Type) as F_Type "; strSlaverSQL = strSlaverSQL + "from t_InstallDetail a,t_Item b "; strSlaverSQL = strSlaverSQL + "where a.F_ItemID = b.F_ID "; strSlaverSQL = strSlaverSQL + "and F_BillID = @Value"; strSaveSlaverSQL = "select * from t_InstallDetail where F_BillID = @Value"; SetDropSource(); if (strBillID == "") { NewBill(); } else { BindData(); DataRow dr = ((DataRowView)binMaster.Current).Row; DataLib.sysClass myClass = new DataLib.sysClass(); DataRow drItem = myClass.FindItem(dr["F_ItemID"].ToString()); if (drItem != null) { editControl7.SetValue(drItem["F_Name"].ToString()); editControl8.SetValue(drItem["F_Spec"].ToString()); } } }
private void frmBomEdit_Shown(object sender, EventArgs e) { strBillFlag = "BM"; strMTable = "t_Bom"; strMasterSQL = "select * from t_Bom where F_BillID = @Value"; strSlaverSQL = @"select a.*,b.F_Name as F_ItemName,b.F_Spec,b.F_Brand,b.F_Color,b.F_StockPrice as F_Price from t_BomDetail a,t_Item b where a.F_ItemID = b.F_ID and F_BillID = '" + strBillID + @"' order by a.Aid"; strSaveSlaverSQL = "select * from t_BomDetail where F_BillID = @Value"; if (strBillID == "") { NewBill(); if (strItemID != "") { CopyBom(); } } else { BindData(); DataRow dr = ((DataRowView)binMaster.Current).Row; DataLib.sysClass myClass = new DataLib.sysClass(); DataRow drItem = myClass.FindItem(dr["F_ItemID"].ToString()); if (drItem != null) { editControl7.SetValue(drItem["F_Name"].ToString()); editControl8.SetValue(drItem["F_Spec"].ToString()); editControl9.SetValue(drItem["F_Unit"].ToString()); } } }
private void sbSelItem_Click(object sender, EventArgs e) { Common.frmSelItem mySelItem = new Common.frmSelItem(); mySelItem.intTag = 1; DataRow dr = null; if (mySelItem.ShowDialog() == DialogResult.OK) { if (mySelItem.TabControl.SelectedTabPageIndex == 0) { if (mySelItem.gvMain.FocusedRowHandle >= 0) { dr = mySelItem.gvMain.GetDataRow(mySelItem.gvMain.FocusedRowHandle); DataLib.sysClass myClass = new DataLib.sysClass(); DataRow drItem = myClass.FindItem(dr["F_ID"].ToString()); DataTable dt = ((DataView)binMaster.DataSource).Table; DataRow drNew = dt.Rows[0]; drNew["F_ItemID"] = drItem["F_ID"]; editControl7.SetValue(drItem["F_Name"].ToString()); editControl8.SetValue(drItem["F_Spec"].ToString()); drNew["F_Unit"] = drItem["F_Unit"]; drNew["F_StorageID"] = drItem["F_StorageID"]; drNew["F_Color"] = drItem["F_Color"]; drNew["F_Grade"] = drItem["F_Grade"]; binMaster.EndEdit(); } } else { if (mySelItem.gvStore.FocusedRowHandle >= 0) { dr = mySelItem.gvStore.GetDataRow(mySelItem.gvStore.FocusedRowHandle); //DataLib.sysClass myClass = new DataLib.sysClass(); //DataRow drItem = myClass.FindItem(dr["F_ID"].ToString()); DataTable dt = ((DataView)binMaster.DataSource).Table; DataRow drNew = dt.Rows[0]; drNew["F_ItemID"] = dr["F_ID"]; editControl7.SetValue(dr["F_Name"].ToString()); editControl8.SetValue(dr["F_Spec"].ToString()); drNew["F_Unit"] = dr["F_Unit"]; drNew["F_StorageID"] = dr["F_StorageID"]; drNew["F_BatchNo"] = dr["F_BatchNo"]; drNew["F_Color"] = dr["F_Color"]; drNew["F_Grade"] = dr["F_Grade"]; binMaster.EndEdit(); } } } mySelItem.Dispose(); }
private void ItemBtnClick1(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { Common.frmSelItem mySelItem = new Common.frmSelItem(); if (mySelItem.ShowDialog() == DialogResult.OK) { if (mySelItem.gvMain.FocusedRowHandle >= 0) { DataRow dr; if (mySelItem.TabControl.SelectedTabPageIndex == 0) { dr = mySelItem.gvMain.GetDataRow(mySelItem.gvMain.FocusedRowHandle); } else { dr = mySelItem.gvStore.GetDataRow(mySelItem.gvStore.FocusedRowHandle); } DataLib.sysClass myClass = new DataLib.sysClass(); DataRow drTmp = myClass.FindItem(dr["F_ID"].ToString()); if (drTmp == null) { return; } DataRow drItem = ((DataRowView)binItem.Current).Row; drItem["F_ItemID"] = drTmp["F_ID"]; drItem["F_ItemName"] = drTmp["F_Name"]; drItem["F_Spec"] = drTmp["F_Spec"]; drItem["F_Brand"] = drTmp["F_Brand"]; drItem["F_Material"] = drTmp["F_Material"]; drItem["F_Type"] = drTmp["F_TypeName"]; drItem["F_Unit"] = drTmp["F_Unit"]; binItem.EndEdit(); } } mySelItem.Dispose(); }