| | |
| | | } |
| | | #endregion |
| | | |
| | | #region ç´æ¥è°æ¨å |
| | | |
| | | #region ç´æ¥è°æ¨å ä¿å/ç¼è¾ |
| | | /// <summary> |
| | | /// ç´æ¥è°æ¨å |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | | [Route("Kf_MoveStockBill/SaveKf_MoveStockBillMain")] |
| | | [HttpPost] |
| | | public object SaveKf_MoveStockBillMain([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 refSav = sArray[2].ToString();//æä½æ¹å¼æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ |
| | | string msg4 = sArray[3].ToString();//ç¨æ·å |
| | | DBUtility.ClsPub.CurUserName = msg4; |
| | | |
| | | string UserName = ""; |
| | | string s = ""; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBill_Edit", 1, false, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DAL.ClsKf_MoveStockBill oBill = new DAL.ClsKf_MoveStockBill(); |
| | | List<Model.ClsKf_MoveStockBillMain> lsmain = new List<Model.ClsKf_MoveStockBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Kf_MoveStockBillMain(msg2); |
| | | foreach (Model.ClsKf_MoveStockBillMain oItem in lsmain) |
| | | { |
| | | if (refSav == "Add") |
| | | { |
| | | //忮巿¯å¦éå¤ |
| | | if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å
许ä¿åï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (refSav == "Update") |
| | | { |
| | | if (oBill.ShowBill(oItem.HInterID, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (oBill.omodel.HChecker != "" && oBill.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å
许修æ¹ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HBillStatus > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å
许修æ¹ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(oBill, ref s)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s + "ï¼ä¸å
许修æ¹"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | oItem.HMaker = msg4; |
| | | UserName = oItem.HMaker; //å¶å人 |
| | | oItem.HBillType = "1207"; |
| | | oItem.HBillSubType = "1207"; |
| | | |
| | | |
| | | 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 |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Model.ClsKf_MoveStockBillSub> ls = new List<Model.ClsKf_MoveStockBillSub>(); |
| | | ls = oListModels.getObjectByJson_Kf_MoveStockBillSub(msg3); |
| | | int i = 0; |
| | | oBill.DetailColl.Clear(); |
| | | foreach (Model.ClsKf_MoveStockBillSub oItemSub in ls) |
| | | { |
| | | |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | |
| | | |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | |
| | | oItemSub.HSourceInterID = 0; // æºå主å
ç |
| | | oItemSub.HSourceEntryID = 0; //æºååå
ç |
| | | |
| | | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (refSav == "Add") |
| | | { |
| | | |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else if (refSav == "Update") |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | bResult = false; |
| | | } |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | 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) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å
¶ä»å
¥åºå ç¼è¾é¡µé¢åå§å |
| | | [Route("Kf_MoveStockBill/Kf_MoveStockBillEdit")] |
| | | [HttpGet] |
| | | public object Kf_MoveStockBillEdit(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | List<DataTable> tableList = new List<DataTable>(); |
| | | |
| | | ds = oCN.RunProcReturn("exec h_p_Kf_MoveStockBill_Edit " + HInterID, "h_p_Kf_MoveStockBill_Edit"); |
| | | tableList.Add(ds.Tables[0]); |
| | | tableList.Add(ds.Tables[1]); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = tableList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å
¶å®å
¥åºåå®¡æ ¸/åå®¡æ ¸åè½ |
| | | [Route("Kf_MoveStockBill/CheckKf_MoveStockBill")] |
| | | [HttpGet] |
| | | public object CheckKf_MoveStockBill(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | DAL.ClsKf_OtherInBill oBill = new DAL.ClsKf_OtherInBill(); |
| | | |
| | | //夿æ¯å¦æå 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBill_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "Kf_ICStockBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | |
| | | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | |
| | | //夿忮æ¯å¦å·²ç»å®¡æ ¸ |
| | | DataSet ds; |
| | | |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Kf_MoveStockBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Kf_MoveStockBill_BeforeCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :å®¡æ ¸åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | //å®¡æ ¸åæ® |
| | | if (!oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_MoveStockBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åå®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已åå®¡æ ¸!ä¸éè¦ååå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | //åå®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Kf_MoveStockBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Kf_MoveStockBill_BeforeUnCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :åå®¡æ ¸åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //=========================================================== |
| | | |
| | | |
| | | //åå®¡æ ¸åæ® |
| | | if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_MoveStockBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | 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 å
¶å®å
¥åºåå
³é/åå
³éåè½ |
| | | [Route("Kf_MoveStockBill/CloseKf_MoveStockBill")] |
| | | [HttpGet] |
| | | public object CloseKf_MoveStockBill(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBill_Close", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "Kf_ICStockBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 å
³é 2 åå
³é |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»å
³é |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸éè¦åå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //å
³éåæ® |
| | | if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å
³é失败!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åå
³é |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已åå
³é!ä¸éè¦ååå
³é!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | //åå
³éåæ® |
| | | if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå
³é失败!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | 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 å
¶ä»å
¥åºå ä½åº/åä½åºåè½ |
| | | [Route("Kf_MoveStockBill/DropKf_MoveStockBill")] |
| | | [HttpGet] |
| | | public object DropKf_MoveStockBill(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æä½åºæé |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBill_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "Kf_ICStockBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 ä½åº 2 åä½åº |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»ä½åº |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | 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) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸éè¦åä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //ä½åºåæ® |
| | | if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åä½åº |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦ååä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åä½åºåæ® |
| | | if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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> |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region è°æ¨å å é¤ |
| | | [Route("Kf_MoveStockBill/DelteteGetMoveStockBill")] |
| | |
| | | { |
| | | try |
| | | { |
| | | string s = ""; |
| | | DAL.ClsKf_MoveStockBill oBill = new DAL.ClsKf_MoveStockBill(); |
| | | |
| | | //夿æ¯å¦æå 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_MoveStockBill_Drop", 1, false, user)) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Kf_MoveStockBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Kf_MoveStockBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID); |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec h_p_Kf_MoveStockBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Kf_MoveStockBill_AfterDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | s = "å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + s; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | s = ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + s; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //============================================================================================== |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | /// éå®åºåºåå表 |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å
¶ä»åºåºå |
| | | #region å
¶ä»åºåºåä¿å/ç¼è¾ |
| | | /// <summary> |
| | | /// å
¶ä»å
¥åºå |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | | [Route("Kf_OtherOutBill/SaveKf_OtherOutBillMain")] |
| | | [HttpPost] |
| | | public object SaveKf_OtherOutBillMain([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 refSav = sArray[2].ToString();//æä½æ¹å¼æ°æ®ç±»å 1æ·»å 3ä¿®æ¹ 2 å¤å¶ |
| | | string msg4 = sArray[3].ToString();//ç¨æ·å |
| | | DBUtility.ClsPub.CurUserName = msg4; |
| | | |
| | | string UserName = ""; |
| | | string s = ""; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_OtherOutBill_Edit", 1, false, msg4)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | DAL.ClsKf_OtherOutBill oBill = new DAL.ClsKf_OtherOutBill(); |
| | | List<Model.ClsKf_OtherOutBillMain> lsmain = new List<Model.ClsKf_OtherOutBillMain>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Kf_OtherOutBillMain(msg2); |
| | | foreach (Model.ClsKf_OtherOutBillMain oItem in lsmain) |
| | | { |
| | | if (refSav == "Add") |
| | | { |
| | | //忮巿¯å¦éå¤ |
| | | if (BillNew0.IsExistBillNo(ref ClsPub.sExeReturnInfo, oItem.HBillNo, BillStatus, BillOld.omodel.HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·éå¤ï¼ä¸å
许ä¿åï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (refSav == "Update") |
| | | { |
| | | if (oBill.ShowBill(oItem.HInterID, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (oBill.omodel.HChecker != "" && oBill.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å
许修æ¹ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HBillStatus > 1) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å¤äºä¸å¯ç¼è¾ç¶æï¼ä¸å
许修æ¹ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | if (!DBUtility.Xt_BaseBillFun.Fun_AllowEditBill(oBill, ref s)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s + "ï¼ä¸å
许修æ¹"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | oItem.HMaker = msg4; |
| | | UserName = oItem.HMaker; //å¶å人 |
| | | oItem.HBillType = "1206"; |
| | | oItem.HBillSubType = "1206"; |
| | | |
| | | |
| | | 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 |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Model.ClsKf_OtherOutBillSub> ls = new List<Model.ClsKf_OtherOutBillSub>(); |
| | | ls = oListModels.getObjectByJson_Kf_OtherOutBillSub(msg3); |
| | | int i = 0; |
| | | oBill.DetailColl.Clear(); |
| | | foreach (Model.ClsKf_OtherOutBillSub oItemSub in ls) |
| | | { |
| | | |
| | | i++; |
| | | oItemSub.HEntryID = i; |
| | | |
| | | |
| | | oItemSub.HCloseType = false; //å
³éç±»å |
| | | |
| | | oItemSub.HSourceInterID = 0; // æºå主å
ç |
| | | oItemSub.HSourceEntryID = 0; //æºååå
ç |
| | | |
| | | |
| | | oBill.DetailColl.Add(oItemSub); |
| | | |
| | | } |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (refSav == "Add") |
| | | { |
| | | |
| | | bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else if (refSav == "Update") |
| | | { |
| | | bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | else |
| | | { |
| | | bResult = false; |
| | | } |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | 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) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å
¶ä»åºåºå ç¼è¾é¡µé¢åå§å |
| | | [Route("Kf_OtherOutBill/Kf_OtherOutBillEdit")] |
| | | [HttpGet] |
| | | public object Kf_OtherOutBillEdit(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | List<DataTable> tableList = new List<DataTable>(); |
| | | |
| | | ds = oCN.RunProcReturn("exec h_p_Kf_OtherOutBill_Edit " + HInterID, "h_p_Kf_OtherOutBill_Edit"); |
| | | tableList.Add(ds.Tables[0]); |
| | | tableList.Add(ds.Tables[1]); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = tableList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å
¶ä»åºåºåå表 |
| | | /// <summary> |
| | | /// å
¶ä»åºåºåå表 |
| | | /// </summary> |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å
¶ä»åºåºå å é¤ |
| | | [Route("Kf_OtherOutBill/DelteteGetOtherOutBill")] |
| | |
| | | { |
| | | try |
| | | { |
| | | string s = ""; |
| | | DAL.ClsKf_OtherInBill oBill = new DAL.ClsKf_OtherInBill(); |
| | | |
| | | //夿æ¯å¦æå 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_OtherOutBill_Drop", 1, false, user)) |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (oBill.ShowBill(long.Parse(HInterID), ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®æè¯¯ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //夿æ¯å¦å¯ç¼è¾ |
| | | if (oBill.omodel.HChecker != "" && oBill.omodel.HChecker != null) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¤åæ®å·²ç»è¢«å®¡æ ¸ï¼ä¸å
许å é¤ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //å é¤åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Kf_OtherOutBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Kf_ICStockBill_BeforeDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Kf_ICStockBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Kf_ICStockBillSub where HInterID = " + HInterID); |
| | | |
| | | |
| | | //å é¤åæ§å¶================================================================================== |
| | | string sql2 = "exec h_p_Kf_OtherOutBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql2, "h_p_Kf_ICStockBill_AfterDelCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | s = "å é¤åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + s; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | s = ds.Tables[0].Rows[0]["HRemark"].ToString(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å é¤å¤±è´¥!åå :" + s; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //============================================================================================== |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | { |
| | | try |
| | | { |
| | | Int64 lngBillKey = 0; |
| | | lngBillKey = DBUtility.ClsPub.isLong(HInterID); |
| | | DAL.ClsKf_OtherOutBill oBill = new DAL.ClsKf_OtherOutBill() ; |
| | | |
| | | //夿æ¯å¦æå 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_OtherOutBill_Check", 1, false, user)) |
| | | { |
| | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //é对éè¦è¿è¡çæä½ï¼æ£éªå½ååæ®çç¶ææ¯å¦æ¯æéè¦è¿è¡çæä½ |
| | | if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) //æ ¹æ®HInterIDè·åè¯¥åæ®çæ°æ® |
| | | { |
| | | if (oBill.omodel.HCloseMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已å
³é!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (oBill.omodel.HDeleteMan.Trim() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!åå :" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //å®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Kf_OtherOutBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Kf_ICStockBill_BeforeCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :å®¡æ ¸åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | oCN.RollBack(); |
| | | return objJsonResult; |
| | | } |
| | | //================================================================================== |
| | | |
| | | |
| | | |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | if (!oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_OtherOutBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | //åå®¡æ ¸åæ§å¶========================================= |
| | | string sql1 = "exec h_p_Kf_OtherOutBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'"; |
| | | ds = oCN.RunProcReturn(sql1, "h_p_Kf_ICStockBill_BeforeUnCheckCtrl"); |
| | | if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :åå®¡æ ¸åå¤æå¤±è´¥ï¼è¯·ä¸ç½ç»ç®¡ç人åèç³»"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //=========================================================== |
| | | |
| | | //åå®¡æ ¸åæ® |
| | | if (BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_OtherOutBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å
¶å®åºåºå ä½åº/åä½åºåè½ |
| | | [Route("Kf_OtherInBill/DropKf_ICStockBill")] |
| | | [HttpGet] |
| | | public object DropKf_ICStockBill(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æä½åºæé |
| | | if (!DBUtility.ClsPub.Security_Log("Kf_OtherInBill_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | BillOld.MvarItemKey = "Kf_ICStockBillMain"; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 ä½åº 2 åä½åº |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»ä½åº |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | 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) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ä½åº!ä¸éè¦åä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //ä½åºåæ® |
| | | if (!BillOld.Cancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åä½åº |
| | | DataSet ds; |
| | | string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡ä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªä½åº!ä¸éè¦ååä½åº!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åä½åºåæ® |
| | | if (!BillOld.AbandonCancelltion(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åä½åºå¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | 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 |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_ICStockBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (!oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_ICStockBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | |
| | | |
| | | |
| | | //åå®¡æ ¸åæ® |
| | | if (BillOld.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_ICStockBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Kf_ICStockBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true) |
| | | { |
| | | //SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //DataSet DSet = oCn.RunProcReturn("exec h_p_Sc_ICMOBill_AbandonCheckCtrl " + int.Parse(HInterID), "h_p_Sc_ICMOBill_AbandonCheckCtrl"); |