| | |
| | | |
| | | #endregion |
| | | |
| | | #region å°è½¦éå®å ä¸ä¼ çå |
| | | |
| | | /// <summary> |
| | | /// å°è½¦éå®åæ°å¢ä¸ä¼ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveTrolleyPositionBill_Json2")] |
| | | [HttpPost] |
| | | public object set_SaveTrolleyPositionBill_Json([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string UserName = sArray[2].ToString(); |
| | | string OperationType = sArray[3].ToString(); |
| | | DBUtility.ClsPub.CurUserName = UserName; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | DAL.ClsKf_TrolleyPositionBill oBill = new DAL.ClsKf_TrolleyPositionBill(); |
| | | List<Model.ClsKf_TrolleyPositionBillMain> lsmain = new List<Model.ClsKf_TrolleyPositionBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Kf_TrolleyPositionBillMain(msg2); |
| | | |
| | | foreach (Model.ClsKf_TrolleyPositionBillMain oItem in lsmain) |
| | | { |
| | | DBUtility.ClsPub.CurUserName = oItem.HMaker; |
| | | oItem.HBillType = "10004"; |
| | | oItem.HBillSubType = "10004"; |
| | | oItem.HBillStatus = 1; //åæ®ç¶æï¼1æªå®¡ï¼2å®¡æ ¸éè¿ï¼3å
³éï¼4ä½åºï¼5å®¡æ ¸éå,6å®¡æ ¸ä¸,7å·²é
ï¼8å·²åå¤ï¼9ç»æ¡ï¼10éªè¯,11ä¸è¾¾ï¼12å¼å·¥,13ç³è¯·å®¡æ¹,15ç³è¯·æ£éªï¼16 å¤å®åæ ¼ï¼17å¤å®ä¸åæ ¼ï¼ |
| | | oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); |
| | | oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month); |
| | | oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); |
| | | if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿åå¤±è´¥ï¼æ²¡æåæ®æ¥æï¼æ æ³ä¿åï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | oBill.omodel = oItem; |
| | | } |
| | | |
| | | // è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg3 = msg3.Substring(1, msg3.Length - 2); |
| | | msg3 = msg3.Replace("\\", ""); |
| | | msg3 = msg3.Replace("\n", ""); //\n |
| | | List<Model.ClsKf_TrolleyPositionBillSub> ls = new List<Model.ClsKf_TrolleyPositionBillSub>(); |
| | | ls = oListModels.getObjectByJson_Kf_TrolleyPositionBillSub(msg3); |
| | | int i = 0; |
| | | foreach (Model.ClsKf_TrolleyPositionBillSub oItemSub in ls) |
| | | { |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (OperationType == "1") |
| | | { |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | objJsonResult.Verify = "N"; |
| | | } |
| | | |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å°è½¦éå®åä¸ä¼ 失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |