private AuditDuplicateRes confirmDuplicateTRN(AuditPostReq dataReq, AuditDuplicateRes res, string conStr = null) { try { AUDITPOSTTRNReq req = new AUDITPOSTTRNReq() { SQNO = dataReq.SQNO, COMPANY = dataReq.COMPANY, ASSETNO = dataReq.ASSETNO, UCODE = dataReq.UCODE, INPID = dataReq.INPID, MODE = "updateSNDST_Y_ASSETNO_INPID" }; var updateSNDST = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTTRNAdo.GetInstant().saveAUDITPOSTTRN(req, null, conStr); res._result._code = "200"; res._result._message = ""; res._result._status = "OK"; } catch (Exception ex) { res._result._code = "500 "; res._result._message = ex.Message; res._result._status = "Internal Server Error"; } return(res); }
public List <ASAUDITPOSTTRN> getAuditPostTRN(AUDITPOSTTRNReq d, SqlTransaction transac = null, string conStr = null) { DynamicParameters param = new DynamicParameters(); sql = " select * from [FT_ASAUDITPOSTTRN_COMPANY] (" + QuoteStr(d.COMPANY) + ") "; sql += " where COMPANY = '" + d.COMPANY + "'"; sql += " and sqno = '" + d.SQNO + "'"; sql += " and INPID = '" + d.UCODE + "'"; sql += " and assetno = '" + d.ASSETNO + "'"; var res = Query <ASAUDITPOSTTRN>(sql, param, conStr).ToList(); return(res); }
public int addAUDITPOSTTRN(AUDITPOSTTRNReq d, SqlTransaction transac = null, string conStr = null) { DynamicParameters param = new DynamicParameters(); sql = " EXEC [dbo].[SP_AUDITPOSTTRN] "; sql += " @SQNO = '" + d.SQNO + "'"; sql += " ,@COMPANY = '" + d.COMPANY + "'"; sql += " ,@DEPMST = '" + d.DEPMST + "'"; sql += " ,@YR= " + d.YR; sql += " ,@MN = " + d.MN; sql += " ,@YRMN = " + d.YRMN; sql += ", @FINDY = '" + d.FINDY + "'"; sql += " ,@PCODE = '" + d.PCODE + "'"; sql += " ,@PNAME = '" + d.PNAME + "'"; sql += " ,@MEMO1 = '" + d.MEMO1 + "'"; sql += " ,@CUTDT = '" + d.CUTDT + "'"; sql += " ,@ASSETNO = '" + d.ASSETNO + "'"; sql += ", @ASSETNAME = '" + d.ASSETNAME + "'"; sql += ", @OFFOLD = '" + d.OFFOLD + "'"; sql += " ,@OFFNAMOLD = '" + d.OFFNAMOLD + "'"; sql += " ,@OFFICECODE = '" + d.OFFICECODE + "'"; sql += " ,@OFNAME = '" + d.OFNAME + "'"; sql += " ,@DEPCODE = '" + d.DEPCODE + "'"; sql += " ,@DEPCODEOL = '" + d.DEPCODEOL + "'"; sql += " ,@STNAME = '" + d.STNAME + "'"; sql += " ,@LEADERCODE = '" + d.LEADERCODE + "'"; sql += " ,@LEADERNAME = '" + d.LEADERNAME + "'"; sql += " ,@AREANAME = '" + d.AREANAME + "'"; sql += " ,@AREACODE = '" + d.AREACODE + "'"; sql += " ,@USERID = '" + d.UCODE + "'"; sql += " ,@MODE = '" + d.MODE + "'"; sql += " ,@POSITNAME = '" + d.POSITNAME + "'"; sql += " ,@ASSETNONEW = '" + d.ASSETNONEW + "'"; sql += " ,@INPID = '" + d.INPID + "'"; var res = ExecuteNonQuery(sql, param, conStr); return(res); }
public int UpdateAUDITPOSTTRNIMG(AUDITPOSTTRNReq d, SqlTransaction transac = null, string conStr = null) { if (d == null && (d != null && (d.SQNO == null || d.ASSETNO == null))) { return(-1); } DynamicParameters param = new DynamicParameters(); sql = " EXEC [dbo].[SP_AUDITPOSTTRNIMG] "; sql += " @SQNO = '" + d.SQNO + "'"; sql += " ,@COMPANY = '" + d.COMPANY + "'"; sql += " ,@ASSETNO = '" + d.ASSETNO + "'"; sql += " ,@IMGPATH = '" + d.IMGPATH + "'"; sql += " ,@USERID = '" + d.UCODE + "'"; sql += " ,@ASSETNONEW = '" + d.ASSETNONEW + "'"; sql += " ,@MODE = '" + d.MODE + "'"; sql += " ,@INPID = '" + d.INPID + "'"; var res = ExecuteNonQuery(sql, param, conStr); return(res); }
private AuditDuplicateRes sendaudit2dep(AuditPostReq dataReq, AuditDuplicateRes res, string conStr = null) { try { updateCUTDT(dataReq, conStr); updatePOSTMST_SNDST_Y(dataReq, conStr); addPOSTTEMP_NotExists_PCODE_SNDST_Y(dataReq, conStr); addPOSTTEMP_NotExists_PCODE(dataReq, conStr); addPOSTTEMP_NotExists(dataReq, conStr); updatePOSTTEMP_SNDST_Y(dataReq, conStr); updatePOSTTEMP_PCODE_PostMST(dataReq, conStr); updatePOSTDEP_PCODE_PostMST(dataReq, conStr); updatePOSTTEMP_PCODE_PostMST_Dup(dataReq, conStr); updatePOSTDEP_PCODE_PostMST_Dup(dataReq, conStr); var lstPostMSTToTEMP = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTMSTTOTEMPAdo.GetInstant().getDataToSendDep(dataReq, null, null, conStr); if (lstPostMSTToTEMP == null || lstPostMSTToTEMP != null && lstPostMSTToTEMP.Count == 0) { InSdataToTEMP(dataReq, conStr); } AUDITPOSTTRNReq req = new AUDITPOSTTRNReq() { SQNO = dataReq.SQNO, COMPANY = dataReq.COMPANY, ASSETNO = dataReq.ASSETNO, UCODE = dataReq.UCODE, INPID = dataReq.INPID, MODE = "update_senddep" }; var updateSNDST = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTTRNAdo.GetInstant().saveAUDITPOSTTRN(req, null, conStr); AUDITPOSTMSTReq req1 = new AUDITPOSTMSTReq() { MODE = "insert_PostTEMP", SQNO = dataReq.SQNO, COMPANY = dataReq.COMPANY, ASSETNO = dataReq.ASSETNO, UCODE = dataReq.UCODE, FINDY = dataReq.FINDY, PCODE = dataReq.PCODE, PNAME = dataReq.PNAME, MEMO1 = dataReq.MEMO1, poth = dataReq.poth, snnstdt = dataReq.snnstdt, expstdt = dataReq.expstdt }; ASSETKKF_ADO.Mssql.Audit.AUDITPOSTMSTTODEPAdo.GetInstant().SP_AUDITPOSTMSTTODEP(req1, null, null, conStr); res._result._code = "200"; res._result._message = ""; res._result._status = "OK"; } catch (Exception ex) { res._result._code = "500 "; res._result._message = ex.Message; res._result._status = "Internal Server Error"; } finally { var lstPostMSTToTEMP = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTMSTTOTEMPAdo.GetInstant().getDataToSendDep(dataReq, null, null, conStr); res.AuditToTEMPLST = lstPostMSTToTEMP; var lstPostTRN = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTTRNAdo.GetInstant().getPOSTTRN(dataReq, null, null, conStr); res.POSTTRNDuplicateLST = lstPostTRN; var lstNoAudit = ASSETKKF_ADO.Mssql.Audit.AUDITCUTDATEAdo.GetInstant().getNoAudit(dataReq, null, null, conStr); //var lstNoAudit = lstPostMSTToTEMP.Where(p => String.IsNullOrEmpty(p.PCODE)).ToList(); res.NoAuditLST = lstNoAudit; } return(res); }
public Task <int> UpdateAuditPostTRN(AUDITPOSTTRNReq dataReq, string conStr = null) { return(Task.Run(() => ASSETKKF_ADO.Mssql.Audit.AUDITPOSTTRNAdo.GetInstant().saveAUDITPOSTTRN(dataReq, null, conStr))); }
private TrackOfflineRes auditPostTRN(TrackOfflineReq dataReq, TrackOfflineRes res, string conStr = null) { try { string msg, flag, transy; flag = "1"; transy = ""; msg = ""; ASAUDITPOSTTRN objTRN = new ASAUDITPOSTTRN(); if (String.IsNullOrEmpty(dataReq.sqno)) { msg = "เลขที่เอกสารไม่ถูกต้อง"; res._result._code = "404"; res._result._message = msg; res._result._status = "Bad Request"; } else { objTRN = GetASAUDITPOSTTRN(dataReq, conStr); if (objTRN == null) { transy = "Y"; res._result._code = "200"; res._result._message = msg; res._result._status = "OK"; } else { msg = "ไม่สามารถบันทึกผลการตรวจสอบได้ เนื่องจากรหัสทรัพย์สินนี้เคยถูกบันทึกผลแล้ว"; res._result._code = "501"; res._result._message = msg; res._result._status = "Not Implemented"; } } dataReq.flag = flag; dataReq.remark = msg; UpdateTransferTrackPostTRN(dataReq, conStr); if (!String.IsNullOrEmpty(transy)) { int yr, mn, yrmn; Int32.TryParse(dataReq.yr, out yr); Int32.TryParse(dataReq.mn, out mn); Int32.TryParse(dataReq.yrmn, out yrmn); var reqPostTrn = new AUDITPOSTTRNReq() { SQNO = dataReq.sqno, COMPANY = dataReq.company, DEPCODEOL = dataReq.depcodeol, YR = yr, MN = mn, YRMN = yrmn, MEMO1 = dataReq.memo1, ASSETNO = dataReq.assetno, ASSETNAME = dataReq.assetname, OFFICECODE = dataReq.officecode, OFNAME = dataReq.ofname, POSITNAME = dataReq.positname, MODE = "ADD", UCODE = dataReq.inpid }; if (!String.IsNullOrEmpty(dataReq.transy) && dataReq.transy.ToLower().Equals("y")) { var stSave = UpdateAuditPostTRN(reqPostTrn, conStr); if (stSave.Result != 0) { flag = "2"; msg = "บันทึกผลการตรวจสอบเรียบร้อยแล้ว"; } else { msg = "พบข้อผิดพลาดจากการบันทึกผลการตรวจสอบ"; } } else { msg = "ไม่บันทึกผลการตรวจสอบ"; } dataReq.remark = msg; dataReq.flag = flag; } dataReq.transy = !String.IsNullOrEmpty(dataReq.transy) ? dataReq.transy.ToUpper() : dataReq.transy; UpdateAuditTrackPostTRN(dataReq, conStr); } catch (Exception ex) { res._result._code = "500 "; res._result._message = ex.Message; res._result._status = "Internal Server Error"; } return(res); }
private AuditCompRes depedittrn(AuditPostReq dataReq, AuditCompRes res, string conStr = null) { try { AUDITPOSTTRNReq req = new AUDITPOSTTRNReq() { SQNO = dataReq.SQNO, COMPANY = dataReq.COMPANY, ASSETNO = dataReq.ASSETNO, INPID = dataReq.INPID, UCODE = dataReq.UCODE, FLAG = "", MEMO1 = dataReq.MEMO1, ASSETNAME = dataReq.ASSETNAME, OFFICECODE = dataReq.OFFICECODE, OFNAME = dataReq.OFNAME, ASSETNONEW = dataReq.ASSETNONEW, MODE = "EDITNEW" }; var updateAuditPost = ASSETKKF_ADO.Mssql.Asset.AUDITPOSTTRNADO.GetInstant().addAUDITPOSTTRN(req, null, conStr); Thread.Sleep(1000); AUDITPOSTMSTReq req1 = new AUDITPOSTMSTReq() { SQNO = dataReq.SQNO, COMPANY = dataReq.COMPANY, ASSETNO = dataReq.ASSETNO, INPID = dataReq.INPID, UCODE = dataReq.UCODE, FLAG = "", MODE = "updateTRN_STY" }; var updateSNDST = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTTRNAdo.GetInstant().SP_AUDITPOSTTRNPHONE(req1, null, null, conStr); Thread.Sleep(1000); res._result._code = "200"; res._result._message = ""; res._result._status = "OK"; } catch (Exception ex) { res._result._code = "500 "; res._result._message = ex.Message; res._result._status = "Internal Server Error"; } finally { AuditPostReq req = new AuditPostReq() { SQNO = dataReq.SQNO, COMPANY = dataReq.COMPANY, filter = dataReq.filter }; var lst = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTMSTTODEPAdo.GetInstant().getDataToClear(req, null, null, conStr); res.AUDITPOSTMSTTODEPLST = lst; var lstPostTRN = ASSETKKF_ADO.Mssql.Audit.AUDITPOSTTRNAdo.GetInstant().getPOSTTRNDep(req, null, null, conStr); res.POSTTRNDuplicateLST = lstPostTRN; } return(res); }