| Model/bin/Release/Newtonsoft.Json.dll | 补丁 | 查看 | 原始文档 | blame | 历史 | |
| SyntacticSugar/obj/SyntacticSugar.csproj.AssemblyReference.cache | 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WarM/条码打印/Gy_BarCodeBill_XiaBao.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/Controllers/WebAPIController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/DLL/ClsGy_ItemMoney_Ctl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/ListModels.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/Service/LuBaoSevice.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Model/bin/Release/Newtonsoft.Json.dllBinary files differ
SyntacticSugar/obj/SyntacticSugar.csproj.AssemblyReference.cacheBinary files differ
WarM/ÌõÂë´òÓ¡/Gy_BarCodeBill_XiaBao.cs
@@ -706,10 +706,10 @@ ////æ¡ç åç¼ = ç»ç»ä»£ç + ç©æä»£ç + å¹´ + æ + æ¥ //sTMNumber = HOrgNumber + sMaterID + sYear + sPeriod + sDay; //循ç¯å¤æè¯¥è¡å颿æè¡ä¸æ¯å¦åå¨ç¸åç©æ //循ç¯å¤æè¯¥è¡å颿æè¡ä¸æ¯å¦åå¨ç¸åæ¡ç åç¼ for (int i = 0; i < j; i++) { if(ClsPub.isLong(grdMain.Rows[j].Cells[HMaterIDCol].Value)== ClsPub.isLong(grdMain.Rows[j - i - 1].Cells[HMaterIDCol].Value)) if(sTMNumber == ClsPub.isStrNull(grdMain.Rows[j - i - 1].Cells[HTMNumberCol].Value)) { LSH = ClsPub.isLong(grdMain.Rows[j - i - 1].Cells[HLSHCol].Value); HBarcodeNo = ClsPub.isLong(grdMain.Rows[j - i - 1].Cells[HBarcodeNoCol].Value); @@ -872,11 +872,11 @@ } else { //循ç¯å¤æè¯¥è¡åé¢çææè¡æ¯å¦åå¨å该è¡ç©æç¸åçè¡ï¼å¦ä¸åå¨ ååå¡«å¯¹åºæµæ°´å·ä¿¡æ¯ï¼åå¨åä¸åå¡«æµæ°´å·ä¿¡æ¯ //循ç¯å¤æè¯¥è¡åé¢çææè¡æ¯å¦åå¨åè¯¥è¡æ¡ç åç¼ç¸åçè¡ï¼å¦ä¸åå¨ ååå¡«å¯¹åºæµæ°´å·ä¿¡æ¯ï¼åå¨åä¸åå¡«æµæ°´å·ä¿¡æ¯ bool b = false; for (int i = 0; i < j; i++) { if (ClsPub.isLong(grdMain.Rows[grdMain.Rows.Count - j - 1].Cells[HMaterIDCol].Value) == ClsPub.isLong(grdMain.Rows[grdMain.Rows.Count - i - 1].Cells[HMaterIDCol].Value)) if (ClsPub.isStrNull(grdMain.Rows[grdMain.Rows.Count - j - 1].Cells[HTMNumberCol].Value) == ClsPub.isStrNull(grdMain.Rows[grdMain.Rows.Count - i - 1].Cells[HTMNumberCol].Value)) { b = true; break; WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
@@ -14352,5 +14352,444 @@ } #endregion #region è´¹ç¨é¡¹ç® æ¥è¯¢,å®¡æ ¸ï¼åå®¡æ ¸ï¼ç¦ç¨ï¼åç¦ç¨ /// <summary> /// ä¾åºååç±» æ¥è¯¢ /// </summary> /// <param name="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_ItemMoneyList")] [HttpGet] public object Gy_ItemMoneyList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_ProjectMoney_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "SELECT * from h_v_Gy_ItemMoney_1 where 1 = 1"; string sql = sql1 + sWhere + " order by è´¹ç¨é¡¹ç®ä»£ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_ItemMoney_1"); //æ·»å åå foreach (DataColumn col in ds.Tables[0].Columns) { Type dataType = col.DataType; string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//è·åå°DataColumnå对象çåå } objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "Sucessï¼"; objJsonResult.data = ds.Tables[0]; objJsonResult.list = columnNameList; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } /// <summary> /// 项ç®è´¹ç¨ å®¡æ ¸ãåå®¡æ ¸ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsAudit">å®¡æ ¸(0),åå®¡æ ¸(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_BadReason/AuditGy_ItemMoney")] [HttpGet] public object AuditGy_ItemMoney(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_ItemMoney_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_ItemMoney_1 where HItemID=" + HInterID, "Gy_ItemMoney_1"); if (ds.Tables[0].Rows.Count > 0) { if (IsAudit == 0) //å®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsAudit == 1) //åå®¡æ ¸å¤æ { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); if (IsAudit == 0) //å®¡æ ¸å¤æ { //å®¡æ ¸åæ§å¶========================================= string sql1 = "exec h_p_Gy_ItemMoney_BeforeCheckCtrl " + HInterID + ",'" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Gy_ItemMoney_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; } //================================================================================== oCN.RunProc("update Gy_ItemMoney_1 set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); //å®¡æ ¸åæ§å¶========================================= string sql2 = "exec h_p_Gy_ItemMoney_AfterCheckCtrl " + HInterID + ",'" + CurUserName + "'"; ds = oCN.RunProcReturn(sql2, "h_p_Gy_ItemMoney_AfterCheckCtrl"); 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; } //================================================================================== objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { //åå®¡æ ¸åæ§å¶========================================= string sql1 = "exec h_p_Gy_ItemMoney_BeforeUnCheckCtrl " + HInterID + ",'" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Gy_ItemMoney_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; 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; } //================================================================================== oCN.RunProc("update Gy_ItemMoney_1 set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); //åå®¡æ ¸åæ§å¶========================================= string sql2 = "exec h_p_Gy_ItemMoney_AfterUnCheckCtrl " + HInterID + ",'" + CurUserName + "'"; ds = oCN.RunProcReturn(sql2, "h_p_Gy_ItemMoney_AfterUnCheckCtrl"); 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; } //================================================================================== 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; } } /// <summary> /// 项ç®è´¹ç¨ ç¦ç¨ãåç¦ç¨ /// </summary> /// <param name="HInterID">åæ®ID</param> /// <param name="IsStop">ç¦ç¨(0),åç¦ç¨(1)</param> /// <param name="CurUserName">å®¡æ ¸äºº</param> /// <returns></returns> [Route("Gy_BadReason/StopGy_ItemMoney")] [HttpGet] public object StopGy_ItemMoney(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_ProjectMoney_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_ItemMoney_1 where HItemID=" + HInterID, "Gy_SupType"); if (ds.Tables[0].Rows.Count > 0) { if (IsStop == 0) //ç¦ç¨å¤æ { if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; objJsonResult.data = null; return objJsonResult; } } if (IsStop == 1) //åç¦ç¨å¤æ { if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®æªç¦ç¨!ä¸éè¦åç¦ç¨!"; objJsonResult.data = null; return objJsonResult; } } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); if (IsStop == 0) //ç¦ç¨å¤æ { //ç¦ç¨åæ§å¶========================================= string sql1 = "exec h_p_Gy_ProjectMoney_BeforeStopCtrl " + HInterID + ",'" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Gy_ProjectMoney_BeforeStopCtrl"); 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; } //================================================================================== oCN.RunProc("update Gy_ItemMoney_1 set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); //ç¦ç¨åæ§å¶========================================= string sql2 = "exec h_p_Gy_ProjectMoney_AfterStopCtrl " + HInterID + ",'" + CurUserName + "'"; ds = oCN.RunProcReturn(sql2, "h_p_Gy_ProjectMoney_AfterStopCtrl"); 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; } //================================================================================== objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { //åç¦ç¨åæ§å¶========================================= string sql1 = "exec h_p_Gy_ProjectMoney_BeforeUnStopCtrl " + HInterID + ",'" + CurUserName + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Gy_ProjectMoney_BeforeUnStopCtrl"); 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; } //================================================================================== oCN.RunProc("update Gy_ItemMoney_1 set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); //åç¦ç¨åæ§å¶========================================= string sql2 = "exec h_p_Gy_ProjectMoney_AfterUnStopCtrl " + HInterID + ",'" + CurUserName + "'"; ds = oCN.RunProcReturn(sql2, "h_p_Gy_ProjectMoney_AfterUnStopCtrl"); 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; } //================================================================================== 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 } } WebAPI/Controllers/WebAPIController.cs
@@ -22660,6 +22660,353 @@ #endregion #region è´¹ç¨é¡¹ç® 设置å表/ä¿å/ç¼è¾/å 餿¹æ³ /// <summary> /// 项ç®è´¹ç¨ ä¿å /// </summary> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_ItemMoney")] [HttpPost] public object SaveGy_ItemMoney([FromBody] JObject msg) { DataSet ds; var _value = msg["msg"].ToString(); string msg3 = _value.ToString(); string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); string msg1 = sArray[0].ToString(); string msg2 = sArray[1].ToString(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_ItemMoney_Edit", 1, false, msg2)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } Int64 HItemID = 0; SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); //è·åæå¤§IDå¼èµå¼ DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_ItemMoney_1 ", "Gy_ItemMoney_1"); if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) { //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); maxid += 1; HItemID = maxid; } ListModels oListModels = new ListModels(); try { WebAPI.DLL.ClsGy_ItemMoney_Ctl oBill = new WebAPI.DLL.ClsGy_ItemMoney_Ctl(); List<Model.ClsGy_ItemMoney_Model> lsmain = new List<Model.ClsGy_ItemMoney_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_ItemMoney(msg1); foreach (Model.ClsGy_ItemMoney_Model oItem in lsmain) { if (oItem.HNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸è½ä¸ºç©ºï¼"; objJsonResult.data = 1; return objJsonResult; } if (oItem.HName.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼åç§°ä¸è½ä¸ºç©ºï¼"; objJsonResult.data = 1; return objJsonResult; } if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim())) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; objJsonResult.data = 1; return objJsonResult; } //æ¥è¯¢æ°æ®ä¸æ¯å¦åå¨éå¤ä»£ç ds = oCN.RunProcReturn("select * from Gy_ItemMoney_1 where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_ItemMoney_1"); if (oItem.HNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç 为空ï¼"; objJsonResult.data = 1; return objJsonResult; } //æ°å¢æ¶å¤æ if (oItem.HItemID == 0) { if (ds == null || ds.Tables[0].Rows.Count == 0) { } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; objJsonResult.data = 1; return objJsonResult; } //æ£æ¥ç¶çº§æ¯å¦åå¨ string sParent; sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); if (sParent.Trim() == "") { oBill.oModel.HParentID = 0; } else { if (oBill.HavParentCode(sParent.Trim(), HItemID)) { oBill.oModel.HParentID = oBill.oModel.HItemID; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; objJsonResult.data = 1; return objJsonResult; } } } else//ç¼è¾æ¶å¤æ { //æ£æ¥ç¶çº§æ¯å¦åå¨ string sParent; sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); if (sParent.Trim() == "") { oBill.oModel.HParentID = 0; } else { if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) { oBill.oModel.HParentID = oBill.oModel.HItemID; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; objJsonResult.data = 1; return objJsonResult; } } } //å¾å°ç代ç string sShortNumber; sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); if (sShortNumber.Trim() == "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; objJsonResult.data = 1; return objJsonResult; } oItem.HShortNumber = sShortNumber;//ç代ç oItem.HEndFlag = true;//æ«çº§æ å¿ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //ç级 oItem.HMakeEmp = msg2; //å建人 oBill.oModel = oItem; } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.oModel.HItemID == 0) { bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } if (bResult) { objJsonResult.code = "0"; 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) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } /// <summary> /// 项ç®è´¹ç¨ è·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("Web/GetGy_ItemMoneyDetail")] [HttpGet] public ApiResult<DataSet> GetGy_ItemMoneyDetail(string HID) { var model = LuBaoSevice.GetGy_ItemMoneyDetail(HID); return model; } /// <summary> /// 项ç®è´¹ç¨ å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_ItemMoney")] [HttpGet] public object DeltetGy_ItemMoney(string HItemID, string user) { DataSet ds; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_ItemMoney_Delete", 1, false, user)) { 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 Gy_ItemMoney_1 where HItemID=" + HItemID, "Gy_ItemMoney_1"); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½è¿è¡å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "忮已ç¦ç¨!ä¸è½è¿è¡å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "åæ®ä¸åå¨!"; objJsonResult.data = null; return objJsonResult; } //å é¤åæ§å¶========================================= string sql1 = "exec h_p_Gy_ItemMoney_BeforeDelCtrl " + HItemID + ",'" + user + "'"; ds = oCN.RunProcReturn(sql1, "h_p_Gy_ItemMoney_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; 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; } //================================================================================== oCN.RunProc("delete Gy_ItemMoney_1 where HItemID=" + HItemID); //å é¤åæ§å¶========================================= string sql2 = "exec h_p_Gy_ItemMoney_AfterDelCtrl " + HItemID + ",'" + user + "'"; ds = oCN.RunProcReturn(sql2, "h_p_Gy_ItemMoney_AfterDelCtrl"); 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; } //================================================================================== 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 } } WebAPI/DLL/ClsGy_ItemMoney_Ctl.cs
New file @@ -0,0 +1,112 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_ItemMoney_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_ItemMoney_Model oModel = new Model.ClsGy_ItemMoney_Model(); //æ°å¢ public override bool AddNew() { try { oCn.BeginTran(); oCn.RunProc("Insert into " + MvarItemKey + " " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID,HRate" + ",HPrice) " + " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now.ToString()+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HCREATEORGID + "'" + ",'"+ oModel.HRate + "','" + oModel.HPrice + "')", ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); oCn.Commit(); return true; } catch (Exception e) { oCn.RollBack(); throw (e); } } //ä¿®æ¹ public override bool ModifyByID(Int64 sItemID) { try { oCn.BeginTran(); oCn.RunProc("Update " + MvarItemKey + " set " + " HNumber='" + oModel.HNumber + "'" + ",HName='" + oModel.HName + "'" + ",HShortNumber='" + oModel.HShortNumber + "'" + ",HHelpCode='" + oModel.HHelpCode + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HCREATEORGID='" + oModel.HCREATEORGID + "'" + ",HRate='" + oModel.HRate + "'" + ",HPrice='" + oModel.HPrice + "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",HModifyTime=getdate()" + ",HUseFlag='" + oModel.HUseFlag + "'" + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); //ä¿®æ¹å项ç®ä»£ç oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); //å°ä¸çº§ ä¸ºéæ«çº§ oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); // oCn.Commit(); return true; } catch (Exception e) { oCn.RollBack(); throw (e); } } //æ ¹æ®ä»£ç å¤æä¿¡æ¯ public override bool HavParentCode(string sCode, Int64 sItemID) { DataSet DS; try { DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo); if (DS.Tables[0].Rows.Count == 0) return false; else { oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); return true; } } catch (Exception e) { throw (e); } } //æé 彿° public ClsGy_ItemMoney_Ctl() { MvarItemKey = "Gy_ItemMoney_1"; MvarReportTitle = "项ç®è´¹ç¨è®¾ç½®"; oModel = new Model.ClsGy_ItemMoney_Model(); } } } WebAPI/ListModels.cs
@@ -1247,6 +1247,19 @@ } /// <summary> /// å¤çæ°å¢é¡¹ç®è´¹ç¨è¡¨çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_ItemMoney_Model> getObjectByJson_Gy_ItemMoney(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_ItemMoney_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_ItemMoney_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢é¡¹ç®è´¹ç¨å类表çjson /// </summary> /// <param name="jsonString"></param> WebAPI/Service/LuBaoSevice.cs
@@ -1079,5 +1079,25 @@ return dataSet; } /// <summary> /// 项ç®è´¹ç¨æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_ItemMoneyDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGetGy_ItemMoneyDetailDb(HID); if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) return new ApiResult<DataSet> { code = -1, msg = "ä¸åå¨é¡¹ç®è´¹ç¨æ°æ®" }; return new ApiResult<DataSet> { code = 1, msg = "æ¥è¯¢æå", data = dataSet }; } public static DataSet GetGetGy_ItemMoneyDetailDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_ItemMoney_1 where HItemID= " + HID + " ", "h_v_Gy_ItemMoney_1"); return dataSet; } } } WebAPI/WebAPI.csproj
@@ -661,6 +661,7 @@ <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_PNLInfoTypeLevelController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_ShelfLifeNearExpiryController.cs" /> <Compile Include="Controllers\项ç®ç®¡ç\å·¥ç¨é¡¹ç®\PM_ProjectBill_WorkController.cs" /> <Compile Include="DLL\ClsGy_ItemMoney_Ctl.cs" /> <Compile Include="DLL\ClsSc_MESStopRestoreWorkBill.cs" /> <Compile Include="DLL\ClsSc_PackUnionBillBarCode_temp_Ctl.cs" /> <Compile Include="Models\ClsGy_Billorigin.cs" />