| | |
| | | // |
| | | public string ModName = "3301"; |
| | | public string ModCaption = "å·¥èºè·¯çº¿"; |
| | | public const string ModRightName = "Gy_RoutingBill"; |
| | | public const string ModRightNameEdit = ModRightName + "_Edit"; //ç¼è¾ |
| | | public const string ModRightNameCheck = ModRightName + "_Check"; //å®¡æ ¸ |
| | | public const string ModRightNameClose = ModRightName + "_Close"; //å
³é |
| | | public const string ModRightNameDelete = ModRightName + "_Delete"; //ä½åº |
| | | public const string ModRightNameDrop = ModRightName + "_Drop"; //å é¤ |
| | | public bool BillChange; // |
| | | |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | |
| | | public DAL.ClsGy_RoutingBill BillNew =new DAL.ClsGy_RoutingBill(); |
| | | public DAL.ClsGy_RoutingBill BillOld = new DAL.ClsGy_RoutingBill(); |
| | | ClsGridViewSum oSumGrid = new ClsGridViewSum(); |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | public string CampanyName = ""; //ç³»ç»åæ° å®¢æ· |
| | | public Int64 HOrgID = -1; //ç»ç»å
ç |
| | | //------------------------------------------------------------------------- |
| | | #region åºå®ä»£ç |
| | | |
| | | |
| | | |
| | | //æ¸
空çé¢ |
| | | public void Sub_ClearBill() |
| | | { |
| | | DBUtility.Xt_BaseBillFun.Sub_ClearBill(gbUp); |
| | | // |
| | | |
| | | //è·åç³»ç»åæ° å®¢æ· |
| | | ClsXt_SystemParameter oClsXt_SystemParameter = new ClsXt_SystemParameter(); |
| | | CampanyName = oClsXt_SystemParameter.GetSingleSystemParameter("WMS_CampanyName", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | |
| | | //è·åç»ç»ä¿¡æ¯ |
| | | DataSet Ds1 = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS with(nolock) where HItemID=" + ClsPub.HOrgID, "Xt_ORGANIZATIONS", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (Ds1.Tables[0].Rows.Count != 0) |
| | | { |
| | | cmbHOrgID.Text = DBUtility.ClsPub.isStrNull(Ds1.Tables[0].Rows[0]["HName"]); |
| | | cmbHOrgID.Enabled = false; |
| | | } |
| | | |
| | | txtHMaker.Text = ClsPub.CurUserName; |
| | | txtHMakeDate.Text = ""; |
| | | txtHChecker.Text = ""; |
| | |
| | | //å é¤åæ® |
| | | private void Sub_DeleteBill() |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(ModRightNameDrop, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | string s = ""; |
| | | if (BillOld.ShowBill(BillOld.omodel.HInterID, ref s) == false) |
| | | { |
| | |
| | | g.DrawLine(p, new Point(txtHChecker.Left, txtHChecker.Top + txtHChecker.Height), new Point(txtHChecker.Left + txtHChecker.Width, txtHChecker.Top + txtHChecker.Height)); |
| | | g.DrawLine(p, new Point(txtHCheckDate.Left, txtHCheckDate.Top + txtHCheckDate.Height), new Point(txtHCheckDate.Left + txtHCheckDate.Width, txtHCheckDate.Top + txtHCheckDate.Height)); |
| | | // |
| | | g.DrawLine(p, new Point(txtHUseMan.Left, txtHUseMan.Top + txtHUseMan.Height), new Point(txtHUseMan.Left + txtHUseMan.Width, txtHUseMan.Top + txtHUseMan.Height)); |
| | | g.DrawLine(p, new Point(txtHUseDate.Left, txtHUseDate.Top + txtHUseDate.Height), new Point(txtHUseDate.Left + txtHUseDate.Width, txtHUseDate.Top + txtHUseDate.Height)); |
| | | // |
| | | g.DrawLine(p, new Point(txtHCloseMan.Left, txtHCloseMan.Top + txtHCloseMan.Height), new Point(txtHCloseMan.Left + txtHCloseMan.Width, txtHCloseMan.Top + txtHCloseMan.Height)); |
| | | g.DrawLine(p, new Point(txtHCloseDate.Left, txtHCloseDate.Top + txtHCloseDate.Height), new Point(txtHCloseDate.Left + txtHCloseDate.Width, txtHCloseDate.Top + txtHCloseDate.Height)); |
| | | // |
| | |
| | | oSumGrid.oGridsum = grdSum; |
| | | this.Text = ModCaption; |
| | | this.lblCaption.Text = ModCaption; |
| | | //å è½½ç»ç»ä¿¡æ¯ |
| | | Sub_AddOrdList(); |
| | | } |
| | | |
| | | //å è½½ç»ç»ä¿¡æ¯ |
| | | private void Sub_AddOrdList() |
| | | { |
| | | DataSet ds; |
| | | DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); |
| | | ds = oClsGy_ORGANIZATIONS_View.GetList(); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | MessageBox.Show("è·åç»ç»å¤±è´¥"); |
| | | return; |
| | | } |
| | | cmbHOrgID.Items.Clear(); |
| | | for (int i = 0; i < ds.Tables[0].Rows.Count; i++) |
| | | { |
| | | cmbHOrgID.Items.Add(DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[i]["HName"])); |
| | | } |
| | | } |
| | | |
| | | //é¦å¼ |
| | | private void Sub_First() |
| | | { |
| | |
| | | //å®¡æ ¸åæ® |
| | | private void Sub_CheckBill() |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(ModRightNameCheck, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | MessageBox.Show("æ°å¢ç¶æä¸å
è®¸å®¡æ ¸åæ®ï¼è¯·å
ä¿ååæ®ï¼", "æç¤º"); |
| | | } |
| | | |
| | | if (BillOld.CheckBill(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | BillChange = true; |
| | |
| | | //å审忮 |
| | | private void Sub_AbandonCheck() |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(ModRightNameCheck, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | MessageBox.Show("æ°å¢ç¶æä¸å
许åå®¡æ ¸åæ®ï¼è¯·å
ä¿ååæ®ï¼", "æç¤º"); |
| | | } |
| | | |
| | | if (BillOld.AbandonCheck(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | BillChange = true; |
| | |
| | | //å
³éåæ® |
| | | private void Sub_CloseBill() |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(ModRightNameClose, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | MessageBox.Show("æ°å¢ç¶æä¸å
许å
³éåæ®ï¼è¯·å
ä¿ååæ®ï¼", "æç¤º"); |
| | | } |
| | | |
| | | if (BillOld.CloseBill(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | BillChange = true; |
| | |
| | | //åå
³éåæ® |
| | | private void Sub_Cancel() |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(ModRightNameClose, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | MessageBox.Show("æ°å¢ç¶æä¸å
许åå
³éåæ®ï¼è¯·å
ä¿ååæ®ï¼", "æç¤º"); |
| | | } |
| | | |
| | | if (BillOld.CancelClose(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | BillChange = true; |
| | |
| | | //ä½åºåæ® |
| | | private void Sub_Cancelltion() |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | MessageBox.Show("æ°å¢ç¶æä¸å
许ä½åºåæ®ï¼è¯·å
ä¿ååæ®ï¼", "æç¤º"); |
| | | } |
| | | |
| | | if (BillOld.Cancelltion(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | BillChange = true; |
| | |
| | | //åä½åº |
| | | private void Sub_AbandonCancelltion() |
| | | { |
| | | //夿æé |
| | | if (!ClsPub.Security_Log(ModRightNameDelete, 1, true, DBUtility.ClsPub.CurUserName)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (BillStatus == DBUtility.ClsPub.Enum_BillStatus.BillStatus_AddNew) |
| | | { |
| | | MessageBox.Show("æ°å¢ç¶æä¸å
许åä½åºåæ®ï¼è¯·å
ä¿ååæ®ï¼", "æç¤º"); |
| | | } |
| | | |
| | | if (BillOld.AbandonCancelltion(BillOld.omodel.HInterID, ref ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | BillChange = true; |
| | |
| | | pic1.Image = System.Drawing.Image.FromFile(ClsPub.AppPath + @"/Pic/Closed.jpg"); |
| | | // |
| | | } |
| | | if (txtHCloseMan.Text.Trim() != "") |
| | | { |
| | | sh.Enabled = false; |
| | | qsh.Enabled = false; |
| | | //gb.Enabled = false; |
| | | //hf.Enabled = true; |
| | | xg.Enabled = false; |
| | | sc.Enabled = false; |
| | | // |
| | | pic1.Visible = true; |
| | | pic1.Image = System.Drawing.Image.FromFile(ClsPub.AppPath + @"/Pic/Closed.jpg"); |
| | | } |
| | | if (txtHDeleteMan.Text.Trim() == "") |
| | | { |
| | | //zf.Enabled = true; |
| | |
| | | this.textHProductNum.Text = BillOld.omodel.HProductNum.ToString(); |
| | | this.textHVerNum.Text = BillOld.omodel.HVerNum.ToString(); |
| | | |
| | | //è·åç»ç»ä¿¡æ¯ |
| | | DataSet Ds1 = oCn.RunProcReturn("select * from Xt_ORGANIZATIONS with(nolock) where HItemID=" + BillOld.omodel.HORGID.ToString(), "Xt_ORGANIZATIONS", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | if (Ds1.Tables[0].Rows.Count != 0) |
| | | { |
| | | cmbHOrgID.Text = DBUtility.ClsPub.isStrNull(Ds1.Tables[0].Rows[0]["HName"]); |
| | | } |
| | | |
| | | //å è½½è¡¨ä½ |
| | | int i = 0; |
| | | foreach (Model.ClsGy_RoutingBillSub oSub in BillOld.DetailColl) |
| | |
| | | MessageBox.Show("å使²¡æéæ©ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (CampanyName == "å¯è´å¥ç¹") //ç³»ç»åæ° å®¢æ· |
| | | { |
| | | if (DBUtility.ClsPub.isStrNull(textHPicNumVer.Text) == "") |
| | | { |
| | | MessageBox.Show("å¾å·çæ¬æ²¡æå½å
¥ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(textHPicNumAssemble.Text) == "") |
| | | { |
| | | MessageBox.Show("æ»è£
å¾å·æ²¡æå½å
¥ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(textHMaterTexture.Text) == "") |
| | | { |
| | | MessageBox.Show("æè´¨æ²¡æå½å
¥ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(textHProductNum.Text) == "") |
| | | { |
| | | MessageBox.Show("æåç¼å·æ²¡æå½å
¥ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(textHVerNum.Text) == "") |
| | | { |
| | | MessageBox.Show("çæ¬æ²¡æå½å
¥ï¼", "æç¤º"); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //忮巿¯å¦éå¤ |
| | | if (BillNew.IsExistBillNo(ref ClsPub.sExeReturnInfo, txtHBillNo.Text.Trim(), BillStatus, BillOld.omodel.HInterID)) |
| | | { |
| | |
| | | lblCaption.Focus(); |
| | | if (!Sub_AllowSave())//忮宿´æ§å¤æ |
| | | return false; |
| | | |
| | | // è·åç»ç»å
ç |
| | | DAL.ClsGy_ORGANIZATIONS_View oClsGy_ORGANIZATIONS_View = new DAL.ClsGy_ORGANIZATIONS_View(); |
| | | if (oClsGy_ORGANIZATIONS_View.GetInfoByName(cmbHOrgID.Text)) |
| | | { |
| | | HOrgID = oClsGy_ORGANIZATIONS_View.omodel.HItemID; |
| | | } |
| | | if (HOrgID == -1) |
| | | { |
| | | MessageBox.Show("éæ©ç»ç»æé误ï¼"); |
| | | return false; |
| | | } |
| | | |
| | | //èµå¼ID |
| | | if (BillStatus ==DBUtility.ClsPub.Enum_BillStatus.BillStatus_Modify) |
| | | BillNew.omodel.HInterID = BillOld.omodel.HInterID; |
| | |
| | | BillNew.omodel.HMaterTexture = ClsPub.isStrNull(this.textHMaterTexture.Text); |
| | | BillNew.omodel.HProductNum = ClsPub.isStrNull(this.textHProductNum.Text); |
| | | BillNew.omodel.HVerNum = ClsPub.isStrNull(this.textHVerNum.Text); |
| | | BillNew.omodel.HORGID = HOrgID; |
| | | |
| | | //æç»ç±»èµå¼ |
| | | BillNew.DetailColl=new List<Model.ClsGy_RoutingBillSub>(); |