| | |
| | | public override bool AddBill(ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | { |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | if (DBUtility.ClsPub.isLong(omodel.HInterID) == 0) |
| | | { |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | // |
| | | oCn.BeginTran(); |
| | | //主表 |
| | | oCn.RunProc("Insert Into Sc_StationInBillMain " + |
| | |
| | | ////// |
| | | oCn.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + omodel.HInterID.ToString() + ",1"); |
| | | |
| | | |
| | | |
| | | //==================è¿ç«åå¯ç¨é
ä»¶æ¸
åç»å®ï¼ è¿è¡ ä¿åå¼ºå¶æ§å¶ |
| | | |
| | | //============================== |
| | | |
| | | //夿æ¯å¦æ¯ é¦éå·¥åº |
| | | DataSet ds1; |
| | | ds1 = oCn.RunProcReturn(" select HLastProc,HFstProc from Sc_ProcessExchangeBillMain a " + |
| | |
| | | |
| | | } |
| | | |
| | | public bool DeleteBill(long HInterID, long HProcExchInterID, long HProcExchEntryID,string HBillNo,string procName,string user, ref string sReturn) |
| | | { |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | //HBillSubType=2 åå§åè¿ç« ææµè½¬å¡åå§åæ è®°æ¹ä¸º0 |
| | | //DataSet Ds; |
| | | //Ds = oCn.RunProcReturn("select HBillSubType from Sc_StationInBillMain where HInterID=" + HInterID, "h_p_Sc_StationDelete"); |
| | | //if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0][0]) == "2") |
| | | //{ |
| | | // oCn.RunProc("update Sc_ProcessExchangeBillsub set HCSHJZFlag=0 where HInterID=" + HProcExchInterID); |
| | | //} |
| | | |
| | | ////// |
| | | oCn.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + HInterID.ToString() + ",-1"); |
| | | // |
| | | //å é¤ |
| | | oCn.RunProc("delete Sc_StationInBillMain where HInterID=" + HInterID); |
| | | //åå¡«æµè½¬å¡è¿ç«æ¶é´ |
| | | //oCn.RunProc("update Sc_ProcessExchangeBillsub set HRelBeginDate=null where HInterID=" + HProcExchInterID + " and HEntryID=" + HProcExchEntryID); |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec " + procName + " " + HInterID + ",'" + HBillNo + "','" + user + "'"; |
| | | DataSet ds = oCn.RunProcReturn(sql2, procName); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | |
| | | sReturn = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | sReturn = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | oCn.RollBack(); |
| | | return false; |
| | | } |
| | | //============================================================================================== |
| | | |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | sReturn = e.Message; |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | |
| | | } |
| | | |
| | | public bool CheckCenterIDByUser(long HCenterID) |
| | | { |
| | | DataSet Ds; |