| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | |
| | | #region å页å表 |
| | | #region åºè¿å å页å表 |
| | | [Route("WLYayBillController/GetListPage")] |
| | | [HttpGet] |
| | | public object GetListPage(string sWhere, string user) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region æ ¹æ®æºåä¼ ç©æå表 |
| | | #region åºè¿å æ ¹æ®æºåä¼ ç©æå表 |
| | | [Route("WLYayBillController/GetMesByOrginBill")] |
| | | [HttpGet] |
| | | public object GetMesByOrginBill(string ListMaterial) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region ä¿å/ç¼è¾ |
| | | #region åºè¿å ä¿å/ç¼è¾ |
| | | |
| | | [Route("WLYayBillController/SaveBill")] |
| | | [HttpPost] |
| | |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_QCVerificationBillMain_Edit", 1, false, msg4)) |
| | | if (!DBUtility.ClsPub.Security_Log("WLYayBill_Edit", 1, false, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[ç¼è¾æ¶è·åæ°æ®] |
| | | #region åºè¿å ç¼è¾æ¶è·åæ°æ® |
| | | [Route("WLYayBillController/WL_YayBillDetail")] |
| | | [HttpGet] |
| | | public ApiResult<DataSet> WL_YayBillDetail(string HID) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region åºè¿å å é¤ |
| | | [Route("WLYayBillController/deleteBill")] |
| | | [HttpGet] |
| | | public object deleteBill(string HItemID, string user) |
| | | { |
| | | try |
| | | { |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("WLYayBill_Delete", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #region å®¡æ ¸ãåå®¡æ ¸ |
| | | if (string.IsNullOrWhiteSpace(HItemID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ID为空ï¼è¯·å¯»æ¾ç³»ç»ç»´æ¤äººåè¿è¡å¤çï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HItemID, "WL_YayBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è·ååæ®ä¿¡æ¯å¤±è´¥ï¼åæ®ä¸åå¨ï¼å é¤å¤±è´¥ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HChecker"]) != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ãåæ®å·²å®¡æ ¸ï¼æ æ³è¿è¡å é¤ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | oCN.RunProc("delete from WL_YayBillMain where HInterID=" + HItemID); |
| | | oCN.RunProc("delete from WL_YayBillSub_Material where HInterID=" + HItemID); |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region åºè¿å å®¡æ ¸/åå®¡æ ¸ |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region åºè¿å ç»´æ¤é¶æ
ä½ç§¯ |
| | | [Route("WLYayBillController/updateBillMEs")] |
| | | [HttpGet] |
| | | public object updateBillMEs(int HInterID, int HEntryID, int ScatteredVolume, string CurUserName) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("WLYayBill_ScatteredVolume", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | #region ä¾åºå确认æ¶é´ |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" +HInterID , "WL_YayBillMain"); |
| | | if (ds != null || ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("update WL_YayBillMain set HScatteredVolume= " + ScatteredVolume + " where HInterID=" + HInterID ); |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "é¶æ
ä½ç§¯æ°æ®ç»´æ¤å¤±è´¥ã为æ¥è¯¢å°åæ®ä¿¡æ¯ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region åºè¿å ä¾åºå确认æ¶é´ |
| | | [Route("WLYayBillController/ConfrimBillNo")] |
| | | [HttpGet] |
| | | public object ConfrimBillNo(int HInterID, int IsAudit, string CurUserName) |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
å®¡æ ¸åæ®ï¼"; |
| | | objJsonResult.Message = "è·ååæ®ä¿¡æ¯å¤±è´¥ï¼åæ®ä¸åå¨ï¼æ æ³è¿è¡æ¿è¿å确认ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HChecker"]) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸ï¼æ æ³è¿è¡æ¿è¿å确认ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("update WL_YayBillMain set HDate_CarrierSure='" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "' where HInterID=" + HInterID); |
| | | |
| | | |
| | | oCN.RunProc("update WL_YayBillMain set HDate_CarrierSure='" + DateTime.Now.ToString("yyyy-MM-dd") + "' where HInterID=" + HInterID); |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | oCN.Commit(); |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å
¶ä»ç¡®è®¤ |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | [Route("WLYayBillController/ConfrimOtherBillNo")] |
| | | [HttpGet] |
| | | public object ConfrimOtherBillNo(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_Check", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | |
| | | oCN.BeginTran(); |
| | | if (IsAudit == 1) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_arriveConfirm", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å°åºç¡®è®¤å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["HDate_AllocationDriver"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
åé
叿ºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Arrive='" + CurUserName + "',HDate_Arrive=getdate() where HInterID=" + HInterID); |
| | | } |
| | | else if (IsAudit == 2) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_arriveConfirm", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å°åºç¡®è®¤å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_pickConfirm", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æè´§å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HSurer_Arrive"] == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
å°å确认ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Pick='" + CurUserName + "',HDate_Pick=getdate() where HInterID=" + HInterID); |
| | | |
| | | } |
| | | else if (IsAudit == 3) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_tranConfirm", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åºåè¿è¾å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HSurer_Pick"] == null || ds.Tables[0].Rows[0]["HSurer_Pick"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
æè´§ç¡®è®¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Trans='" + CurUserName + "',HDate_Trans=getdate() where HInterID=" + HInterID); |
| | | |
| | | } |
| | | else if (IsAudit == 4) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_receiveConfirm", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¾æ¶å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HSurer_Trans"] == null || ds.Tables[0].Rows[0]["HSurer_Trans"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
åºåè¿è¾ç¡®è®¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Receive='" + CurUserName + "',HDate_Receive=getdate() where HInterID=" + HInterID); |
| | | |
| | | } |
| | | else |
| | | { |
| | | throw new Exception(); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | oCN.Commit(); |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region éæ©è½¦è¾å叿º |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | #region åºè¿å åé
车è¾å叿º |
| | | [Route("WLYayBillController/selectDriver")] |
| | | [HttpGet] |
| | | public object selectDriver(int HInterID, int HcheckID, int IsAudit, string CurUserName) |
| | |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | DataSet ds; |
| | | var dss = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | if (dss.Tables[0].Rows[0]["HDate_CarrierSure"] == null || dss.Tables[0].Rows[0]["HDate_CarrierSure"].ToString() == "") |
| | | |
| | | DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "请å
ä¾åºå确认ï¼"; |
| | | objJsonResult.Message = "è·ååæ®ä¿¡æ¯å¤±è´¥ï¼åæ®ä¸åå¨ï¼æ æ³è¿è¡åé
车è¾ã叿ºæä½ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HChecker"]) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸ï¼æ æ³è¿è¡åé
车è¾ã叿ºæä½ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HDate_CarrierSure"] == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªè¿è¡ä¾åºå确认ã请å
è¿è¡ä¾åºå确认ï¼ç¶ååè¿è¡åé
车è¾ã叿ºæä½ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (IsAudit == 1) |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_CarList where HItemID=" + HcheckID, "h_v_Gy_CarList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | |
| | | ds = oCN.RunProcReturn("select * from gy_car where HItemID=" + HcheckID + "", "gy_car"); |
| | | var HNumber = ds.Tables[0].Rows[0]["HNumber"].ToString(); |
| | | var HName = ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("update WL_YayBillMain set HCarID='" + HcheckID + "', CarHNumber='" + HNumber + "', CarHName='" + HName + "' where HInterID=" + HInterID); |
| | | oCN.Commit(); |
| | | |
| | | oCN.RunProc("update WL_YayBillMain set HCarID='" + HcheckID + "' where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | oCN.Commit(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_driver where HItemID=" + HcheckID, "h_v_Gy_driver"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | ds = oCN.RunProcReturn("select * from Gy_Driver where HItemID=" + HcheckID + "", "Gy_Driver"); |
| | | var HName = ds.Tables[0].Rows[0]["HName"].ToString(); |
| | | var HIDCard = ds.Tables[0].Rows[0]["HIDCard"].ToString(); |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("update WL_YayBillMain set HDriverID='" + HcheckID + "', DriverHName='" + HName + "', DriverHIDCard='" + HIDCard + "' where HInterID=" + HInterID); |
| | | oCN.Commit(); |
| | | |
| | | |
| | | oCN.RunProc("update WL_YayBillMain set HDriverID='" + HcheckID + "',HDate_AllocationDriver=getdate() where HInterID=" + HInterID); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | oCN.Commit(); |
| | | return objJsonResult; |
| | | } |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "失败ï¼"; |
| | | objJsonResult.data = null; |
| | | |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | #endregion |
| | | |
| | | |
| | | [Route("WLYayBillController/deleteBill")] |
| | | #region åºè¿å ç»´æ¤å¸æº(å¹³å°) |
| | | [Route("WLYayBillController/selectDriver1")] |
| | | [HttpGet] |
| | | public object deleteBill(string HItemID, string user) |
| | | public object selectDriver1(string CarHNumber, string CarHName,string DriverHName,string DriverHIDCard, string CurUserName, int HInterID) |
| | | { |
| | | DataSet ds; |
| | | //string ModRightNameCheck = "Sc_ProcessReport_check"; |
| | | try |
| | | { |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("WLYayBill_Delete", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //if (!DBUtility.ClsPub.Security_Log("WLYayBill_SelectDriver1", 1, false, CurUserName)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ æ¥çæéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (string.IsNullOrWhiteSpace(HItemID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HItemID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HItemID, "WL_YayBillMain"); |
| | | DataSet dds = oCN.RunProcReturn("select * from WL_YayBillSub_Material where HInterID=" + HItemID, "WL_YayBillSub_Material"); |
| | | DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.Message = "è·ååæ®ä¿¡æ¯å¤±è´¥ï¼åæ®ä¸åå¨ï¼æ æ³è¿è¡åé
车è¾ã叿ºæä½ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | oCN.RunProc("delete WL_YayBillMain where HInterID=" + HItemID); |
| | | if (dds != null || dds.Tables[0].Rows.Count != 0) |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HChecker"]) == "") |
| | | { |
| | | oCN.RunProc("delete WL_YayBillSub_Material where HInterID=" + HItemID); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸ï¼æ æ³è¿è¡åé
车è¾ã叿ºæä½ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | if (ds.Tables[0].Rows[0]["HDate_CarrierSure"] == null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªè¿è¡ä¾åºå确认ã请å
è¿è¡ä¾åºå确认ï¼ç¶ååè¿è¡åé
车è¾ã叿ºæä½ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("update WL_YayBillMain set CarHNumber='" + CarHNumber + "', CarHName='" + CarHName + "', DriverHName='" + DriverHName + "', DriverHIDCard='" + DriverHIDCard + "',HDate_AllocationDriver=getdate() where HInterID=" + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | 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.Message = "失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | [Route("WLYayBillController/updateBillMEs")] |
| | | #region åºè¿å å
¶ä»ç¡®è®¤(IsAudit)ã1ï¼å°å确认ï¼2ï¼æè´§ç¡®è®¤ï¼3ï¼åºå确认ï¼4ï¼ç¾æ¶ç¡®è®¤ã |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="HInterID">忮ID</param> |
| | | /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> |
| | | /// <param name="CurUserName">å®¡æ ¸äºº</param> |
| | | /// <returns></returns> |
| | | [Route("WLYayBillController/ConfrimOtherBillNo")] |
| | | [HttpGet] |
| | | public object updateBillMEs(int HInterID,int HEntryID, int ScatteredVolume, string CurUserName) |
| | | public object ConfrimOtherBillNo(int HInterID, int IsAudit, string CurUserName) |
| | | { |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("WLYayBill_ScatteredVolume", 1, false, CurUserName)) |
| | | try |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | var ds = oCN.RunProcReturn("select * from WL_YayBillMain a inner join WL_YayBillSub_Material b on b.HInterID=a.HInterID where a.HInterID=" + HInterID, "WL_YayBillMain"); |
| | | if (ds != null || ds.Tables[0].Rows.Count <= 0) |
| | | { |
| | | DataSet ds = oCN.RunProcReturn("select * from WL_YayBillMain where HInterID=" + HInterID, "WL_YayBillMain"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è·ååæ®ä¿¡æ¯å¤±è´¥ï¼åæ®ä¸åå¨ï¼æ æ³è¿è¡å°å确认æä½ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HChecker"]) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸ï¼æ æ³è¿è¡å°å确认æä½ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("update WL_YayBillSub_Material set HScatteredVolume= " + ScatteredVolume + " where HInterID=" + HInterID+ "and HEntryID="+ HEntryID); |
| | | if (IsAudit == 1) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_arriveConfirm", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å°åç¡®è®¤å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HDate_AllocationDriver"] == null || ds.Tables[0].Rows[0]["CarHName"].ToString() == "0" || ds.Tables[0].Rows[0]["DriverHName"].ToString() == "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åºè¿åæªåé
车è¾ä¸é©¾é©¶åï¼æ æ³è¿è¡å°å确认æä½ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Arrive='" + CurUserName + "',HDate_Arrive=getdate() where HInterID=" + HInterID); |
| | | } |
| | | else if (IsAudit == 2) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_pickConfirm", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æè´§ç¡®è®¤å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSurer_Arrive"]) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åºè¿å请å
è¿è¡å°å确认ï¼ç¶ååè¿è¡æè´§ç¡®è®¤ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Pick='" + CurUserName + "',HDate_Pick=getdate() where HInterID=" + HInterID); |
| | | |
| | | } |
| | | else if (IsAudit == 3) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_tranConfirm", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åºåè¿è¾å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSurer_Pick"]) == "" ) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å½ååºè¿åæªè¿è¡æè´§ç¡®è®¤ã请å
è¿è¡æè´§ç¡®è®¤ï¼ç¶ååè¿è¡åºå确认ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Trans='" + CurUserName + "',HDate_Trans=getdate() where HInterID=" + HInterID); |
| | | } |
| | | else if (IsAudit == 4) |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log_second("WLYayBill_receiveConfirm", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¾æ¶å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HSurer_Trans"]) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å½ååºè¿åæªè¿è¡åºå确认ã请å
è¿è¡åºå确认ï¼ç¶ååè¿è¡ç¾æ¶ç¡®è®¤ï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.RunProc("update WL_YayBillMain set HSurer_Receive='" + CurUserName + "',HDate_Receive=getdate() where HInterID=" + HInterID); |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æä½å¤±è´¥ï¼å½åæä½æä»¤æ æ³è¯å«ã请è系系ç»ç»´æ¤äººåè¿è¡å¤çï¼ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æå"; |
| | | objJsonResult.data = null; |
| | | oCN.Commit(); |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ´æ°å¤±è´¥ï¼"; |
| | | objJsonResult.Message = "失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |