锐腾搅拌上料功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

658 lines
25 KiB

5 months ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Data.Linq;
  6. using System.Linq;
  7. using System.Drawing;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using DevExpress.XtraEditors;
  11. using DevExpress.XtraGrid.Views.BandedGrid;
  12. using DevExpress.XtraGrid.Columns;
  13. using DevExpress.XtraGrid;
  14. using System.IO;
  15. using System.Threading;
  16. using ICSSoft.Base.Language.Tool;
  17. using ICSSoft.Base.Config.AppConfig;
  18. using ICSSoft.Base.UserControl.MessageControl;
  19. using ICSSoft.Base.Config.DBHelper;
  20. using ICSSoft.Base.Report.Filter;
  21. using ICSSoft.Base.UserControl.FormControl;
  22. using ICSSoft.Base.Report.GridReport;
  23. using ICSSoft.Base.ReferForm.AppReferForm;
  24. using ICSSoft.Frame.Data.BLL;
  25. using ICSSoft.Frame.Data.Entity;
  26. using ICSSoft.Frame.Data.DAL;
  27. namespace ICSSoft.Frame.APP
  28. {
  29. public partial class FormPhysicalInventory : DevExpress.XtraEditors.XtraForm
  30. {
  31. private string sqltxt = "";
  32. private string sqlconn = "";
  33. string path = "";
  34. List<string> barList = new List<string>();
  35. string errorBar = "";
  36. String guid = AppConfig.GetGuid();
  37. private DataTable dataSource = null;
  38. private DataTable BodySource = null;
  39. DataSet ds = new DataSet();
  40. DataTable HandDt;
  41. DataTable BodyDt;
  42. #region 构造函数
  43. public FormPhysicalInventory()
  44. {
  45. InitializeComponent();
  46. this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
  47. this.WindowState = FormWindowState.Maximized;
  48. }
  49. #endregion
  50. #region SystemOptition
  51. /// <summary>
  52. /// 操作权限
  53. /// </summary>
  54. /// <returns></returns>
  55. public DataTable RightOfExute()
  56. {
  57. DataTable rData = new DataTable();
  58. rData.Columns.Add("BtnName");
  59. rData.Columns.Add("ActionName");
  60. //查看权限(必须有)
  61. DataRow seeRow = rData.NewRow();
  62. seeRow["BtnName"] = "see";
  63. seeRow["ActionName"] = "查看";
  64. rData.Rows.Add(seeRow);
  65. List<Control> ControlList = new List<Control>();
  66. ControlList.Add(btnCreate);
  67. ControlList.Add(btnDel);
  68. ControlList.Add(btnOutPut);
  69. ControlList.Add(btnCheckIn);
  70. foreach (Control ctr in ControlList)
  71. {
  72. if (ctr.GetType() == typeof(SimpleButton))
  73. {
  74. DataRow dr = rData.NewRow();
  75. dr["BtnName"] = ctr.Name;
  76. dr["ActionName"] = ctr.Text;
  77. rData.Rows.Add(dr);
  78. }
  79. }
  80. rData.AcceptChanges();
  81. return rData;
  82. }
  83. /// <summary>
  84. /// 数据权限
  85. /// </summary>
  86. /// <returns></returns>
  87. public DataTable RightOfData()
  88. {
  89. DataTable rData = new DataTable();
  90. rData.Columns.Add("BodyName");
  91. rData.Columns.Add("ControlName");
  92. rData.Columns.Add("ControlCaption");
  93. rData.AcceptChanges();
  94. return rData;
  95. }
  96. #endregion
  97. #region 退出
  98. private void btnClose_Click(object sender, EventArgs e)
  99. {
  100. AppConfig.CloseFormShow(this.Text);
  101. this.Close();
  102. }
  103. private void btnExit_Click(object sender, EventArgs e)
  104. {
  105. AppConfig.CloseFormShow(this.Text);
  106. this.Close();
  107. }
  108. #endregion
  109. #region 移动窗体
  110. private const int WM_NCHITTEST = 0x84;
  111. private const int HTCLIENT = 0x1;
  112. private const int HTCAPTION = 0x2;
  113. //首先必须了解Windows的消息传递机制,当有鼠标活动消息时,
  114. //系统发送WM_NCHITTEST 消息给窗体作为判断消息发生地的根据。 nchittest
  115. //假如你点击的是标题栏,窗体收到的消息值就是 HTCAPTION ,
  116. //同样地,若接受到的消息是 HTCLIENT,说明用户点击的是客户区,也就是鼠标消息发生在客户区。
  117. //重写窗体,使窗体可以不通过自带标题栏实现移动
  118. protected override void WndProc(ref Message m)
  119. {
  120. //当重载窗体的 WndProc 方法时,可以截获 WM_NCHITTEST 消息并改些该消息,
  121. //当判断鼠标事件发生在客户区时,改写改消息,发送 HTCAPTION 给窗体,
  122. //这样,窗体收到的消息就时 HTCAPTION ,在客户区通过鼠标来拖动窗体就如同通过标题栏来拖动一样。
  123. //注意:当你重载 WndProc 并改写鼠标事件后,整个窗体的鼠标事件也就随之改变了。
  124. switch (m.Msg)
  125. {
  126. case WM_NCHITTEST:
  127. base.WndProc(ref m);
  128. if ((int)m.Result == HTCLIENT)
  129. m.Result = (IntPtr)HTCAPTION;
  130. return;
  131. }
  132. //拦截双击标题栏、移动窗体的系统消息
  133. if (m.Msg != 0xA3)
  134. {
  135. base.WndProc(ref m);
  136. }
  137. }
  138. #endregion
  139. #region 过滤
  140. private string tempTableName = "";
  141. private void btnFilter_Click(object sender, EventArgs e)
  142. {
  143. FormFilter filter = new FormFilter(AppConfig.GetSourceId(this.Tag.ToString(), btnConfig.Name));
  144. filter.OldTempTableName = tempTableName;
  145. if (filter.ShowDialog() == DialogResult.OK)
  146. {
  147. DevExpress.Utils.WaitDialogForm _wait = new DevExpress.Utils.WaitDialogForm("正在查找...请稍等...");
  148. try
  149. {
  150. _wait.Show();
  151. BodyDt = null;
  152. BodySource = null;
  153. ds.Reset();
  154. tempTableName = filter.NewTempTableName;
  155. sqltxt = filter.SqlText;
  156. sqlconn = filter.FilterConnectString;
  157. dataSource = filter.FilterData.Tables[0];
  158. DataSet Hset = new DataSet();
  159. dataSource.TableName = "Hsource";
  160. DataTable Hsource = dataSource.Copy();
  161. Hset.Tables.Add(Hsource);
  162. DataTable Hdt = dataSource.Copy();
  163. Hdt.Clear();
  164. BodySource = FormPhysicalInventoryBLL.FindAll(AppConfig.AppConnectString);
  165. DataSet Bset = new DataSet();
  166. dataSource.TableName = "Bsource";
  167. DataTable Bsource = BodySource.Copy();
  168. Bset.Tables.Add(Bsource);
  169. DataTable Bdt = BodySource.Copy();
  170. Bdt.Clear();
  171. DataSet dset = dataSetTool(Hdt, Bdt);
  172. dataSource = filter.FilterData.Tables[0];
  173. foreach (DataRow row in Hset.Tables[0].Rows)
  174. {
  175. dset.Tables["Hand"].Rows.Add(row.ItemArray);
  176. }
  177. foreach (DataRow row in Bset.Tables[0].Rows)
  178. {
  179. dset.Tables["Body"].Rows.Add(row.ItemArray);
  180. }
  181. grdDetail.DataSource = dset.Tables["Hand"];
  182. grvDetail.BestFitColumns();
  183. gridView1.BestFitColumns();
  184. rptPage.RecordNum = dataSource.Rows.Count;
  185. rptPage.PageSize = 499;
  186. rptPage.PageIndex = 1;
  187. rptPage.ReLoad();
  188. rptPage.PageSize = 500;
  189. rptPage.PageIndex = 1;
  190. //rptPage.ReLoad();
  191. _wait.Close();
  192. btnRefresh_Click(null, null);
  193. }
  194. catch (Exception ex)
  195. {
  196. MessageBox.Show("异常:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
  197. _wait.Close();
  198. }
  199. }
  200. }
  201. #endregion
  202. #region dataSet绑定
  203. private DataSet dataSetTool(DataTable hand, DataTable body)
  204. {
  205. DataColumn[] relations_dt, relations_ds;
  206. hand.TableName = "Hand";
  207. body.TableName = "Body";
  208. HandDt = hand.Copy();
  209. BodyDt = body.Copy();
  210. ds.Tables.Add(HandDt);
  211. ds.Tables.Add(BodyDt);
  212. relations_dt = new DataColumn[] { ds.Tables["Hand"].Columns["ItemCode"], ds.Tables["Hand"].Columns["ToCheckNO"], ds.Tables["Hand"].Columns["StorageCode"] };
  213. relations_ds = new DataColumn[] { ds.Tables["Body"].Columns["ItemCode"], ds.Tables["Body"].Columns["ToCheckNO"], ds.Tables["Body"].Columns["StorageCode"] };
  214. ds.Relations.Add("详情", relations_dt, relations_ds, false);
  215. return ds;
  216. }
  217. #endregion
  218. #region 绑定数据源
  219. private void btnConfig_Click(object sender, EventArgs e)
  220. {
  221. if (AppConfig.UserCode.ToLower() != "demo")
  222. {
  223. ICSBaseSimpleCode.AppshowMessageBox("您没有权限设置数据源,请联系软件提供商!");
  224. return;
  225. }
  226. FormDataSource fdata = new FormDataSource(AppConfig.GetMenuId(this.Tag.ToString()), btnConfig.Name);
  227. fdata.ShowDialog();
  228. }
  229. #endregion
  230. #region 分页
  231. private void rptPage_PageIndexChanged(object Sender, EventArgs e)
  232. {
  233. DataTable data = AppConfig.GetPageData(dataSource, rptPage.PageIndex, rptPage.PageSize).Copy();
  234. //DataTable data = AppConfig.GetPageDataByDb(tempTableName, "pagerowindex", rptPage.PageSize, rptPage.PageIndex, dataSource.Rows.Count);
  235. grdDetail.DataSource = data;
  236. }
  237. #endregion
  238. #region 过滤方法
  239. private void FormContainerManager_FormClosing(object sender, FormClosingEventArgs e)
  240. {
  241. AppConfig.DropTemTable(tempTableName);
  242. }
  243. #endregion
  244. #region 全选
  245. private void btnSelectAll_Click(object sender, EventArgs e)
  246. {
  247. grvDetail.PostEditor();
  248. this.Validate();
  249. for (int i = 0; i < grvDetail.RowCount; i++)
  250. {
  251. grvDetail.SetRowCellValue(i, colSelect, "Y");
  252. }
  253. }
  254. #endregion
  255. #region 全消
  256. private void btnCancelAll_Click(object sender, EventArgs e)
  257. {
  258. grvDetail.PostEditor();
  259. this.Validate();
  260. for (int i = 0; i < grvDetail.RowCount; i++)
  261. {
  262. grvDetail.SetRowCellValue(i, colSelect, "");
  263. }
  264. }
  265. #endregion
  266. #region 双击
  267. private void grvDetail_DoubleClick(object sender, EventArgs e)
  268. {
  269. if (grvDetail.FocusedRowHandle < 0)
  270. {
  271. return;
  272. }
  273. if (grvDetail.FocusedColumn == colSelect)
  274. {
  275. if (grvDetail.GetRowCellValue(grvDetail.FocusedRowHandle, colSelect).ToString() == "")
  276. {
  277. grvDetail.SetRowCellValue(grvDetail.FocusedRowHandle, colSelect, "Y");
  278. }
  279. else
  280. {
  281. grvDetail.SetRowCellValue(grvDetail.FocusedRowHandle, colSelect, "");
  282. }
  283. }
  284. }
  285. #endregion
  286. #region 删除
  287. private void btnDel_Click(object sender, EventArgs e)
  288. {
  289. grvDetail.PostEditor();
  290. this.Validate();
  291. if (grvDetail.RowCount == 0)
  292. return;
  293. SimpleButton btntemp = (SimpleButton)sender;
  294. if (AppConfig.GetUserExcuteRight(this.Tag.ToString(), btntemp.Name) == false)
  295. {
  296. ICSBaseSimpleCode.AppshowMessageBox("对不起您没有:" + btntemp.Text + "权限,请联系系统管理员!");
  297. }
  298. string ItemNO = "";
  299. for (int i = 0; i < grvDetail.RowCount; i++)
  300. {
  301. if (grvDetail.GetRowCellValue(i, colSelect).ToString() == "Y")
  302. {
  303. ItemNO = grvDetail.GetRowCellValue(i, ToCheckNO).ToString();
  304. }
  305. }
  306. if (ItemNO == "")
  307. {
  308. ICSBaseSimpleCode.AppshowMessageBox("请选择数据!");
  309. return;
  310. }
  311. if (ICSBaseSimpleCode.AppshowMessageBoxRepose("确定删除该单据吗?单据删除后无法恢复,确定吗?") != DialogResult.OK)
  312. return;
  313. try
  314. {
  315. FormPhysicalInventoryBLL.delete(ItemNO, AppConfig.AppConnectString);
  316. ICSBaseSimpleCode.AppshowMessageBox(0, "删除成功");
  317. btnRefresh_Click(null, null);
  318. }
  319. catch (Exception ex)
  320. {
  321. ICSBaseSimpleCode.AppshowMessageBox(ex.Message);
  322. }
  323. }
  324. #endregion
  325. #region 导出
  326. private void btnOutPut_Click(object sender, EventArgs e)
  327. {
  328. SimpleButton btntemp = (SimpleButton)sender;
  329. if (AppConfig.GetUserExcuteRight(this.Tag.ToString(), btntemp.Name) == false)
  330. {
  331. ICSBaseSimpleCode.AppshowMessageBox("对不起您没有:" + btntemp.Text + "权限,请联系系统管理员!");
  332. return;
  333. }
  334. FormOutExcel foe = new FormOutExcel(this.Tag.ToString(), grdDetail);
  335. foe.ShowDialog();
  336. }
  337. #endregion
  338. #region 刷新
  339. private void btnRefresh_Click(object sender, EventArgs e)
  340. {
  341. DevExpress.Utils.WaitDialogForm _wait = new DevExpress.Utils.WaitDialogForm("正在查找...请稍等...");
  342. try
  343. {
  344. if (sqlconn == "" && sqltxt == "")
  345. {
  346. _wait.Close();
  347. return;
  348. }
  349. _wait.Show();
  350. BodyDt = null;
  351. BodySource = null;
  352. ds.Reset();
  353. FormFilter filter = new FormFilter(AppConfig.GetSourceId(this.Tag.ToString(), btnConfig.Name), false);
  354. filter.OldTempTableName = tempTableName;
  355. //tempTableName = filter.NewTempTableName;
  356. //DataTable data = DBHelper.ExecuteDataset(AppConfig.FrameConnectString, CommandType.Text, "select * from " + tempTableName).Tables[0];
  357. dataSource = DBHelper.ExecuteDataset(sqlconn, CommandType.Text, sqltxt).Tables[0];
  358. DataSet Hset = new DataSet();
  359. dataSource.TableName = "Hsource";
  360. DataTable Hsource = dataSource.Copy();
  361. Hset.Tables.Add(Hsource);
  362. DataTable Hdt = dataSource.Copy();
  363. Hdt.Clear();
  364. BodySource = FormPhysicalInventoryBLL.FindAll(AppConfig.AppConnectString);
  365. DataSet Bset = new DataSet();
  366. dataSource.TableName = "Bsource";
  367. DataTable Bsource = BodySource.Copy();
  368. Bset.Tables.Add(Bsource);
  369. DataTable Bdt = BodySource.Copy();
  370. Bdt.Clear();
  371. DataSet dset = dataSetTool(Hdt, Bdt);
  372. dataSource = filter.FilterData.Tables[0];
  373. foreach (DataRow row in Hset.Tables[0].Rows)
  374. {
  375. dset.Tables["Hand"].Rows.Add(row.ItemArray);
  376. }
  377. foreach (DataRow row in Bset.Tables[0].Rows)
  378. {
  379. dset.Tables["Body"].Rows.Add(row.ItemArray);
  380. }
  381. grdDetail.DataSource = dset.Tables["Hand"];
  382. grvDetail.BestFitColumns();
  383. gridView1.BestFitColumns();
  384. rptPage.RecordNum = dataSource.Rows.Count;
  385. rptPage.PageIndex = 1;
  386. //rptPage.ReLoad();
  387. _wait.Close();
  388. }
  389. catch (Exception ex)
  390. {
  391. MessageBox.Show("异常:" + ex.Message, "异常", MessageBoxButtons.OK, MessageBoxIcon.Error);
  392. _wait.Close();
  393. }
  394. }
  395. #endregion
  396. #region 新增
  397. private void btnCreate_Click(object sender, EventArgs e)
  398. {
  399. SimpleButton btntemp = (SimpleButton)sender;
  400. if (AppConfig.GetUserExcuteRight(this.Tag.ToString(), btntemp.Name) == false)
  401. {
  402. ICSBaseSimpleCode.AppshowMessageBox("对不起您没有:" + btntemp.Text + "权限,请联系系统管理员!");
  403. return;
  404. }
  405. FormPhysicalInventoryAdd add = new FormPhysicalInventoryAdd();
  406. add.ShowDialog();
  407. btnRefresh_Click(null, null);
  408. }
  409. #endregion
  410. #region 修改
  411. private void btnModify_Click(object sender, EventArgs e)
  412. {
  413. String id = "";
  414. SimpleButton btntemp = (SimpleButton)sender;
  415. if (AppConfig.GetUserExcuteRight(this.Tag.ToString(), btntemp.Name) == false)
  416. {
  417. ICSBaseSimpleCode.AppshowMessageBox("对不起您没有:" + btntemp.Text + "权限,请联系系统管理员!");
  418. }
  419. List<string> editList = new List<string>();
  420. List<string> guidList1 = new List<string>();
  421. for (int i = 0; i < grvDetail.RowCount; i++)
  422. {
  423. if (grvDetail.GetRowCellValue(i, colSelect).ToString() == "Y")
  424. {
  425. id = grvDetail.GetRowCellValue(i, colSerial).ToString();
  426. editList.Add(id);
  427. }
  428. }
  429. if (editList.Count != 1)
  430. {
  431. ICSBaseSimpleCode.AppshowMessageBox("请选择数据,且只能选择一条进行编辑!!!");
  432. return;
  433. }
  434. try
  435. {
  436. FormPhysicalInventoryAdd add = new FormPhysicalInventoryAdd(id);
  437. add.ShowDialog();
  438. btnRefresh_Click(null, null);
  439. }
  440. catch (Exception ex)
  441. {
  442. ICSBaseSimpleCode.AppshowMessageBox(ex.Message);
  443. }
  444. }
  445. #endregion
  446. private void FormICSItemLot_FormClosing(object sender, FormClosingEventArgs e)
  447. {
  448. AppConfig.DropTemTable(tempTableName);
  449. }
  450. private void FormICSItemLot_Load(object sender, EventArgs e)
  451. {
  452. btnFilter_Click(sender, e);
  453. }
  454. private void grvDetail_MasterRowExpanded(object sender, DevExpress.XtraGrid.Views.Grid.CustomMasterRowEventArgs e)
  455. {
  456. gridView1 = grvDetail.GetDetailView(e.RowHandle, e.RelationIndex) as DevExpress.XtraGrid.Views.Grid.GridView;
  457. gridView1.BestFitColumns();
  458. }
  459. private void gridView1_MasterRowExpanded(object sender, DevExpress.XtraGrid.Views.Grid.CustomMasterRowEventArgs e)
  460. {
  461. DevExpress.XtraGrid.Views.Grid.GridView aView = grvDetail.GetDetailView(e.RowHandle, e.RelationIndex) as DevExpress.XtraGrid.Views.Grid.GridView;
  462. }
  463. private void btnCheckIn_Click(object sender, EventArgs e)
  464. {
  465. SimpleButton btntemp = (SimpleButton)sender;
  466. if (AppConfig.GetUserExcuteRight(this.Tag.ToString(), btntemp.Name) == false)
  467. {
  468. ICSBaseSimpleCode.AppshowMessageBox("对不起您没有:" + btntemp.Text + "权限,请联系系统管理员!");
  469. return;
  470. }
  471. FormPhysicalInventoryCheck add = new FormPhysicalInventoryCheck();
  472. add.ShowDialog();
  473. btnRefresh_Click(null, null);
  474. }
  475. private void btnIN_Click(object sender, EventArgs e)
  476. {
  477. DevExpress.Utils.WaitDialogForm _wait = new DevExpress.Utils.WaitDialogForm("正在查找...请稍等...");
  478. try
  479. {
  480. _wait.Show();
  481. barList.Clear();
  482. path = Application.StartupPath + @"\盘点条码.txt";
  483. if (!File.Exists(path))
  484. {
  485. ICSBaseSimpleCode.AppshowMessageBox(path + "文件不存在!!");
  486. return;
  487. }
  488. StreamReader sr = new StreamReader(path, Encoding.Default);
  489. string line;
  490. while ((line = sr.ReadLine()) != null)
  491. {
  492. if (line != "" && line != "\r\n")
  493. {
  494. string barCode = line.Substring(line.IndexOf(": ") + 2);
  495. if (barCode.Substring(0, 1) != "M" && barCode.Substring(0, 1) != "B")
  496. {
  497. continue;
  498. }
  499. string CSql = @"SELECT BarCode FROM [dbo].ICSMOBarCode WHERE BarCode = '" + barCode + "'";
  500. DataTable MDt = DBHelper.ExecuteDataset(AppConfig.AppConnectString, CommandType.Text, CSql).Tables[0];
  501. CSql = @"SELECT BarCode FROM [dbo].ICSStockBarCode WHERE BarCode = '" + barCode + "'";
  502. DataTable BDt = DBHelper.ExecuteDataset(AppConfig.AppConnectString, CommandType.Text, CSql).Tables[0];
  503. if ((MDt == null || MDt.Rows.Count == 0) && (BDt == null || BDt.Rows.Count == 0))
  504. {
  505. errorBar += barCode + "\r\n";
  506. }
  507. else
  508. {
  509. if (!barList.Contains(barCode))
  510. {
  511. barList.Add(barCode);
  512. }
  513. }
  514. }
  515. }
  516. ICSStorageInfoBLL.import(barList);
  517. _wait.Close();
  518. ICSBaseSimpleCode.AppshowMessageBox("导入成功");
  519. sr.Close();
  520. ICSBaseSimpleCode.AppshowMessageBox(barList.Count.ToString());
  521. FileStream fs = new FileStream(path, FileMode.Create);
  522. //获得字节数组
  523. byte[] data = System.Text.Encoding.Default.GetBytes(errorBar);
  524. //开始写入
  525. fs.Write(data, 0, data.Length);
  526. //清空缓冲区、关闭流
  527. fs.Flush();
  528. fs.Close();
  529. }
  530. catch (Exception ex)
  531. {
  532. _wait.Close();
  533. ICSBaseSimpleCode.AppshowMessageBox(ex.Message);
  534. }
  535. }
  536. private void simpleButton1_Click(object sender, EventArgs e)
  537. {
  538. SimpleButton btntemp = (SimpleButton)sender;
  539. if (AppConfig.GetUserExcuteRight(this.Tag.ToString(), btntemp.Name) == false)
  540. {
  541. ICSBaseSimpleCode.AppshowMessageBox("对不起您没有:" + btntemp.Text + "权限,请联系系统管理员!");
  542. return;
  543. }
  544. try
  545. {
  546. CheckContext context = new CheckContext();
  547. context.UserName = AppConfig.UserName;
  548. context.ERPDataName = "";//ICSBaseSimpleCode.GetWorkPointErpData();
  549. FormPhysicalInventoryBLL.ERPCheckVouch(context, AppConfig.AppConnectString);
  550. }
  551. catch (Exception ex)
  552. {
  553. ICSBaseSimpleCode.AppshowMessageBox(ex.Message);
  554. }
  555. }
  556. private void delete_Click(object sender, EventArgs e)
  557. {
  558. if (ICSBaseSimpleCode.AppshowMessageBoxRepose("确定删除该单据吗?单据删除后无法恢复,确定吗?") != DialogResult.OK)
  559. return;
  560. try
  561. {
  562. string LotNo = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, BarCode).ToString();
  563. string ToCheckNos = grvDetail.GetRowCellValue(grvDetail.FocusedRowHandle, ToCheckNO).ToString();
  564. decimal Actualqty = Convert.ToDecimal(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, BarCodeActualQty).ToString());
  565. string itemno = grvDetail.GetRowCellValue(grvDetail.FocusedRowHandle, ItemCode).ToString();
  566. FormPhysicalInventoryBLL.deletedetail(LotNo, ToCheckNos, Actualqty, itemno, AppConfig.AppConnectString);
  567. ICSBaseSimpleCode.AppshowMessageBox(0, "删除成功");
  568. btnRefresh_Click(null, null);
  569. }
  570. catch (Exception ex)
  571. {
  572. ICSBaseSimpleCode.AppshowMessageBox(ex.Message);
  573. }
  574. }
  575. private void btnFirstLock_Click(object sender, EventArgs e)
  576. {
  577. }
  578. private void btnSecondLock_Click(object sender, EventArgs e)
  579. {
  580. }
  581. private void btnFirstUnLock_Click(object sender, EventArgs e)
  582. {
  583. }
  584. private void btnSeondUnLock_Click(object sender, EventArgs e)
  585. {
  586. }
  587. }
  588. }