FrmCkInBillManager.cs 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using CoreFS.CA06;
  10. using Pur.Entity;
  11. using Core.Mes.Client.Comm.Control;
  12. using Core.Mes.Client.Comm;
  13. using Pur.Entity.configureEntity;
  14. using Infragistics.Win.UltraWinGrid;
  15. using System.Collections;
  16. using Pur.Entity.pur_orderEntiy;
  17. using Pur.configure;
  18. using Pur.Pop_upWindow;
  19. using Pur.require_plan;
  20. using Core.Mes.Client.Comm.Tool;
  21. using com.hnshituo.pur.vo;
  22. using Pur.Entity.ck;
  23. using Infragistics.Win;
  24. using Core.Mes.Client.Comm.Server;
  25. using Pur.PublicTools;
  26. namespace Pur.ck
  27. {
  28. public partial class FrmCkInBillManager : FrmPmsBase
  29. {
  30. bool b = false;//是否进行,是否点击查询按钮
  31. DataTable _dt_GropByItem = null;
  32. public FrmCkInBillManager()
  33. {
  34. InitializeComponent();
  35. }
  36. //菜单按钮事件
  37. public override void ToolBar_Click(object sender, string ToolbarKey)
  38. {
  39. switch (ToolbarKey)
  40. {
  41. case "Query":
  42. GetCkInBill();
  43. break;
  44. case "UltraGridToExcel"://导出入库单
  45. UltraGridToExcel();
  46. break;
  47. case "printCkInBill"://打印预览
  48. printCkInBillSinger("0");
  49. break;
  50. case "printCkInBill_cf"://重复打印预览
  51. printCkInBillSinger("1");
  52. break;
  53. case "cancelPrint"://取消打印
  54. cancelPrint();
  55. break;
  56. case "printCkInBillCollet"://打印汇总预览
  57. printCkInBill("0");
  58. break;
  59. case "printCkInBillCollet_cf"://重复打印汇总预览
  60. printCkInBill("1");
  61. break;
  62. }
  63. }
  64. /// <summary>
  65. /// 查询
  66. /// </summary>
  67. private void GetCkInBill()
  68. {
  69. if (b)
  70. {
  71. dataTable3.Rows.Clear();
  72. PurCkInBillEntity pcibEntity = getQueryCondition();
  73. if (!create_time_label.Checked && String.IsNullOrEmpty(pcibEntity.SuppCode) && String.IsNullOrEmpty(pcibEntity.ItemCode) && String.IsNullOrEmpty(pcibEntity.OrderId)
  74. && String.IsNullOrEmpty(pcibEntity.InvPhysic) && String.IsNullOrEmpty(pcibEntity.RefeId) && String.IsNullOrEmpty(pcibEntity.ItemName))
  75. {
  76. MessageUtil.ShowTips("请添加查询条件或勾选创建时间,进行查询");
  77. return;
  78. }
  79. if (!create_time_label.Checked)
  80. {
  81. pcibEntity.CreateTime = null;
  82. pcibEntity.UpdateTime = null;
  83. }
  84. DataTable dt = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill", new object[] { pcibEntity });
  85. GridHelper.CopyDataToDatatable(dt, dataTable5, true);
  86. GridHelper.RefreshAndAutoSize(ultraGrid4);
  87. }
  88. }
  89. private DateTime setCreateTimeStart(Object value)
  90. {
  91. DateTime time = Convert.ToDateTime(value);
  92. DateTime endtime = new DateTime(time.Year, time.Month, time.Day, 0, 0, 0);
  93. return endtime;
  94. }
  95. private DateTime setCreateTimeEnd(Object value) {
  96. DateTime time = Convert.ToDateTime(value);
  97. DateTime endtime = new DateTime(time.Year, time.Month, time.Day,23,59,59);
  98. return endtime;
  99. }
  100. private PurCkInBillEntity getQueryCondition()
  101. {
  102. PurCkInBillEntity pcibEntity = new PurCkInBillEntity();
  103. if (txt_CreateTimeStart.Value != null)//创建开始时间
  104. {
  105. //pcibEntity.CreateTime = ((DateTime)txt_CreateTimeStart.Value);//.AddDays(-1);
  106. pcibEntity.CreateTime = setCreateTimeStart(txt_CreateTimeStart.Value);
  107. }
  108. else
  109. {
  110. //pcibEntity.CreateTime = DateTime.MinValue;
  111. }
  112. if (txt_CreateTimeEnd.Value != null)//创建结束时间
  113. {
  114. //pcibEntity.UpdateTime = (DateTime)txt_CreateTimeEnd.Value;
  115. pcibEntity.UpdateTime = setCreateTimeEnd(txt_CreateTimeEnd.Value);
  116. //pcibEntity.UpdateTime = pcibEntity.UpdateTime.Value.AddDays(1);
  117. }
  118. else
  119. {
  120. //pcibEntity.UpdateTime = DateTime.MaxValue;
  121. }
  122. pcibEntity.SuppCode = txt_SuppName.Value == null ? null : txt_SuppName.Value.ToString();
  123. pcibEntity.ItemCode = txt_ItemName.Value == null ? null : txt_ItemName.Value.ToString();
  124. pcibEntity.OrderId = txt_OrderId.Value == null ? null : txt_OrderId.Value.ToString();
  125. pcibEntity.InvPhysic = txt_InvPhysic.Value == null ? null : txt_InvPhysic.Value.ToString();
  126. pcibEntity.RefeId = txt_DELIVERY_ID.Text.Trim();
  127. //if (txt_ITEMCODE.Text!="全部")
  128. //{
  129. //if (txt_ITEMCODE.Value != null && txt_ITEMCODE.Value.ToString() == "")
  130. //{
  131. pcibEntity.ItemName = txt_ITEMCODE.Text;// == null ? null : txt_ITEMCODE.Value.ToString();;
  132. //}
  133. // }
  134. return pcibEntity;
  135. }
  136. /// <summary>
  137. /// 绑定查询条件的下拉列表
  138. /// </summary>
  139. private void getBindCmbInGrid()
  140. {
  141. PurCkInBillEntity pcibEntity = getQueryCondition();
  142. pcibEntity.UpdateTime = null;
  143. pcibEntity.CreateTime = null;
  144. pcibEntity.ItemCode = null;
  145. pcibEntity.SuppCode = null;
  146. pcibEntity.OrderId = null;
  147. pcibEntity.ItemName = null;
  148. DataTable dt_GropBySupp = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropBySupp", new object[] { pcibEntity });
  149. DataTable dt_GropByItem = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByItem", new object[] { pcibEntity });
  150. //DataTable dt_GropByOrder = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByOrder", new object[] { pcibEntity });
  151. string strSuppName = txt_SuppName.Value == null ? "" : txt_SuppName.Value.ToString();
  152. string strItemName = txt_ItemName.Value == null ? "" : txt_ItemName.Value.ToString();
  153. string strOrderId = txt_OrderId.Value == null ? "" : txt_OrderId.Value.ToString();
  154. _dt_GropByItem = dt_GropByItem;
  155. //ValueListItem vli= txt_SuppName.SelectedItem;
  156. //ValueList vl = txt_SuppName.ValueList;
  157. //comm.FilComboboxAdd(txt_SuppName, dt_GropBySupp,"SUPPCODE", "SUPPNAME", "", true, "", "");
  158. //comm.FilComboboxAdd(txt_ItemName, dt_GropByItem, "ItemCODE", "ItemNAME", "", true, "", "");
  159. comm.FilComboboxAdd(txt_ItemName, dt_GropByItem, "basecode", "basename", "", true, "全部", "");
  160. //comm.FilComboboxAdd(txt_OrderId, dt_GropByOrder, "ORDERID", "ORDERID", "", true, "", "");
  161. comm.FilComboboxAdd(txt_SuppName, dt_GropBySupp, "SUPPCODE", "SUPPNAME", "", true, "全部", "");
  162. // comm.setUltraComboEditorBind(txt_SuppName, dt_GropBySupp, "SUPPNAME", "SUPPCODE","全部","");
  163. //if (txt_ItemName.Items.Count==0)
  164. //{
  165. // comm.FilComboboxAdd(txt_ItemName, dt_GropByItem, "basecode", "basename", "", true, "", "");
  166. // foreach (ValueListItem vli in txt_ItemName.Items)
  167. // {
  168. // if (vli.DataValue.ToString() == strItemName)
  169. // {
  170. // txt_ItemName.Value = strItemName;
  171. // break;
  172. // }
  173. // }
  174. //}
  175. //if (txt_ItemName.Items.Count == 0)
  176. //{
  177. // comm.setUltraComboEditorBind(txt_OrderId, dt_GropByOrder, "ORDERID", "ORDERID", "", "");
  178. // foreach (ValueListItem vli in txt_OrderId.Items)
  179. // {
  180. // if (vli.DataValue.ToString() == strOrderId)
  181. // {
  182. // txt_OrderId.Value = strOrderId;
  183. // break;
  184. // }
  185. // }
  186. //}
  187. //foreach (ValueListItem vli in txt_SuppName.Items)
  188. //{
  189. // if (vli.DataValue.ToString() == strSuppName)
  190. // {
  191. // //txt_SuppName.Value = strSuppName;
  192. // txt_SuppName.SelectedItem = vli;
  193. // break;
  194. // }
  195. //}
  196. }
  197. /// <summary>
  198. /// 界面加载
  199. /// </summary>
  200. /// <param name="sender"></param>
  201. /// <param name="e"></param>
  202. private void FrmCkInBillManager_Load(object sender, EventArgs e)
  203. {
  204. txt_CreateTimeStart.Value = DateTime.Now.AddMonths(-1);
  205. txt_CreateTimeEnd.Value = DateTime.Now.AddDays(1);
  206. getBindCmbInGrid();
  207. b = true;
  208. }
  209. /// <summary>
  210. /// 激活入库单行
  211. /// </summary>
  212. /// <param name="sender"></param>
  213. /// <param name="e"></param>
  214. private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
  215. {
  216. UltraGridRow uge = ultraGrid4.ActiveRow;
  217. PurCkInbillPositionEntity CkInbillPositionEntity = new PurCkInbillPositionEntity();
  218. CkInbillPositionEntity.InStockNo = uge.Cells["InStockNo"].Value.ToString();
  219. DataTable dtCkInbillPositio = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInbillPositionService", "getBillPosition", new object[] { CkInbillPositionEntity });
  220. GridHelper.CopyDataToDatatable(dtCkInbillPositio, dataTable3, true);
  221. GridHelper.RefreshAndAutoSize(ultraGrid2);
  222. }
  223. /// <summary>
  224. /// 导出Excel
  225. /// </summary>
  226. private void UltraGridToExcel()
  227. {
  228. try
  229. {
  230. //获取导出的采购计划行表
  231. ArrayList alUltraGrid = new ArrayList();
  232. alUltraGrid.Add(ultraGrid4);
  233. ArrayList alSheeft = new ArrayList();
  234. alSheeft.Add("入库单");
  235. if (ultraGrid4.Rows.Count > 0)
  236. {
  237. GridHelper.ulGridToExcel(alUltraGrid, alSheeft, "入库单.xls");//导出excel
  238. }
  239. else
  240. {
  241. MessageUtil.ShowTips("无可导出项");
  242. return;
  243. }
  244. //MessageUtil.ShowTips("导出成功");
  245. }
  246. catch (Exception e)
  247. {
  248. MessageUtil.ShowTips("导出失败" + e.Message);
  249. }
  250. }
  251. /// <summary>
  252. /// 单张打印
  253. /// </summary>
  254. private void printCkInBillSinger(String strTips)
  255. {
  256. UltraGridRow ugr = ultraGrid4.ActiveRow;
  257. if (ugr == null)
  258. {
  259. MessageUtil.ShowTips("未找到要打印的入库单");
  260. return;
  261. }
  262. if(ugr.Cells["status"].Value.ToString()=="待检")
  263. {
  264. MessageUtil.ShowTips("状态为“待检”的入库单不能打印!");
  265. return;
  266. }
  267. DataTable dt = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1223" }, this.ob);
  268. DataRow[] drArr = dt.Select("validflag='1'");
  269. if (drArr.Length != 1)
  270. {
  271. MessageUtil.ShowTips("基础数据维护错误:报表系统需维护有效的Ip且只能维护一个有效ip!");
  272. return;
  273. }
  274. String TipsEnv = drArr[0]["baseName"].ToString();
  275. String strUrlPort = "http://172.54.10.42:8080";//报表系统IP
  276. //String strUrlPort = "http://localhost:8075";//报表系统IP
  277. String[] str = strUrlPort.Split(':');
  278. String strUrl = str[0] + ":" + str[1];
  279. string strIn_stock_no = ugr.Cells["Instockno"].Value.ToString().Trim();
  280. string itemName = ugr.Cells["itemname"].Value.ToString().Trim();
  281. if (String.IsNullOrEmpty(strIn_stock_no))
  282. {
  283. MessageUtil.ShowTips("入库单号为空");
  284. return;
  285. }
  286. PurCkInBillEntity CkInbill = this.execute<PurCkInBillEntity>("com.hnshituo.pur.ck.service.CkInBillService", "findById", new object[] { strIn_stock_no });
  287. if (CkInbill == null)
  288. {
  289. MessageUtil.ShowTips("未发现入库单:" + strIn_stock_no + "信息记录");
  290. return;
  291. }
  292. string strPrintNo = CkInbill.PrintCode;
  293. if (!String.IsNullOrEmpty(strPrintNo) && strTips == "0")
  294. {
  295. MessageUtil.ShowTips("入库单:" + strIn_stock_no + "已打印,或请先取消打印或选择重复打印功能");
  296. return;
  297. }
  298. //获取打印编号
  299. if (strTips == "0")
  300. {
  301. PurPrintNoEntity ppn = new PurPrintNoEntity();
  302. ppn.Remark = "入库单打印";
  303. ppn.PrintType = "1";
  304. ppn.CreateName = UserInfo.GetUserName();
  305. ppn.CreateUserid = UserInfo.GetUserID();
  306. CoreResult core = this.execute<CoreResult>("com.hnshituo.pur.ck.service.CkInBillService", "getPrintNo", new object[] { ppn });
  307. if (core.Resultcode == 0)
  308. {
  309. strPrintNo = core.Resultmsg;
  310. }
  311. else
  312. {
  313. MessageUtil.ShowTips(core.Resultmsg);
  314. }
  315. }
  316. if (itemName.ToString().Equals("国内废钢"))
  317. {
  318. strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBillFg.cpt&op=view" + "&printNo=" + strPrintNo + "&in_stock_no='" + strIn_stock_no + "'&ID=" + 1232024;
  319. }
  320. else
  321. {
  322. //打印操作
  323. if (TipsEnv == "2")//测试环境
  324. {
  325. strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBill_test.cpt&op=view" + "&printNo=" + strPrintNo + "&in_stock_no=" + strIn_stock_no;
  326. }
  327. else
  328. {
  329. strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBill.cpt&op=view" + "&printNo=" + strPrintNo + "&in_stock_no=" + strIn_stock_no + "&ID=" + 1232024;
  330. }
  331. }
  332. //strUrl = "http://localhost:8075/webroot/decision/view/report?viewlet=rpt_CkInBill.cpt&op=view" + "&in_stock_no="+ "&printNo=" + strPrintNo + strIn_stock_no;
  333. comm.printReport(this.ob, strUrl, "入库单打印");
  334. if (strTips== "0")
  335. {
  336. if (MessageUtil.ShowYesNoAndQuestion("是否已打印入库单?").Equals(DialogResult.Yes))
  337. {
  338. ArrayList al = new ArrayList();
  339. PurCkInBillEntity pcibEntity = new PurCkInBillEntity();
  340. pcibEntity.InStockNo = strIn_stock_no;
  341. pcibEntity.PrintCode = strPrintNo;
  342. al.Add(pcibEntity);
  343. CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.CkInBillService", "isPrint", new object[] { al });
  344. if (rt.Resultcode != 0)
  345. {
  346. MessageUtil.ShowTips("标记打印失败:" + rt.Resultmsg);
  347. }
  348. ugr.CellAppearance.ForeColor = System.Drawing.Color.FromArgb(255, 128, 0);
  349. }
  350. }
  351. }
  352. /// <summary>
  353. /// 取消打印
  354. /// </summary>
  355. private void cancelPrint()
  356. {
  357. //获取需要取消的打印的入库单编号
  358. ultraGrid4.UpdateData();
  359. IQueryable<UltraGridRow> checkRows = ultraGrid4.Rows.AsQueryable().Where("Check = 'True' ");
  360. if (checkRows.Count() == 0)
  361. {
  362. MessageUtil.ShowTips("请勾选要取消打印的入库单");
  363. return;
  364. }
  365. ArrayList list = new ArrayList();
  366. StringBuilder bu = new StringBuilder();
  367. foreach (UltraGridRow ugr in checkRows)
  368. {
  369. string Instockno = ugr.Cells["Instockno"].Value.ToString().Trim();
  370. string printCode = ugr.Cells["printcode"].Value.ToString().Trim();
  371. if (String.IsNullOrEmpty(Instockno))
  372. {
  373. MessageUtil.ShowTips("入库单号不能为空");
  374. ugr.Activate();
  375. }
  376. if(!String.IsNullOrEmpty(printCode))
  377. {
  378. string userId = "";
  379. DataTable dt = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQueryPrint", new Object[] { printCode }, this.ob);
  380. if (dt.Rows.Count > 0)
  381. {
  382. userId = dt.Rows[0]["CREATE_USERID"].ToString();
  383. }
  384. if(!UserInfo.GetUserID().Equals(userId))
  385. {
  386. MessageUtil.ShowTips("不是该账号打印无法取消!");
  387. return;
  388. }
  389. }
  390. PurCkInBillEntity inbill=new PurCkInBillEntity();
  391. inbill.InStockNo=Instockno;
  392. inbill.CreateName=UserInfo.GetUserName();
  393. inbill.CreateUserid=UserInfo.GetUserID();
  394. list.Add(inbill);
  395. bu.Append(Instockno + ",");
  396. }
  397. if (list.Count <= 0)
  398. {
  399. MessageUtil.ShowTips("请勾选要取消打印的入库单");
  400. return;
  401. }
  402. if (MessageUtil.ShowYesNoAndQuestion("确定取消打印入库单:" + bu.ToString() + "? 若为汇总打印,将同步取消关联入库单打印记录。") != DialogResult.Yes)
  403. {
  404. return;
  405. }
  406. CoreResult core = this.execute<CoreResult>("com.hnshituo.pur.ck.service.CkInBillService", "cancelPrintNo", new object[] { list });
  407. if (core.Resultcode != 0)
  408. {
  409. MessageUtil.ShowTips("取消打印失败:" + core.Resultmsg);
  410. return;
  411. }
  412. else
  413. {
  414. MessageUtil.ShowTips("取消打印成功");
  415. GetCkInBill();
  416. }
  417. }
  418. /// <summary>
  419. /// 汇总打印入库单
  420. /// </summary>
  421. private void printCkInBill(String strTips)
  422. {
  423. //获取要打印的入库单编号
  424. ultraGrid4.UpdateData();
  425. string strIn_stock_no_s = "";
  426. IQueryable<UltraGridRow> checkRows = ultraGrid4.Rows.AsQueryable().Where("Check = 'True' ");
  427. if (checkRows.Count() <= 0)
  428. {
  429. MessageUtil.ShowTips("请勾选要打印的入库单");
  430. return;
  431. }else if(checkRows.Count()>140)
  432. {
  433. MessageUtil.ShowTips("勾选的合同不能超过140!");
  434. return;
  435. }
  436. ArrayList list1=new ArrayList();
  437. ArrayList al = new ArrayList();
  438. string n = "";
  439. string itemName = "";
  440. foreach (UltraGridRow ugr in checkRows)
  441. {
  442. string Instockno = ugr.Cells["Instockno"].Value.ToString();
  443. itemName = ugr.Cells["itemname"].Value.ToString();
  444. if (String.IsNullOrEmpty(Instockno))
  445. {
  446. MessageUtil.ShowTips("入库单号为空");
  447. return;
  448. }
  449. PurCkInBillEntity CkInbill = this.execute<PurCkInBillEntity>("com.hnshituo.pur.ck.service.CkInBillService", "findById", new object[] { Instockno });
  450. if (CkInbill == null)
  451. {
  452. MessageUtil.ShowTips("未发现入库单:" + Instockno + "信息记录");
  453. return;
  454. }
  455. if (!String.IsNullOrEmpty(CkInbill.PrintCode) && strTips == "0")
  456. {
  457. MessageUtil.ShowTips("入库单:" + Instockno + "已打印,或请先取消打印");
  458. ugr.Activate();
  459. return;
  460. }
  461. if (String.IsNullOrEmpty(CkInbill.PrintCode) && strTips == "1")
  462. {
  463. MessageUtil.ShowTips("入库单:" + Instockno + "还未打印,或请先打印");
  464. ugr.Activate();
  465. return;
  466. }
  467. if (n != CkInbill.PrintCode)
  468. {
  469. list1.Add(CkInbill.PrintCode);
  470. }
  471. n = CkInbill.PrintCode;
  472. strIn_stock_no_s += "'" + Instockno + "',";
  473. if (ugr.Cells["status"].Value.ToString() == "待检")
  474. {
  475. MessageUtil.ShowTips("状态为“待检”的入库单不能打印!");
  476. return;
  477. }
  478. PurCkInBillEntity pcibEntity = new PurCkInBillEntity();
  479. pcibEntity.InStockNo = Instockno;
  480. al.Add(pcibEntity);
  481. }
  482. strIn_stock_no_s = strIn_stock_no_s.Substring(0, strIn_stock_no_s.Length - 1);
  483. //string strSuppCode = txt_SuppName.Value == null ? "" : txt_SuppName.Value.ToString();//供应商
  484. //string strItemCode = txt_ItemName.Value == null ? "" : txt_ItemName.Value.ToString();//物料分类
  485. //string strItemCodeCode = txt_ITEMCODE.Value == null ? "" : txt_ITEMCODE.Value.ToString();//物料名称
  486. //string strInvPhysic = txt_InvPhysic.Value == null ? "" : txt_InvPhysic.Value.ToString();//库区
  487. ////string strSuppCode = txt_SuppName.Text;
  488. ////string strItemCode = txt_ItemName.Text;
  489. //string strOrderId = txt_OrderId.Value == null ? "" : txt_OrderId.Value.ToString();
  490. //string strStart = ((DateTime)txt_CreateTimeStart.Value).ToString("yyyy-MM-dd");
  491. //string strEnd = ((DateTime)txt_CreateTimeEnd.Value).ToString("yyyy-MM-dd");
  492. //if (string.IsNullOrEmpty(strSuppCode) || string.IsNullOrEmpty(strItemCode) || string.IsNullOrEmpty(strOrderId) || string.IsNullOrEmpty(strStart))
  493. //{
  494. // MessageUtil.ShowTips("供应商、物料名称、合同、创建时间必须从下拉列表中选择,否则不能打印");
  495. // return;
  496. //}
  497. DataTable dt = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1223" }, this.ob);
  498. DataRow[] drArr = dt.Select("validflag='1'");
  499. if (drArr.Length != 1)
  500. {
  501. MessageUtil.ShowTips("基础数据维护错误:报表系统需维护有效的Ip且只能维护一个有效ip!");
  502. return;
  503. }
  504. String TipsEnv = drArr[0]["baseName"].ToString();
  505. String strUrlPort = "http://172.54.10.42:8080";//报表系统IP
  506. String[] str = strUrlPort.Split(':');
  507. String strUrl = str[0] + ":" + str[1];
  508. //获取打印编号
  509. string strPrintNo = "";
  510. if (strTips == "0")
  511. {
  512. PurPrintNoEntity ppn = new PurPrintNoEntity();
  513. ppn.Remark = "入库单打印";
  514. ppn.PrintType = "1";
  515. ppn.CreateName = UserInfo.GetUserName();
  516. ppn.CreateUserid = UserInfo.GetUserID();
  517. CoreResult core = this.execute<CoreResult>("com.hnshituo.pur.ck.service.CkInBillService", "getPrintNo", new object[] { ppn });
  518. if (core.Resultcode == 0)
  519. {
  520. strPrintNo = core.Resultmsg;
  521. }
  522. else
  523. {
  524. MessageUtil.ShowTips(core.Resultmsg);
  525. }
  526. }
  527. else
  528. {
  529. strPrintNo = publicPms.ArrayListToString(list1);
  530. }
  531. if (itemName.ToString().Equals("国内废钢"))
  532. {
  533. strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBillFg.cpt&op=view" + "&printNo=" + strPrintNo + "&in_stock_no=" + strIn_stock_no_s + "&ID=" + 1232024;
  534. //strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBill_PrintFg.cpt" + "&printNo=" + strPrintNo + "&in_stock_no_s=" + strIn_stock_no_s + "&ID=" + 1232024;
  535. }
  536. else
  537. {
  538. if (TipsEnv == "2")//测试环境
  539. {
  540. //strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBill_Print_test.cpt" + "&printNo=" + strPrintNo + "&supp_code=" + strSuppCode + "&item_code=" + strItemCode + "&create_time_start=" + strStart + "&create_time_end=" + strEnd + "&inv_physic=" + strInvPhysic + "&order_id=" + strOrderId + "&item_code_code=" + strItemCodeCode;
  541. strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBill_Print_test.cpt" + "&printNo=" + strPrintNo + "&in_stock_no_s=" + strIn_stock_no_s;
  542. }
  543. else
  544. {
  545. //strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBill_Print.cpt" + "&printNo=" + strPrintNo + "&supp_code=" + strSuppCode + "&item_code=" + strItemCode + "&create_time_start=" + strStart + "&create_time_end=" + strEnd + "&inv_physic=" + strInvPhysic + "&order_id=" + strOrderId + "&item_code_code=" + strItemCodeCode;
  546. strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBill_Print.cpt" + "&printNo=" + strPrintNo + "&in_stock_no_s=" + strIn_stock_no_s + "&ID=" + 1232024;
  547. }
  548. }
  549. //strUrl = "http://localhost:8075/webroot/decision/view/report?viewlet=rpt_CkInBill_Print.cpt&op=view" + "&printNo=" + strPrintNo + "&supp_code=" + strSuppCode + "&item_code=" + strItemCode + "&create_time_start=" + strStart + "&create_time_end=" + strEnd + "&inv_physic=" + strInvPhysic + "&order_id=" + strOrderId;
  550. //http://localhost:8075/webroot/decision/view/report?viewlet=rpt_CkInBill_Print.cpt&printNo=20160900019&supp_code=W05AXQSHGS&item_code=W04&create_time_start=2016-08-11&create_time_end=2016-09-12&inv_physic=&order_id=4640366&item_code_code=W00403044500010
  551. comm.printReport(this.ob, strUrl,"入库单汇总打印");
  552. if (strTips == "0")
  553. {
  554. if (MessageUtil.ShowYesNoAndQuestion("是否已打印入库单?").Equals(DialogResult.Yes))
  555. {
  556. foreach (PurCkInBillEntity pcibEntity1 in al)
  557. {
  558. pcibEntity1.PrintCode = strPrintNo;
  559. }
  560. CoreResult rt = this.execute<CoreResult>("com.hnshituo.pur.ck.service.CkInBillService", "isPrint", new object[] { al });
  561. if (rt.Resultcode != 0)
  562. {
  563. MessageUtil.ShowTips("标记打印失败:" + rt.Resultmsg);
  564. }
  565. GetCkInBill();
  566. }
  567. }
  568. }
  569. /// <summary>
  570. /// 打印入库单汇总,方法弃用
  571. /// </summary>
  572. private void printCkInBillCollet()
  573. {
  574. string strSuppCode = txt_SuppName.Value==null?"":txt_SuppName.Value.ToString();
  575. string strItemCode = txt_ItemName.Value == null ? "" : txt_ItemName.Value.ToString();
  576. //string strSuppCode = txt_SuppName.Text;
  577. //string strItemCode = txt_ItemName.Text;
  578. string strOrderId = txt_OrderId.Value==null?"":txt_OrderId.Value.ToString();
  579. string strStart = ((DateTime)txt_CreateTimeStart.Value).ToString("yyyy-MM-dd");
  580. string strEnd = ((DateTime)txt_CreateTimeEnd.Value).ToString("yyyy-MM-dd");
  581. if (string.IsNullOrEmpty(strSuppCode) || string.IsNullOrEmpty(strItemCode) || string.IsNullOrEmpty(strOrderId) || string.IsNullOrEmpty(strStart) || string.IsNullOrEmpty(strEnd))
  582. {
  583. MessageUtil.ShowTips("供应商、合同号、物料名称、开始时间和结束时间必须从下拉列表中选择,否则不能汇总打印");
  584. return;
  585. }
  586. DataTable dt = ServerHelper.GetData("com.hnshituo.pur.configure.service.impl.CoreBaseInfoNew.doQuery", new Object[] { "1223" }, this.ob);
  587. DataRow[] drArr = dt.Select("validflag='1'");
  588. if (drArr.Length != 1)
  589. {
  590. MessageUtil.ShowTips("基础数据维护错误:报表系统需维护有效的Ip且只能维护一个有效ip!");
  591. return;
  592. }
  593. String TipsEnv = drArr[0]["baseName"].ToString();
  594. String strUrlPort = "http://172.54.10.42:8080";//报表系统IP
  595. String[] str = strUrlPort.Split(':');
  596. String strUrl = str[0] + ":" + str[1];
  597. if (TipsEnv == "2")//测试环境
  598. {
  599. strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBillCollect_test.cpt&op=view" + "&supp_code=" + strSuppCode + "&item_code=" + strItemCode + "&order_id=" + strOrderId + "&create_time_start=" + strStart + "&create_time_end=" + strEnd;
  600. }
  601. else
  602. {
  603. strUrl = strUrlPort + "/webroot/decision/view/report?viewlet=rpt_CkInBillCollect_test.cpt&op=view" + "&supp_code=" + strSuppCode + "&item_code=" + strItemCode + "&order_id=" + strOrderId + "&create_time_start=" + strStart + "&create_time_end=" + strEnd;
  604. }
  605. strUrl = "http://localhost:8075/webroot/decision/view/report?viewlet=rpt_CkInBillCollect.cpt&supp_code=" + strSuppCode + "&item_code=" + strItemCode + "&order_id=" + strOrderId + "&create_time_start=" + strStart + "&create_time_end=" + strEnd;
  606. comm.printReport(this.ob, strUrl,"入库单汇总打印");
  607. }
  608. private void txt_OrderId_ValueChanged(object sender, EventArgs e)
  609. {
  610. //txt_ItemName.Text = null;
  611. //PurCkInBillEntity CkInBillEntity = getQueryCondition();
  612. //DataTable dt_GropByItem = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByItem", new object[] { CkInBillEntity });
  613. //comm.FilComboboxAdd(txt_ItemName, dt_GropByItem, "ItemCODE", "ItemNAME", "", true, "", "");
  614. }
  615. /// <summary>
  616. /// 选择物料时,加载库区
  617. /// </summary>
  618. /// <param name="sender"></param>
  619. /// <param name="e"></param>
  620. private void txt_ItemName_ValueChanged(object sender, EventArgs e)
  621. {
  622. }
  623. private void txt_SuppName_SelectionChanged(object sender, EventArgs e)
  624. {
  625. //b = true;
  626. //GetCkInBill();
  627. //if (b)
  628. // { return; }
  629. string strSuppName = txt_SuppName.Value == null ? "" : txt_SuppName.Value.ToString();
  630. string strItemName = txt_ItemName.Value == null ? "" : txt_ItemName.Value.ToString();
  631. string strOrderId = txt_OrderId.Value == null ? "" : txt_OrderId.Value.ToString();
  632. txt_OrderId.Value = null;
  633. txt_ItemName.Value = null;
  634. txt_ITEMCODE.Value = null;
  635. //txt_OrderId.Value = "";
  636. //txt_ItemName.Value = "";
  637. //txt_ITEMCODE.Value = "";
  638. PurCkInBillEntity CkInBillEntity = getQueryCondition();
  639. CkInBillEntity.UpdateTime = null;
  640. CkInBillEntity.CreateTime = null;
  641. CkInBillEntity.OrderId = null;
  642. CkInBillEntity.ItemCode = null;
  643. CkInBillEntity.ItemName = null;
  644. //DataTable dt_GropByOrder = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByOrder", new object[] { CkInBillEntity });
  645. //DataTable dt_GropByItem = comm.getDtGroupBy_reDt(dataTable5, "basecode");
  646. ////DataTable dt_GropByItem = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByItem", new object[] { CkInBillEntity });
  647. //DataTable dt_GropByInvPhisc = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByInvPhisc", new object[] { CkInBillEntity });
  648. //comm.FilComboboxAdd(txt_ItemName, dt_GropByItem, "basecode", "basename", "", true, "", "");
  649. //comm.FilComboboxAdd(txt_OrderId, dt_GropByOrder, "ORDERID", "ORDERID", "", true, "", "");
  650. //comm.FilComboboxAdd(txt_InvPhysic, dt_GropByInvPhisc, "invPhysic", "ItemNAME", "", true, "", "");
  651. DataTable dt_GropByItem = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByItem", new object[] { CkInBillEntity });
  652. comm.FilComboboxAdd(txt_ItemName, dt_GropByItem, "basecode", "basename", "", true, "全部", "");
  653. foreach (ValueListItem vli in txt_ItemName.Items)
  654. {
  655. if (vli.DataValue.ToString() == strItemName)
  656. {
  657. txt_ItemName.Value = strItemName;
  658. break;
  659. }
  660. }
  661. //GetCkInBill();
  662. }
  663. /// <summary>
  664. /// 选择物料
  665. /// </summary>
  666. /// <param name="sender"></param>
  667. /// <param name="e"></param>
  668. private void txt_ItemName_SelectionChanged(object sender, EventArgs e)
  669. {
  670. string strSuppName = txt_SuppName.Value == null ? "" : txt_SuppName.Value.ToString();
  671. string strItemName = txt_ItemName.Value == null ? "" : txt_ItemName.Value.ToString();
  672. string strOrderId = txt_OrderId.Value == null ? "" : txt_OrderId.Value.ToString();
  673. string strItemCode = txt_ITEMCODE.Value == null ? "" : txt_ITEMCODE.Value.ToString();
  674. txt_OrderId.Value = null;
  675. txt_ITEMCODE.Value = null;
  676. //txt_OrderId.Value = "";
  677. //txt_ITEMCODE.Value = "";
  678. PurCkInBillEntity CkInBillEntity = getQueryCondition();
  679. CkInBillEntity.UpdateTime = null;
  680. CkInBillEntity.CreateTime = null;
  681. CkInBillEntity.OrderId = null;
  682. CkInBillEntity.ItemName = null;
  683. //CkInBillEntity.ItemCode = null;
  684. //txt_InvPhysic.Value = null;
  685. //DataTable dt_GropByInvPhisc = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByInvPhisc", new object[] { CkInBillEntity });
  686. //comm.FilComboboxAdd(txt_InvPhysic, dt_GropByInvPhisc, "invPhysic", "ItemNAME", "", true, "", "");
  687. // GetCkInBill();
  688. //查询合同
  689. DataTable dt_GropByOrder = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByOrder", new object[] { CkInBillEntity });
  690. comm.setUltraComboEditorBind(txt_OrderId, dt_GropByOrder, "ORDERID", "ORDERID", "全部", "");
  691. foreach (ValueListItem vli in txt_OrderId.Items)
  692. {
  693. if (vli.DataValue.ToString() == strOrderId)
  694. {
  695. txt_OrderId.Value = strOrderId;
  696. break;
  697. }
  698. }
  699. //GetCkInBill();
  700. }
  701. private void txt_InvPhysic_SelectionChanged(object sender, EventArgs e)
  702. {
  703. //GetCkInBill();
  704. }
  705. private void txt_OrderId_SelectionChanged(object sender, EventArgs e)
  706. {
  707. string strItemCode = txt_ITEMCODE.Value == null ? "" : txt_ITEMCODE.Value.ToString();
  708. //查询物料
  709. //txt_OrderId.Text = null;
  710. txt_ITEMCODE.Value = null;
  711. //txt_ITEMCODE.Value = "";
  712. PurCkInBillEntity CkInBillEntity = getQueryCondition();
  713. CkInBillEntity.UpdateTime = null;
  714. CkInBillEntity.CreateTime = null;
  715. CkInBillEntity.ItemName = null;
  716. DataTable dt_GropByItemName = this.execute<DataTable>("com.hnshituo.pur.ck.service.CkInBillService", "GetCkInBill_GropByItemName", new object[] { CkInBillEntity });
  717. //comm.setUltraComboEditorBind(txt_ITEMCODE, dt_GropByItemName, "ItemName", "ItemCode", "全部", "");
  718. comm.FilComboboxAdd(txt_ITEMCODE, dt_GropByItemName, "ItemCode", "ItemName", "", true, "", "");
  719. foreach (ValueListItem vli in txt_ITEMCODE.Items)
  720. {
  721. if (vli.DataValue.ToString() == strItemCode)
  722. {
  723. txt_ITEMCODE.Value = strItemCode;
  724. break;
  725. }
  726. }
  727. GetCkInBill();
  728. }
  729. private void txt_ITEMCODE_SelectionChanged(object sender, EventArgs e)
  730. {
  731. }
  732. /// <summary>
  733. /// 导入入库单到库存
  734. /// </summary>
  735. private void ExportCkToStorage()
  736. {
  737. ArrayList al_CkStorageEntity = new ArrayList();//库存
  738. ArrayList al_CkStoragePosEntity = new ArrayList();
  739. //DataTable dt = null;
  740. //foreach (DataRow dr in dataTable5.Rows)
  741. //{
  742. //CkStorage CkStorageEntity = new CkStorage();
  743. //PurCkStoragePosEntity CkStoragePosEntity = new PurCkStoragePosEntity();//库存收发存表
  744. ////-----------------------------------------------------------------------------库存单表
  745. //PurCkInBillEntity ck = new PurCkInBillEntity();
  746. //ck = this.GetJsonService().execute<PurCkInBillEntity>("com.hnshituo.pur.ck.service.CkInBillService", "findById", new object[] { dr["InStockNo"].ToString() });
  747. //CkStorageEntity = EntityHelper.CopyEntity<CkStorage>(ck);//复制发货通知单行号中相同的字段值
  748. ////CkStorageEntity = EntityHelper.CopyEntity<CkStorage>(CkInBillEntity);//复制合同行号中相同的字段值
  749. ////CkStorageEntity.RefType = "2";//1.送货单,2.收货单
  750. //CkStorageEntity.InvId = ck.InStockNo.Replace("RK", "CK");
  751. //CkStorageEntity.Validflag = "1";
  752. //CkStorageEntity.InvQty = ck.InNum;//库存数量
  753. //CkStorageEntity.InvOrigQty = ck.InNum;//期初库存数量
  754. //al_CkStorageEntity.Add(CkStorageEntity);
  755. ////---------------------------------------------------------------------------------------------------------------------------------库存储位明细表
  756. //PurCkInbillPositionEntity CkInbillPositionEntity = new PurCkInbillPositionEntity();//入库单储位明细表
  757. //CkInbillPositionEntity.InStockNo = ck.InStockNo;
  758. //DataTable dtp = this.GetJsonService().execute<DataTable>("com.hnshituo.pur.ck.service.CkInbillPositionService", "find", new object[] { CkInbillPositionEntity, 0, 0 });
  759. //for (int i = 0; i < dtp.Rows.Count; i++)
  760. //{
  761. // CkStoragePosEntity.InvId = CkStorageEntity.InvId;//库存记录号记录发货通知单行号,方便在后台获取入库单号
  762. // CkStoragePosEntity.InvPosId = CkStorageEntity.InvId + "00" + i;
  763. // CkStoragePosEntity.Validflag = "1";
  764. // double bINNUM = 0;
  765. // double.TryParse(dtp.Rows[i]["INNUM"].ToString(), out bINNUM);
  766. // CkStoragePosEntity.InvOrigQty = bINNUM;//期初入库量
  767. // CkStoragePosEntity.InvQty = bINNUM;//库存数量
  768. // CkStoragePosEntity.InvPhysic = CkStorageEntity.InvPhysic;
  769. // CkStoragePosEntity.InvPos = dtp.Rows[i]["InvPos"].ToString();//ugr_5.Cells["INVPOS"].Value.ToString();//库位
  770. // CkStoragePosEntity.PackageQty = dtp.Rows[i]["PackageQty"].ToString();//包装数量
  771. // //CkStoragePosEntity.PackageUnit = dtp.Rows[i]["PackageUnit"].ToString();//包装单位
  772. // al_CkStoragePosEntity.Add(CkStoragePosEntity);//添加库存单储位明细表
  773. //}
  774. //}
  775. ArrayList al= comm.getDtGroupBy_reAl(dataTable5, "InStockNo");
  776. CoreResult crt = this.GetJsonService().execute<CoreResult>("com.hnshituo.pur.ck.service.CkInBillService", "ExportCkToStorage", new object[] { al });
  777. if (crt.Resultcode != 0)
  778. {
  779. MessageUtil.ShowTips("导入失败 " + crt.Resultmsg);
  780. return;
  781. }
  782. MessageUtil.ShowTips("导入成功");//,入库单号:" + crt.Resultmsg);
  783. }
  784. private void ultraButton1_Click(object sender, EventArgs e)
  785. {
  786. //ExportCkToStorage();
  787. ExportCkToCkOut();
  788. }
  789. /// <summary>
  790. /// 导入入库单到库存
  791. /// </summary>
  792. private void ExportCkToCkOut()
  793. {
  794. ArrayList al = comm.getDtGroupBy_reAl(dataTable5, "InStockNo");
  795. CoreResult crt = this.GetJsonService().execute<CoreResult>("com.hnshituo.pur.ck.service.CkInBillService", "ExportCkToCkOut", new object[] { al });
  796. if (crt.Resultcode != 0)
  797. {
  798. MessageUtil.ShowTips("导入失败 " + crt.Resultmsg);
  799. return;
  800. }
  801. MessageUtil.ShowTips("导入成功 " + crt.Resultmsg);//,入库单号:" + crt.Resultmsg);
  802. }
  803. private void ultraGroupBox1_Click(object sender, EventArgs e)
  804. {
  805. }
  806. private void ultraGrid4_InitializeLayout(object sender, InitializeLayoutEventArgs e)
  807. {
  808. }
  809. private void ultraButton2_Click(object sender, EventArgs e)
  810. {
  811. ExportCkToCkOut();
  812. }
  813. private void ultraGrid4_InitializeRow(object sender, InitializeRowEventArgs e)
  814. {
  815. UltraGridRow ugr = e.Row;
  816. if (!String.IsNullOrEmpty(ugr.Cells["printcode"].Value.ToString().Trim()))
  817. {
  818. ugr.CellAppearance.ForeColor = System.Drawing.Color.FromArgb(255, 128, 0);
  819. }
  820. else
  821. {
  822. ugr.CellAppearance.ForeColor = Color.Black;
  823. }
  824. //标记待检状态入库单
  825. if (ugr.Cells["status"].Value.ToString() == "待检")
  826. {
  827. ugr.Cells["status"].Appearance.ForeColor = Color.Red;// System.Drawing.Color.FromArgb(255, 128, 0);
  828. }
  829. else
  830. {
  831. ugr.Cells["status"].Appearance.ForeColor = Color.Black;
  832. }
  833. }
  834. private void ultraGrid4_CellChange(object sender, CellEventArgs e)
  835. {
  836. ultraGrid4.UpdateData();
  837. String suppname = "";
  838. String orderLineSqe = "";
  839. String basename = "";
  840. int i = 0;
  841. if (e.Cell.Column.Key == "Check")
  842. {
  843. foreach (UltraGridRow row in ultraGrid4.Rows)
  844. {
  845. if (Convert.ToBoolean(row.GetCellValue("Check")) == true)
  846. {
  847. String strSuppname = row.Cells["suppname"].Value.ToString();
  848. String strOrderLineSqe = row.Cells["orderid"].Value.ToString();
  849. String strBasename = row.Cells["basename"].Value.ToString();
  850. if (i == 0)
  851. {
  852. suppname = strSuppname;
  853. orderLineSqe = strOrderLineSqe;
  854. basename = strBasename;
  855. }
  856. else
  857. {
  858. if (suppname != strSuppname)
  859. {
  860. MessageUtil.ShowTips("请选择同供应商下入库单进行操作!");
  861. e.Cell.Row.Cells["Check"].Value = !Convert.ToBoolean(e.Cell.Row.GetCellValue("Check"));
  862. return;
  863. }
  864. if (orderLineSqe != strOrderLineSqe)
  865. {
  866. MessageUtil.ShowTips("请选择同合同下入库单进行操作!");
  867. e.Cell.Row.Cells["Check"].Value = !Convert.ToBoolean(e.Cell.Row.GetCellValue("Check"));
  868. return;
  869. }
  870. if (basename != strBasename)
  871. {
  872. MessageUtil.ShowTips("请选择同物料类别下入库单进行操作!");
  873. e.Cell.Row.Cells["Check"].Value = !Convert.ToBoolean(e.Cell.Row.GetCellValue("Check"));
  874. return;
  875. }
  876. }
  877. i = i + 1;
  878. }
  879. }
  880. }
  881. }
  882. }
  883. }