| | |
| | | public class PM_WorkTaskReportBill_Sub |
| | | { |
| | | public int RowID; |
| | | public int HProjectID; |
| | | public string HProNumber; |
| | | public int HProjectStageID; |
| | | public string HProjectStageName; |
| | |
| | | public int HSourceEntryID; |
| | | public string HSourceBillNo; |
| | | public string HSourceBillType; |
| | | public bool HFinishFlag; |
| | | } |
| | | #endregion |
| | | #region 项ç®é¶æ®µæ¸
å æ°å¢/ç¼è¾-ä¿å |
| | | #region 任塿±æ¥ æ°å¢/ç¼è¾-ä¿å |
| | | /// <summary> |
| | | /// æ°å¢åæ®-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | #region æ·»å 项ç®é¶æ®µæ¸
å 主表 |
| | | #region æ·»å 任塿±æ¥ 主表 |
| | | public json AddBillMain_WorkTaskReportBill(string msg1) |
| | | { |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | |
| | | string HUpdater = mainList[0].HUpdater; |
| | | string HUpdaterDate = mainList[0].HUpdaterDate; |
| | | |
| | | |
| | | |
| | | if (OperationType == 2) |
| | | //ä¿ååæ§å¶ |
| | | DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_PM_WorkTaskReportBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_PM_WorkTaskReportBill_BeforeSaveCtrl"); |
| | | if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from PM_WorkTaskReportBillMain where HBillNo ='" + HBillNo + "'", "PM_WorkTaskReportBillMain"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·éå¤,è¯·éæ°è¾å
¥!"; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | | //å é¤åè¡¨æ¶ åå¡«å·¥ä½ä»»å¡åå
³èæ°éãåæ®ç¶æ |
| | | oCN.RunProc("exec h_p_PM_UpDateRelation_WorkTaskToWorkTaskReport_Delete " + HInterID.ToString()); |
| | | //å é¤å表 |
| | | oCN.RunProc("delete from PM_WorkTaskReportBillSub where HInterID='" + HInterID + "'"); |
| | | //è®°å½æ¥å¿ |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | #region æ·»å 项ç®é¶æ®µæ¸
å å表 |
| | | #region æ·»å 任塿±æ¥ å表 |
| | | public json AddBillSub_WorkTaskReportBill(string msg3, long HInterID, string HBillNo, int OperationType) |
| | | { |
| | | List<PM_WorkTaskReportBill_Sub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PM_WorkTaskReportBill_Sub>>(msg3); |
| | |
| | | i++; //åä¸ä¸ªä¸»è¡¨ä¸çå表çå
ç èªå¢ |
| | | |
| | | int HEntryID = i; |
| | | int HProjectID = oSub.HProjectID; |
| | | string HProNumber = oSub.HProNumber; |
| | | int HProjectStageID = oSub.HProjectStageID; |
| | | string HName = oSub.HName; |
| | |
| | | int HSourceEntryID = oSub.HSourceEntryID; |
| | | string HSourceBillNo = oSub.HSourceBillNo; |
| | | string HSourceBillType = oSub.HSourceBillType; |
| | | |
| | | bool HFinishFlag = oSub.HFinishFlag; |
| | | |
| | | string sql = "insert into PM_WorkTaskReportBillSub" + |
| | | "(HInterID,HBillNo_bak,HEntryID,HRemark,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo) " + |
| | | "(HInterID,HBillNo_bak,HEntryID,HRemark,HProjectID,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HFinishFlag) " + |
| | | "values(" + |
| | | "" + HInterID + |
| | | ",'" + HBillNo + |
| | | "'," + HEntryID + |
| | | ",'" + HRemark + |
| | | "','" + HProNumber + |
| | | "'," + HProjectID + |
| | | ",'" + HProNumber + |
| | | "'," + HProjectStageID + |
| | | ",'" + HName + |
| | | "','" + HTaskNote + |
| | |
| | | "," + HSourceEntryID + |
| | | ",'" + HSourceBillType + |
| | | "','" + HSourceBillNo + |
| | | "')"; |
| | | "'," + DBUtility.ClsPub.BoolToString(HFinishFlag) + |
| | | ")"; |
| | | |
| | | oCN.RunProc(sql); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | //ä¿ååæ§å¶ |
| | | DataSet AfterDs = oCN.RunProcReturn("Exec h_p_PM_WorkTaskReportBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_PM_WorkTaskReportBill_AfterSaveCtrl"); |
| | | if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿ååå¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | //åå¡«å·¥ä½ä»»å¡åå
³èæ°éãåæ®ç¶æ |
| | | oCN.RunProc("exec h_p_PM_UpDateRelation_WorkTaskToWorkTaskReport_Add " + HInterID.ToString()); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = null; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | #endregion |
| | |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | //å é¤åè¡¨æ¶ åå¡«å·¥ä½ä»»å¡åå
³èæ°éãåæ®ç¶æ |
| | | oCN.RunProc("exec h_p_PM_UpDateRelation_WorkTaskToWorkTaskReport_Delete " + HInterID.ToString()); |
| | | oCN.RunProc("delete from PM_WorkTaskReportBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("delete from PM_WorkTaskReportBillSub where HInterID='" + HInterID + "'"); |
| | | |
| | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |