| | |
| | | public string HMainSourceBillNo; |
| | | public string HMainSourceBillType; |
| | | public int HOrderLevID; |
| | | public int HHasten; |
| | | } |
| | | #endregion |
| | | |
| | |
| | | string HMainSourceBillNo = mainList[0].HMainSourceBillNo; |
| | | string HMainSourceBillType = mainList[0].HMainSourceBillType; |
| | | int HOrderLevID = mainList[0].HOrderLevID; |
| | | int HHasten = mainList[0].HHasten; |
| | | |
| | | |
| | | |
| | | if (OperationType == 2) |
| | |
| | | { |
| | | string sql = "insert into PM_WorkTaskBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" + |
| | | ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID,HHasten)" + |
| | | ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID)" + |
| | | "values(" + |
| | | "" + HYear + |
| | | "," + HPeriod + |
| | |
| | | "','" + HReceiveEmp + |
| | | "','" + HType + |
| | | "','" + HCopyEmp + |
| | | "','" + HRemark + |
| | | "','" + HRemark + |
| | | "'," + HOrgID + |
| | | ",'" + HMaker + |
| | | "','" + HMakerDate + |
| | |
| | | "," + HMainSourceEntryID + |
| | | ",'" + HMainSourceBillNo + |
| | | "','" + HMainSourceBillType + |
| | | "','" + HOrderLevID + |
| | | "','" + HHasten + |
| | | "','" + HOrderLevID + |
| | | "')"; |
| | | |
| | | //主表 |
| | |
| | | ",HMainSourceEntryID = " + HMainSourceEntryID + |
| | | ",HMainSourceBillNo = '" + HMainSourceBillNo + |
| | | "',HMainSourceBillType = '" + HMainSourceBillType + |
| | | "',HOrderLevID = '" + HOrderLevID + |
| | | "',HHasten = '" + HHasten + |
| | | "',HOrderLevID = '" + HOrderLevID + |
| | | "' where HInterID = " + HInterID; |
| | | |
| | | oCN.RunProc(sql); |
| | |
| | | { |
| | | string sql = "insert into PM_WorkTaskBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HBillNo,HProjectID,HProNumber,HProjectStageID,HName,HDate,HTaskNote,HPlanTimes" + |
| | | ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID,HHasten )" + |
| | | ",HSelfTimes,HLastDate,HSendEmp,HReceiveEmp,HType,HCopyEmp,HRemark,HOrgID,HMaker,HMakeDate,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HOrderLevID )" + |
| | | "values(" + |
| | | "" + HYear + |
| | | "," + HPeriod + |
| | |
| | | ",'" + HMainSourceBillNo + |
| | | "','" + HMainSourceBillType + |
| | | "','" + HOrderLevID + |
| | | "','" + HHasten + |
| | | "')"; |
| | | //主表 |
| | | oCN.RunProc(sql); |
| | |
| | | BillOld.MvarItemKey = "PM_WorkTaskBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 0 å¼å§ä»»å¡ 1 æ¤éä»»å¡ |
| | | //Type 0 å¼å§ä»»å¡ 1 æ¤éä»»å¡ 2ç»æä»»å¡ |
| | | if (Type == 0) |
| | | { |
| | | //夿忮æ¯å¦åå¨ |
| | |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string sql1= "update PM_WorkTaskBillMain set HTaskStatus='è¿è¡ä¸' where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain"); |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HMainSourceBillType"])== "4759") |
| | | { |
| | | var lInterID = ds.Tables[0].Rows[0]["HMainSourceInterID"]; |
| | | string sql1 = "update PM_WorkTaskBillMain set HTaskStatus='å·²å¼å§' where HinterID = " + HInterID; |
| | | oCN.RunProc(sql1); |
| | | string sql2 = "update PM_CustomerTaskBillMain set HTaskStatus='å·²å¼å§' where HinterID = " + lInterID; |
| | | oCN.RunProc(sql2); |
| | | } |
| | | else |
| | | { |
| | | string sql2 = "update PM_WorkTaskBillMain set HTaskStatus='å·²å¼å§' where HinterID = " + HInterID; |
| | | oCN.RunProc(sql2); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | var lInterID = ds.Tables[0].Rows[0]["HMainSourceInterID"]; |
| | | string sql1 = "update PM_WorkTaskBillMain set HTaskStatus='æªå¼å§' where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain"); |
| | | oCN.RunProc(sql1); |
| | | string sql2 = "update PM_CustomerTaskBillMain set HTaskStatus='æªå¼å§' where HinterID = " + lInterID; |
| | | oCN.RunProc(sql2); |
| | | } |
| | | } |
| | | else if (Type == 2) |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥ä½ä»»å¡ å¬ä¿æ¬¡æ°åè½ |
| | | [Route("PM_WorkTaskBill/UpdateHHasten")] |
| | | [HttpGet] |
| | | public object UpdateHHasten(string HInterID, int HHasten, string user) |
| | | { |
| | | try |
| | | { |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | //夿忮æ¯å¦åå¨ |
| | | DataSet ds; |
| | | string sql = "select * from PM_WorkTaskBillMain where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "PM_WorkTaskBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string sql1 = "update PM_WorkTaskBillMain set HTaskStatus='å·²ç»æ' where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain"); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "PM_WorkTaskBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | DataSet ds; |
| | | string sql = "select * from PM_WorkTaskBillMain where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, "PM_WorkTaskBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | string sql1 = "update PM_WorkTaskBillMain set HHasten='"+ HHasten+ "' where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql1, "PM_WorkTaskBillMain"); |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | |
| | | string HSourceBillType = oSub.HSourceBillType; |
| | | bool HFinishFlag = oSub.HFinishFlag; |
| | | |
| | | if (HFinishFlag==true) |
| | | { |
| | | //夿忮æ¯å¦åå¨ |
| | | DataSet ds; |
| | | string sqls = "select * from PM_WorkTaskBillMain where HinterID = " + HSourceInterID; |
| | | ds = oCN.RunProcReturn(sqls, "PM_WorkTaskBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | var lInterID = ds.Tables[0].Rows[0]["HMainSourceInterID"]; |
| | | string sql1 = "update PM_WorkTaskBillMain set HTaskStatus='已宿' where HinterID = " + HSourceInterID; |
| | | oCN.RunProc(sql1); |
| | | string sql2 = "update PM_CustomerTaskBillMain set HTaskStatus='已宿' where HinterID = " + lInterID; |
| | | oCN.RunProc(sql2); |
| | | } |
| | | } |
| | | |
| | | string sql = "insert into PM_WorkTaskReportBillSub" + |
| | | "(HInterID,HBillNo_bak,HEntryID,HRemark,HProjectID,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HFinishFlag) " + |
| | | "values(" + |