| | |
| | | //æªæ»¡æçæ æé® ç¹å»äºä»¶ |
| | | private void button_produceByHand_Click(object sender, EventArgs e) |
| | | { |
| | | if (HQty == 0) |
| | | try |
| | | { |
| | | MessageBox.Show("请æ«ç åæ¡ç !"); |
| | | return; |
| | | if (HQty == 0) |
| | | { |
| | | MessageBox.Show("请æ«ç åæ¡ç !"); |
| | | return; |
| | | } |
| | | this.Sub_SaveBill(); |
| | | }catch(Exception ex) |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | } |
| | | this.Sub_SaveBill(); |
| | | } |
| | | |
| | | //èªå¨ç»æ |
| | |
| | | { |
| | | if(isStartListen == 1) |
| | | { |
| | | if(HQty == DBUtility.ClsPub.isDoule(textBox_PackQty.Text)) |
| | | try |
| | | { |
| | | this.Sub_SaveBill(); |
| | | |
| | | //设置æå°æ¨¡æ¿ï¼æå° |
| | | grdSub.Rows[0].Cells[0].Value = "*"; |
| | | Report = new GridppReport(); |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + textBox_PrintModelParams.Text + ".grf"); //here . |
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord); |
| | | Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable); |
| | | Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd); |
| | | if (comboBox_PrinterParams.Text != "") |
| | | if (HQty == DBUtility.ClsPub.isDoule(textBox_PackQty.Text)) |
| | | { |
| | | Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(é»è®¤)", ""); |
| | | this.Sub_SaveBill(); |
| | | |
| | | //设置æå°æ¨¡æ¿ï¼æå° |
| | | grdSub.Rows[0].Cells[0].Value = "*"; |
| | | Report = new GridppReport(); |
| | | Report.LoadFromFile(DBUtility.ClsPub.AppPath + @"\" + textBox_PrintModelParams.Text + ".grf"); //here . |
| | | Report.BeforePostRecord += new _IGridppReportEvents_BeforePostRecordEventHandler(ReportBeforePostRecord); |
| | | Report.FetchRecord += new _IGridppReportEvents_FetchRecordEventHandler(ReportFetchRecordByDataTable); |
| | | Report.PrintEnd += new _IGridppReportEvents_PrintEndEventHandler(ReportPrintEnd); |
| | | if (comboBox_PrinterParams.Text != "") |
| | | { |
| | | Report.Printer.PrinterName = comboBox_PrinterParams.Text.Replace("(é»è®¤)", ""); |
| | | } |
| | | Report.Print(false); |
| | | } |
| | | Report.Print(false); |
| | | }catch(Exception ex) |
| | | { |
| | | MessageBox.Show(ex.Message); |
| | | } |
| | | } |
| | | } |
| | |
| | | //çææçæ¡ç |
| | | private bool Sub_SaveBill() |
| | | { |
| | | //è·åç»ç»ä¿¡æ¯ |
| | | HOrgID = get_ORGANIZATIONSIDByName(cmbHOrgID.Text); |
| | | HOrgNumber = get_ORGANIZATIONSNOByName(cmbHOrgID.Text); |
| | | |
| | | if (HOrgID == -1) |
| | | try |
| | | { |
| | | MessageBox.Show("éæ©ç»ç»æé误ï¼"); |
| | | return false; |
| | | } |
| | | //è·åç»ç»ä¿¡æ¯ |
| | | HOrgID = get_ORGANIZATIONSIDByName(cmbHOrgID.Text); |
| | | HOrgNumber = get_ORGANIZATIONSNOByName(cmbHOrgID.Text); |
| | | |
| | | if (HOrgID == -1) |
| | | { |
| | | throw new Exception("éæ©ç»ç»æé误ï¼"); |
| | | } |
| | | |
| | | if (!Sub_AllowSave())//忮宿´æ§å¤æ |
| | | if (!Sub_AllowSave())//忮宿´æ§å¤æ |
| | | { |
| | | throw new Exception("忮宿´æ§å¤æå¤±è´¥ï¼"); |
| | | } |
| | | |
| | | SaveBarCode(); |
| | | return true; |
| | | }catch(Exception ex) |
| | | { |
| | | return false; |
| | | throw new Exception(ex.Message); |
| | | } |
| | | |
| | | |
| | | SaveBarCode(); |
| | | return true; |
| | | |
| | | } |
| | | |
| | | //忮宿´æ§å¤æ æªå®æ |
| | |
| | | |
| | | sSQLMul[1] = " exec h_p_WMS_SetMaxNo_QTY '" + sTMNumber + "'," + HQty.ToString() + " "; |
| | | |
| | | //夿å½åæçæ¡ç æ¯å¦å·²ç»éè¿ä¸´æ¶ç»æå¨æ¡ç æ¡£æ¡ä¸çæäºï¼è¥å·²ç»çæäºåä¸éè¦å¨æå
¥ |
| | | ds = oCn.RunProcReturn("select * from Gy_BarCodeBill where HBarCode = '" + textBox_HPackBarCode.Text + "' and HSTOCKORGID = " + HOrgID, "Gy_BarCodeBill"); |
| | | if (ds != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | sSQLMul[0] = ""; |
| | | } |
| | | |
| | | oCn.BeginTran(); |
| | | |
| | | if (getRunProcByMul_Back(sSQLMul, ref DBUtility.ClsPub.sExeReturnInfo)) |
| | | { |
| | | //MessageBox.Show("æ¡ç çæå®æ¯ï¼"); |
| | |
| | | setPackBarCodeBillData(); |
| | | |
| | | getDisplay_GrdMain(); |
| | | |
| | | oCn.Commit(); |
| | | } |
| | | else |
| | | { |
| | | //MessageBox.Show("æ¡ç çæå¤±è´¥ï¼" + DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.RollBack(); |
| | | } |
| | | |
| | | //oCn.Commit(); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | //MessageBox.Show("æ¡ç çæå¤±è´¥ï¼" + e.Message); |
| | | oCn.RollBack(); |
| | | throw new Exception(e.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | for (int i = 0; i < 1; i++) |
| | | { |
| | | oCn.RunProc(sSQL[i]); |
| | | if (sSQL[i].Length > 0) |
| | | { |
| | | oCn.RunProc(sSQL[i]); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //ä¸ä¼ ç»æä¿¡æ¯å°æå¡å¨ |
| | | send(); |
| | | oCn.Commit(); |
| | | } |
| | | else |
| | | { |
| | | sErrMsg = "æ²¡ææ°æ®ï¼"; |
| | | oCn.Commit(); |
| | | return false; |
| | | sErrMsg = "æ²¡ææ°æ®ï¼"; |
| | | throw new Exception(sErrMsg); |
| | | } |
| | | oCn.Commit(); |
| | | //oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = e.Message; |
| | | oCn.RollBack(); |
| | | return false; |
| | | sErrMsg = e.Message; |
| | | throw new Exception(sErrMsg); |
| | | } |
| | | } |
| | | #endregion |
| | |
| | | //{ |
| | | // return; |
| | | //} |
| | | LoadData(); |
| | | try |
| | | { |
| | | LoadData(); |
| | | }catch(Exception ex) |
| | | { |
| | | throw new Exception(ex.Message); |
| | | } |
| | | } |
| | | |
| | | //å¤æç¨æ·æé |
| | |
| | | //夿æ¯å¦æ°æ®å®æ´ |
| | | if (AllowLoadData() == false) |
| | | { |
| | | return; |
| | | throw new Exception("æ°æ®å®æ´æ§å¤æå¤±è´¥ï¼"); |
| | | } |
| | | try |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show("çæå¤±è´¥ï¼åå :" + err); |
| | | return; |
| | | string error = "çæå¤±è´¥ï¼åå :" + err; |
| | | throw new Exception(error); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show("åæ®å·ï¼" + textBox_sBillID.Text + "ï¼åæ®IDï¼" + textBox_sBillID.Text + "ï¼ä¸ä¼ 失败ï¼" + e.Message); |
| | | return; |
| | | string error = "åæ®å·ï¼" + textBox_sBillID.Text + "ï¼åæ®IDï¼" + textBox_sBillID.Text + "ï¼ä¸ä¼ 失败ï¼" + e.Message; |
| | | throw new Exception(error); |
| | | } |
| | | } |
| | | |
| | |
| | | public bool set_SavePackUnionBill_Add(Int64 HInterID, string HBillType, string HBillNo, string HBarCode_Pack, string HMaker, Int64 HStockOrgID, ref string sErrMsg) |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | oCn.BeginTran(); |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | DataSet ds = oCn.RunProcReturn("exec h_p_Sc_PackUnionBill_Insert_New " + HInterID.ToString() + ",'" + HBillNo + "','" + HBillType + "','" + HBarCode_Pack + "','" + HMaker + "'," + HStockOrgID.ToString(), "h_p_Sc_PackUnionBill_Insert_New"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | sErrMsg = "åæ®å·ï¼" + HBillNo + "ï¼åæ®IDï¼" + HInterID + "ï¼ä¸ä¼ 失败ï¼"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | sErrMsg = "åæ®å·ï¼" + HBillNo + "ï¼åæ®IDï¼" + HInterID + "ï¼ä¸ä¼ 失败ï¼"; |
| | | throw new Exception(sErrMsg); |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 1) |
| | | { |
| | | sErrMsg = "ä¸ä¼ 失败ï¼åæ®å·ï¼" + HBillNo + "ï¼åæ®IDï¼" + HInterID + "ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | oCn.RollBack(); |
| | | return false; |
| | | sErrMsg = "ä¸ä¼ 失败ï¼åæ®å·ï¼" + HBillNo + "ï¼åæ®IDï¼" + HInterID + "ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | throw new Exception(sErrMsg); |
| | | } |
| | | else |
| | | { |
| | | //sErrMsg = "çæçäº§ç»æåæåï¼åæ®å·ä¸ºï¼" + HBillNo; |
| | | oCn.Commit(); |
| | | //sErrMsg = "çæçäº§ç»æåæåï¼åæ®å·ä¸ºï¼" + HBillNo; |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sErrMsg = "çæçäº§ç»æå失败ï¼" + e.Message; |
| | | oCn.RollBack(); |
| | | return false; |
| | | sErrMsg = "çæçäº§ç»æå失败ï¼" + e.Message; |
| | | throw new Exception(sErrMsg); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Exception e2) |
| | | { |
| | | //if (DBUtility.ClsPub.bSound) |
| | | //{ |
| | | // DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning); |
| | | //} |
| | | MessageBox.Show("åçç½ç»å¼å¸¸ï¼è¯·ç¨ååè¯ï¼"); |
| | | textBox_HBarCode.Text = ""; |
| | | textBox_HBarCode.Focus(); |
| | | MessageBox.Show(e2.Message); |
| | | } |
| | | } |
| | | //å°æ¡ç ä¿¡æ¯åå
¥æ¡ç åºå
¥åºä¸´æ¶è¡¨ |
| | |
| | | } |
| | | else |
| | | { |
| | | MessageBox.Show(err); |
| | | return; |
| | | throw new Exception(err); |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | MessageBox.Show("æ«æåæ¡ç ï¼åå
¥ä¸´æ¶è¡¨ä¿¡æ¯å¤±è´¥ï¼" + e.Message + err); |
| | | string sError = "æ«æåæ¡ç ï¼åå
¥ä¸´æ¶è¡¨ä¿¡æ¯å¤±è´¥ï¼" + e.Message + err; |
| | | throw new Exception(sError); |
| | | } |
| | | } |
| | | |