DAL/³µ¼ä¹ÜÀí/ClsSc_ProcessExchangeBill.cs
@@ -369,7 +369,7 @@ ", HRoutingBillID,HMaterModel,HWidth,HWeight,HAuxQty,HAuxUnit,HSplitNo" + ",HHeight,HInches,HAl1Long,HDensity,HTela,HUnderTela,HSizing,HSellDate" + ",HRemark2,HRemark3,HEmpID,HCusID,HColorRemark,HSplitSumQty,HSplitColorQty,HMachineLine" + ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo) " + ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HOrderLevID) " + " values('" + this.BillType + "','" + omodel.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()," + "" + (omodel.HPrevMainSourceInterID == 0 ? omodel.HInterID : omodel.HPrevMainSourceInterID) + "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HBatchNo + "'," + omodel.HMainMaterID.ToString() + "," + omodel.HKeyMaterID.ToString() + "," + omodel.HNo.ToString() + ",'" + omodel.HOrderProcNO + "'" + "," + omodel.HWWOrderInterID.ToString() + "," + omodel.HWWOrderEntryID.ToString() + ",'" + omodel.HWWOrderBillNo + "'," + omodel.HICMOInterID.ToString() + "," + omodel.HEquipMentID.ToString() + @@ -384,7 +384,7 @@ "','"+ omodel.HRoutingBillID + "','"+ omodel.HMaterModel + "',"+ omodel.HWidth + ","+ omodel.HWeight + ","+ omodel.HAuxQty + ","+ omodel.HAuxUnit +","+ omodel.HSplitNo +"" + ",'" + omodel.HHeight + "','" + omodel.HInches + "','" + omodel.HAl1Long + "','" + omodel.HDensity + "','" + omodel.HTela + "','" + omodel.HUnderTela + "','" + omodel.HSizing + "','" + omodel.HSellDate + "'" + ",'"+ omodel.HRemark2 + "','"+ omodel.HRemark3 + "',"+ omodel.HEmpID + "," + omodel.HCusID + ",'"+ omodel.HColorRemark + "',"+ omodel.HSplitSumQty + ","+ omodel.HSplitColorQty + ",'"+ omodel.HMachineLine + "'" + ","+ omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "')"); ","+ omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HOrderLevID + "')"); sErr = sErr + "1;"; //æå ¥å表 foreach (Model.ClsSc_ProcessExchangeBillSub oSub in DetailColl) DAL/ÏúÊÛ¹ÜÀí/ClsXs_SeOrderBill.cs
@@ -141,7 +141,7 @@ "'," + oSub.HOutStockQty + "," + oSub.HInvoiceQty + ",'" + oSub.HRemark + ",'" + oSub.HOrderLevID + "','" + oSub.HOrderLevID + "')"; oCn.RunProc(subSql); } Model/Model.csproj
@@ -331,6 +331,7 @@ <SubType>Code</SubType> </Compile> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_BadResult_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_StockCheckItem_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_InspectInstruMent_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_InspectBasis_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_PostSkill_Model.cs" /> Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_AreaSet_Model.cs
@@ -6,7 +6,10 @@ { public class ClsGy_AreaSet_Model : DBUtility.ClsGy_Base_Model { // public DateTime HMakeTime; public int HUSEORGID; public string HMakeEmp; public DateTime HModifyTime; public string HEnglishName;// varchar(50) è±æåç§° } } Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_CusType_Model.cs
@@ -6,6 +6,11 @@ { public class ClsGy_CusType_Model : DBUtility.ClsGy_Base_Model { // public DateTime HMakeTime; public int HUSEORGID; public string HMakeEmp; public DateTime HModifyTime; public int HERPItemID; } } Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_PoStockStyle_Model.cs
@@ -6,7 +6,11 @@ { public class ClsGy_PoStockStyle_Model : DBUtility.ClsGy_Base_Model { // public DateTime HMakeTime; public int HUSEORGID; public string HMakeEmp; public DateTime HModifyTime; public int HERPItemID; public string HBarCode; } } Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_SellStyle_Model.cs
@@ -6,7 +6,11 @@ { public class ClsGy_SellStyle_Model : DBUtility.ClsGy_Base_Model { // public DateTime HMakeTime; public int HUSEORGID; public string HMakeEmp; public DateTime HModifyTime; public int HERPItemID; public string HBarCode; } } Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_StockCheckItem_Model.cs
New file @@ -0,0 +1,17 @@ using System; using System.Collections.Generic; using System.Text; namespace Model { public class ClsGy_StockCheckItem_Model : DBUtility.ClsGy_Base_Model { public DateTime HMakeTime; public int HUSEORGID; public string HMakeEmp; public DateTime HModifyTime; public int HERPItemID; public DateTime HEndDate; } } Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_SupType_Model.cs
@@ -6,6 +6,10 @@ { public class ClsGy_SupType_Model : DBUtility.ClsGy_Base_Model { // public DateTime HMakeTime; public int HUSEORGID; public string HMakeEmp; public DateTime HModifyTime; public int HERPItemID; } } Model/Éú²ú¹ÜÀí/ClsSc_ICMOBillSub.cs
@@ -45,5 +45,7 @@ public string HCusModel; //客æ·è§æ ¼åå· public object HOrderPickRemark { get; set; } public Int64 HOrderLevID { get; set; } } } Model/³µ¼ä¹ÜÀí/ClsSc_ProcessExchangeBillMain.cs
@@ -97,5 +97,7 @@ public string HRemark2;//夿³¨2 public string HRemark3;//åºé¨å¤æ³¨ public Int64 HOrderLevID;//订åID } } WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -765,6 +765,110 @@ } #endregion #region ç¨æ·å ³èä»åºå表æ¥è¯¢ [Route("Xt_User/Gy_UserStockRelationList")] [HttpGet] public object Gy_UserStockRelationList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_UserStockRelation_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_UserStockRelation where 1 = 1"; string sql = sql1 + sWhere + " order by ç¨æ·ä»£ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_UserStockRelation"); //æ·»å åå 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; } } #endregion #region ç¨æ·å ³èä»åºå表 å é¤ /// <summary> ///åæ°ï¼string HInterIDã ///è¿åå¼ï¼objectã /// </summary> [Route("Xt_User/Gy_UserStockRelationDrop")] [HttpGet] public object Gy_UserStockRelationDrop(string HItemID, string user) { try { //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_UserStockRelation_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } if (HItemID == null || HItemID.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HItemIDä¸è½ä¸ºç©ºï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); string sql = "delete from Gy_UserStockRelation where HItemID = " + HItemID; oCN.RunProc(sql); oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å 餿åï¼"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region ç¨æ·å ³èä»åºä¿å [Route("Xt_User/SaveUserStock")] [HttpPost] @@ -1565,6 +1669,109 @@ objJsonResult.data = ds.Tables[0]; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion #region ç¨æ·å ³èç©æå表æ¥è¯¢ [Route("Xt_User/Gy_UserMaterList")] [HttpGet] public object Gy_UserMaterList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_UserMaterList_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_UserMater where 1 = 1"; string sql = sql1 + sWhere + " order by ç¨æ·ä»£ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_UserMater"); //æ·»å åå 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; } } #endregion #region ç¨æ·å ³èç©æå表 å é¤ /// <summary> ///åæ°ï¼string HInterIDã ///è¿åå¼ï¼objectã /// </summary> [Route("Xt_User/Gy_UserMaterRelationDrop")] [HttpGet] public object Gy_UserMaterRelationDrop(string HItemID, string user) { try { //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_UserMaterList_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } if (HItemID == null || HItemID.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HItemIDä¸è½ä¸ºç©ºï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); string sql = "delete from Gy_UserMaterRelation where HItemID = " + HItemID; oCN.RunProc(sql); oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å 餿åï¼"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { @@ -2874,7 +3081,16 @@ try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_UserProcessList_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_UserProcess where 1 = 1"; string sql = sql1 + sWhere + " order by ç¨æ·ä»£ç "; @@ -2905,5 +3121,60 @@ } } #endregion #region ç¨æ·å ³èå·¥åºå表 å é¤ /// <summary> ///åæ°ï¼string HInterIDã ///è¿åå¼ï¼objectã /// </summary> [Route("Xt_User/Gy_UserProcessDrop")] [HttpGet] public object Gy_UserProcessDrop(string HItemID, string user) { try { //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_UserProcessList_Drop", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿éï¼"; objJsonResult.data = null; return objJsonResult; } if (HItemID == null || HItemID.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HInterIDä¸è½ä¸ºç©ºï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran(); string sql = "delete from Gy_UserByProcess where HItemID = " + HItemID; oCN.RunProc(sql); oCN.Commit(); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å 餿åï¼"; objJsonResult.data = null; return objJsonResult; } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "Exceptionï¼" + e.ToString(); objJsonResult.data = null; return objJsonResult; } } #endregion } } WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
@@ -3182,6 +3182,1460 @@ } #endregion #region å°åº æ¥è¯¢,å®¡æ ¸ï¼åå®¡æ ¸ï¼ç¦ç¨ï¼åç¦ç¨ /// <summary> /// å°åº æ¥è¯¢ /// </summary> /// <param name="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_AreaSetList")] [HttpGet] public object Gy_AreaSetList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_AreaSet_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_AreaSet where 1 = 1"; string sql = sql1 + sWhere + " order by å°åºä»£ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_AreaSet"); //æ·»å åå 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_AreaSet")] [HttpGet] public object AuditGy_AreaSet(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_AreaSet_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_AreaSet where HItemID=" + HInterID, "Gy_AreaSet"); 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) //å®¡æ ¸å¤æ { oCN.RunProc("update Gy_AreaSet set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_AreaSet set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); 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_AreaSet")] [HttpGet] public object StopGy_AreaSet(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_AreaSet_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_AreaSet where HItemID=" + HInterID, "Gy_AreaSet"); 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) //ç¦ç¨å¤æ { oCN.RunProc("update Gy_AreaSet set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { oCN.RunProc("update Gy_AreaSet set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); 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="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_SellStyleList")] [HttpGet] public object Gy_SellStyleList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_SellStyle_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_SellStyle where 1 = 1"; string sql = sql1 + sWhere + " order by é宿¹å¼ä»£ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_SellStyle"); //æ·»å åå 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_SellStyle")] [HttpGet] public object AuditGy_SellStyle(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_SellStyle_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_SellStyle where HItemID=" + HInterID, "Gy_SellStyle"); 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) //å®¡æ ¸å¤æ { oCN.RunProc("update Gy_SellStyle set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_SellStyle set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); 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_SellStyle")] [HttpGet] public object StopGy_SellStyle(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_SellStyle_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_SellStyle where HItemID=" + HInterID, "Gy_SellStyle"); 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) //ç¦ç¨å¤æ { oCN.RunProc("update Gy_SellStyle set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { oCN.RunProc("update Gy_SellStyle set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); 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="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_PoStockStyleList")] [HttpGet] public object Gy_PoStockStyleList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_PoStockStyle_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_PoStockStyle where 1 = 1"; string sql = sql1 + sWhere + " order by éè´æ¹å¼ä»£ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_PoStockStyle"); //æ·»å åå 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_PoStockStyle")] [HttpGet] public object AuditGy_PoStockStyle(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_PoStockStyle_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_PoStockStyle where HItemID=" + HInterID, "Gy_PoStockStyle"); 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) //å®¡æ ¸å¤æ { oCN.RunProc("update Gy_PoStockStyle set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_PoStockStyle set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); 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_PoStockStyle")] [HttpGet] public object StopGy_PoStockStyle(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_PoStockStyle_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_PoStockStyle where HItemID=" + HInterID, "Gy_PoStockStyle"); 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) //ç¦ç¨å¤æ { oCN.RunProc("update Gy_PoStockStyle set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { oCN.RunProc("update Gy_PoStockStyle set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); 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="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_SupTypeList")] [HttpGet] public object Gy_SupTypeList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_SupType_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_SupType where 1 = 1"; string sql = sql1 + sWhere + " order by ä¾åºåå类代ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_SupType"); //æ·»å åå 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_SupType")] [HttpGet] public object AuditGy_SupType(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_SupType_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_SupType where HItemID=" + HInterID, "Gy_SupType"); 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) //å®¡æ ¸å¤æ { oCN.RunProc("update Gy_SupType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_SupType set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); 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_SupType")] [HttpGet] public object StopGy_SupType(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_SupType_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_SupType 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) //ç¦ç¨å¤æ { oCN.RunProc("update Gy_SupType set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { oCN.RunProc("update Gy_SupType set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); 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="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_CusTypeList")] [HttpGet] public object Gy_CusTypeList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_CusType_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_CusType where 1 = 1"; string sql = sql1 + sWhere + " order by 客æ·å类代ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_CusType"); //æ·»å åå 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_CusType")] [HttpGet] public object AuditGy_CusType(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_CusType_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_CusType where HItemID=" + HInterID, "Gy_CusType"); 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) //å®¡æ ¸å¤æ { oCN.RunProc("update Gy_CusType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_CusType set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); 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_CusType")] [HttpGet] public object StopGy_CusType(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_CusType_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_CusType where HItemID=" + HInterID, "Gy_CusType"); 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) //ç¦ç¨å¤æ { oCN.RunProc("update Gy_CusType set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { oCN.RunProc("update Gy_CusType set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); 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="sWhere"></param> /// <param name="user"></param> /// <returns></returns> [Route("Gy_BadReason/Gy_StockCheckItemList")] [HttpGet] public object Gy_StockCheckItemList(string sWhere, string user) { try { List<object> columnNameList = new List<object>(); //æ¥çæé if (!DBUtility.ClsPub.Security_Log("Gy_StockCheckItem_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = "select * from h_v_Gy_StockCheckItem where 1 = 1"; string sql = sql1 + sWhere + " order by çç¹æ¹æ¡ä»£ç "; ds = oCN.RunProcReturn(sql, "h_v_Gy_StockCheckItem"); //æ·»å åå 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_StockCheckItem")] [HttpGet] public object AuditGy_StockCheckItem(int HInterID, int IsAudit, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_StockCheckItem_Check", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "å®¡æ ¸å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_StockCheckItem where HItemID=" + HInterID, "Gy_StockCheckItem"); 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) //å®¡æ ¸å¤æ { oCN.RunProc("update Gy_StockCheckItem set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "å®¡æ ¸æå"; objJsonResult.data = null; } if (IsAudit == 1) //åå®¡æ ¸å¤æ { oCN.RunProc("update Gy_StockCheckItem set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID); 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_StockCheckItem")] [HttpGet] public object StopGy_StockCheckItem(int HInterID, int IsStop, string CurUserName) { try { //å®¡æ ¸æé if (!DBUtility.ClsPub.Security_Log_second("Gy_StockCheckItem_Close", 1, false, CurUserName)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; objJsonResult.data = null; return objJsonResult; } var ds = oCN.RunProcReturn("select * from Gy_StockCheckItem where HItemID=" + HInterID, "Gy_StockCheckItem"); 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) //ç¦ç¨å¤æ { oCN.RunProc("update Gy_StockCheckItem set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID); objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ç¦ç¨æå"; objJsonResult.data = null; } if (IsStop == 1) //åç¦ç¨å¤æ { oCN.RunProc("update Gy_StockCheckItem set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID); 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 å¼å¸¸ç±»å æ¥è¯¢ [Route("Gy_BadReason/Gy_ErrTypeList")] [HttpGet] WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
@@ -129,6 +129,8 @@ } #endregion #region 设å¤ç»´ä¿®å·¥åå表sqlè¯å¥ public static DataSet Sb_EquipRepairWorkBill_s(string sWhere) { WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -520,6 +520,58 @@ } } #region å¨å ·æ éè®°å½ç»è®¡åæ /// <summary> /// å¨å ·ç»´ä¿®è®°å½ç»è®¡åæ å表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Sb_MouldRepairWorkBill/Sc_MouldConkBookBillMain")] [HttpGet] public object Sc_MouldConkBookBillMain(string DateYear, string HType, string user) { try { List<object> columnNameList = new List<object>(); if (DateYear == null || DateYear.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è¯·éæ©ææå¹´ä»½"; return objJsonResult; } else { ds = oCN.RunProcReturn("exec h_p_Sc_MouldConkBookBillMain'" + DateYear + "','" + HType + "'", "h_p_Sc_MouldConkBookBillMain"); } //æ·»å åå 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; } } #endregion #region sqlè¯å¥ @@ -2895,6 +2947,58 @@ } #endregion #region å¨å ·ç»´ä¿®è®°å½ç»è®¡åæ /// <summary> /// å¨å ·ç»´ä¿®è®°å½ç»è®¡åæ å表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Sb_MouldRepairWorkBill/Sb_MouldRepairWorkBill")] [HttpGet] public object Sb_MouldRepairWorkBill(string DateYear, string HType, string user) { try { List<object> columnNameList = new List<object>(); if (DateYear == null || DateYear.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è¯·éæ©ææå¹´ä»½"; return objJsonResult; } else { ds = oCN.RunProcReturn("exec h_p_Sb_MouldRepairWorkBill'" + DateYear + "','" + HType + "'", "h_p_Sb_MouldRepairWorkBill"); } //æ·»å åå 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; } } #endregion #region æ¨¡å ·ç»´ä¿®éªæ¶åä¿å/ç¼è¾ @@ -3783,6 +3887,57 @@ } #endregion #region å¨å ·ä¿å »è®°å½ç»è®¡åæ /// <summary> /// å¨å ·ç»´ä¿®è®°å½ç»è®¡åæ å表 ///åæ°ï¼string sqlã ///è¿åå¼ï¼objectã /// </summary> [Route("Sb_MouldRepairWorkBill/Sc_MouldMaintainBillMain")] [HttpGet] public object Sc_MouldMaintainBillMain(string DateYear, string HType, string user) { try { List<object> columnNameList = new List<object>(); if (DateYear == null || DateYear.Equals("")) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "è¯·éæ©ææå¹´ä»½"; return objJsonResult; } else { ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainBillMain'" + DateYear + "','" + HType + "'", "h_p_Sc_MouldMaintainBillMain"); } //æ·»å åå 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; } } #endregion #endregion #region æ¨¡å ·ä¿å »è®°å½è¡¨ WebAPI/Controllers/WebAPIController.cs
@@ -6179,6 +6179,1687 @@ } #endregion #region å°åº 设置å表/ä¿å/ç¼è¾/å 餿¹æ³ /// <summary> /// å°åº ä¿å /// </summary> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_AreaSetList")] [HttpPost] public object SaveGy_AreaSetList([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_AreaSet_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_AreaSet ", "Gy_AreaSet"); 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_AreaSet_Ctl oBill = new WebAPI.DLL.ClsGy_AreaSet_Ctl(); List<Model.ClsGy_AreaSet_Model> lsmain = new List<Model.ClsGy_AreaSet_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_AreaSet(msg1); foreach (Model.ClsGy_AreaSet_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_AreaSet where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_AreaSet"); 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.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } 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; } } /// <summary> /// å°åºè·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_AreaSetDetail")] [HttpGet] public ApiResult<DataSet> GetGy_AreaSetDetail(string HID) { var model = LuBaoSevice.GetGy_AreaSetDetail(HID); return model; } /// <summary> /// å°åºå é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_AreaSet")] [HttpGet] public object DeltetGy_AreaSet(string HItemID, string user) { DataSet ds; //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_AreaSet_Drop", 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_AreaSet where HItemID=" + HItemID, "Gy_AreaSet"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } oCN.RunProc("delete Gy_AreaSet where HItemID=" + 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> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_SellStyleList")] [HttpPost] public object SaveGy_SellStyleList([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_SellStyle_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_SellStyle ", "Gy_SellStyle"); 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_SellStyle_Ctl oBill = new WebAPI.DLL.ClsGy_SellStyle_Ctl(); List<Model.ClsGy_SellStyle_Model> lsmain = new List<Model.ClsGy_SellStyle_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_SellStyle(msg1); foreach (Model.ClsGy_SellStyle_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_SellStyle where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_SellStyle"); 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.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } 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; } } /// <summary> /// é宿¹å¼è·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_SellStyleDetail")] [HttpGet] public ApiResult<DataSet> GetGy_SellStyleDetail(string HID) { var model = LuBaoSevice.GetGy_SellStyleDetail(HID); return model; } /// <summary> /// é宿¹å¼å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_SellStyle")] [HttpGet] public object DeltetGy_SellStyle(string HItemID, string user) { DataSet ds; //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_SellStyle_Drop", 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_SellStyle where HItemID=" + HItemID, "Gy_SellStyle"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } oCN.RunProc("delete Gy_SellStyle where HItemID=" + 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> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_PoStockStyleList")] [HttpPost] public object SaveGy_PoStockStyleList([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_PoStockStyle_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_PoStockStyle ", "Gy_PoStockStyle"); 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_PoStockStyle_Ctl oBill = new WebAPI.DLL.ClsGy_PoStockStyle_Ctl(); List<Model.ClsGy_PoStockStyle_Model> lsmain = new List<Model.ClsGy_PoStockStyle_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_PoStockStyle(msg1); foreach (Model.ClsGy_PoStockStyle_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_PoStockStyle where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PoStockStyle"); 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.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } 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; } } /// <summary> /// éè´æ¹å¼è·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_PoStockStyleDetail")] [HttpGet] public ApiResult<DataSet> GetGy_PoStockStyleDetail(string HID) { var model = LuBaoSevice.GetGy_PoStockStyleDetail(HID); return model; } /// <summary> /// éè´æ¹å¼å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_PoStockStyle")] [HttpGet] public object DeltetGy_PoStockStyle(string HItemID, string user) { DataSet ds; //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_PoStockStyle_Drop", 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_PoStockStyle where HItemID=" + HItemID, "Gy_PoStockStyle"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } oCN.RunProc("delete Gy_PoStockStyle where HItemID=" + 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> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_SupTypeList")] [HttpPost] public object SaveGy_SupTypeList([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_SupType_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_SupType ", "Gy_SupType"); 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_SupType_Ctl oBill = new WebAPI.DLL.ClsGy_SupType_Ctl(); List<Model.ClsGy_SupType_Model> lsmain = new List<Model.ClsGy_SupType_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_SupType(msg1); foreach (Model.ClsGy_SupType_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_SupType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_SupType"); 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.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } 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; } } /// <summary> /// ä¾åºååç±»è·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_SupTypeDetail")] [HttpGet] public ApiResult<DataSet> GetGy_SupTypeDetail(string HID) { var model = LuBaoSevice.GetGy_SupTypeDetail(HID); return model; } /// <summary> /// ä¾åºååç±»å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_SupType")] [HttpGet] public object DeltetGy_SupType(string HItemID, string user) { DataSet ds; //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_SupType_Drop", 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_SupType where HItemID=" + HItemID, "Gy_SupType"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } oCN.RunProc("delete Gy_SupType where HItemID=" + 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> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_CusTypeList")] [HttpPost] public object SaveGy_CusTypeList([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_CusType_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_CusType ", "Gy_CusType"); 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_CusType_Ctl oBill = new WebAPI.DLL.ClsGy_CusType_Ctl(); List<Model.ClsGy_CusType_Model> lsmain = new List<Model.ClsGy_CusType_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_CusType(msg1); foreach (Model.ClsGy_CusType_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_CusType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CusType"); 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.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } 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; } } /// <summary> /// 客æ·åç±»è·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_CusTypeDetail")] [HttpGet] public ApiResult<DataSet> GetGy_CusTypeDetail(string HID) { var model = LuBaoSevice.GetGy_CusTypeDetail(HID); return model; } /// <summary> /// 客æ·åç±»å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_CusType")] [HttpGet] public object DeltetGy_CusType(string HItemID, string user) { DataSet ds; //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_CusType_Drop", 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_CusType where HItemID=" + HItemID, "Gy_CusType"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } oCN.RunProc("delete Gy_CusType where HItemID=" + 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> /// <param name="msg"></param> /// <returns></returns> [Route("SaveGy_StockCheckItemList")] [HttpPost] public object SaveGy_StockCheckItemList([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_StockCheckItem_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_StockCheckItem ", "Gy_StockCheckItem"); 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_StockCheckItem_Ctl oBill = new WebAPI.DLL.ClsGy_StockCheckItem_Ctl(); List<Model.ClsGy_StockCheckItem_Model> lsmain = new List<Model.ClsGy_StockCheckItem_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); lsmain = oListModels.getObjectByJson_Gy_StockCheckItems(msg1); foreach (Model.ClsGy_StockCheckItem_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_StockCheckItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_StockCheckItem"); 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.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } 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; } } /// <summary> /// çç¹æ¹æ¡è·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_StockCheckItemDetail")] [HttpGet] public ApiResult<DataSet> GetGy_StockCheckItemDetail(string HID) { var model = LuBaoSevice.GetGy_StockCheckItemDetail(HID); return model; } /// <summary> /// çç¹æ¹æ¡å é¤åè½ /// </summary> /// <returns></returns> [Route("DeltetGy_StockCheckItem")] [HttpGet] public object DeltetGy_StockCheckItem(string HItemID, string user) { DataSet ds; //string ModRightNameCheck = "Sc_ProcessReport_check"; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_StockCheckItem_Drop", 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_StockCheckItem where HItemID=" + HItemID, "Gy_StockCheckItem"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } oCN.RunProc("delete Gy_StockCheckItem where HItemID=" + 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 /// <summary> /// ç¨å ³èå·¥åºè·åä¿¡æ¯ /// </summary> @@ -6191,6 +7872,32 @@ return model; } /// <summary> /// ç¨å ³èç©æè·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_UserMaterDetail")] [HttpGet] public ApiResult<DataSet> GetGy_UserMaterDetail(string HID) { var model = LuBaoSevice.GetGy_UserMaterDetail(HID); return model; } /// <summary> /// ç¨å ³èä»åºè·åä¿¡æ¯ /// </summary> /// <returns></returns> [Route("GetGy_UserStockRelationDetail")] [HttpGet] public ApiResult<DataSet> GetGy_UserStockRelationDetail(string HID) { var model = LuBaoSevice.GetGy_UserStockRelationDetail(HID); return model; } /// <summary> /// æ¥åºåå /// </summary> WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillController.cs
@@ -245,12 +245,12 @@ ,HMaterID,HUnitID,HRemark,HSourceID,HDeptID,HSTATUS ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney ,HINSTOCKTYPE,HCHECKPRODUCT,HQAIP,HISBACKFLUSH,HREQSRC,HSTOCKINQUASELAUXQTY,HSeOrderEntrySEQ,HPROJECTNO,HPRODUCTTYPE,HCOSTRATE,HBASEUNITID ,HSTOCKINORGID) ,HSTOCKINORGID,HOrderLevID ) values({HInterID},{i},{(oSub.HQty == null ? 0 : oSub.HQty)} ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}' ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}' ,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{oSub.HSourceID},{oSub.HDeptID},{oSub.HSTATUS} ,0,0,'','',0,0,{HINSTOCKTYPE},{HCHECKPRODUCT},{HQAIP},{HISBACKFLUSH},{HREQSRC},{HSTOCKINQUASELAUXQTY},{HSeOrderEntrySEQ},{HPROJECTNO},{HPRODUCTTYPE},{HCOSTRATE},{HBASEUNITID},{oSub.HSTOCKINORGID})"); ,0,0,'','',0,0,{HINSTOCKTYPE},{HCHECKPRODUCT},{HQAIP},{HISBACKFLUSH},{HREQSRC},{HSTOCKINQUASELAUXQTY},{HSeOrderEntrySEQ},{HPROJECTNO},{HPRODUCTTYPE},{HCOSTRATE},{HBASEUNITID},{oSub.HSTOCKINORGID},{oSub.HOrderLevID})"); } objJsonResult.code = "1"; WebAPI/DLL/ClsGy_AreaSet_Ctl.cs
New file @@ -0,0 +1,102 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_AreaSet_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_AreaSet_Model oModel = new Model.ClsGy_AreaSet_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,HEnglishName) " + " 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+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "','" + oModel.HEnglishName+ "')", 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 + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HEnglishName='" + oModel.HEnglishName+ "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",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_AreaSet_Ctl() { MvarItemKey = "Gy_AreaSet"; MvarReportTitle = "å°åºè®¾ç½®"; oModel = new Model.ClsGy_AreaSet_Model(); } } } WebAPI/DLL/ClsGy_CusType_Ctl.cs
New file @@ -0,0 +1,101 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_CusType_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_CusType_Model oModel = new Model.ClsGy_CusType_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) " + " 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+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", 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 + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",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_CusType_Ctl() { MvarItemKey = "Gy_CusType"; MvarReportTitle = "客æ·å类设置"; oModel = new Model.ClsGy_CusType_Model(); } } } WebAPI/DLL/ClsGy_PoStockStyle_Ctl.cs
New file @@ -0,0 +1,101 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_PoStockStyle_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_PoStockStyle_Model oModel = new Model.ClsGy_PoStockStyle_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) " + " 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+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", 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 + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",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_PoStockStyle_Ctl() { MvarItemKey = "Gy_PoStockStyle"; MvarReportTitle = "éè´æ¹å¼è®¾ç½®"; oModel = new Model.ClsGy_PoStockStyle_Model(); } } } WebAPI/DLL/ClsGy_SellStyle_Ctl.cs
New file @@ -0,0 +1,101 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_SellStyle_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_SellStyle_Model oModel = new Model.ClsGy_SellStyle_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) " + " 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+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", 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 + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",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_SellStyle_Ctl() { MvarItemKey = "Gy_SellStyle"; MvarReportTitle = "é宿¹å¼è®¾ç½®"; oModel = new Model.ClsGy_SellStyle_Model(); } } } WebAPI/DLL/ClsGy_StockCheckItem_Ctl.cs
New file @@ -0,0 +1,102 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_StockCheckItem_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_StockCheckItem_Model oModel = new Model.ClsGy_StockCheckItem_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,HEndDate) " + " 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+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "','" + oModel.HEndDate + "')", 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 + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",HEndDate ='" + oModel.HEndDate + "'" + ",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_StockCheckItem_Ctl() { MvarItemKey = "Gy_StockCheckItem"; MvarReportTitle = "çç¹æ¹æ¡è®¾ç½®"; oModel = new Model.ClsGy_StockCheckItem_Model(); } } } WebAPI/DLL/ClsGy_SupType_Ctl.cs
New file @@ -0,0 +1,101 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace WebAPI.DLL { public class ClsGy_SupType_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_SupType_Model oModel = new Model.ClsGy_SupType_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) " + " 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+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", 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 + "'" + ",HModifyTime='" + DateTime.Now + "'" + ",HUSEORGID='" + oModel.HUSEORGID + "'" + ",HModifyEmp ='" + oModel.HMakeEmp + "'" + ",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_SupType_Ctl() { MvarItemKey = "Gy_SupType"; MvarReportTitle = "ä¾åºåå类设置"; oModel = new Model.ClsGy_SupType_Model(); } } } WebAPI/ListModels.cs
@@ -862,6 +862,78 @@ return list; } /// <summary> /// å¤çæ°å¢å°åºè¡¨çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_AreaSet_Model> getObjectByJson_Gy_AreaSet(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_AreaSet_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_AreaSet_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢é宿¹å¼è¡¨çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_SellStyle_Model> getObjectByJson_Gy_SellStyle(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_SellStyle_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_SellStyle_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢éè´æ¹å¼è¡¨çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_PoStockStyle_Model> getObjectByJson_Gy_PoStockStyle(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_PoStockStyle_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_PoStockStyle_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢çç¹æ¹æ¡è¡¨çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns>s public List<Model.ClsGy_StockCheckItem_Model> getObjectByJson_Gy_StockCheckItems(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_StockCheckItem_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_StockCheckItem_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å®¢æ·å类表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_CusType_Model> getObjectByJson_Gy_CusType(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_CusType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_CusType_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢ä¾åºåå类表çjson /// </summary> /// <param name="jsonString"></param> /// <returns></returns> public List<Model.ClsGy_SupType_Model> getObjectByJson_Gy_SupType(string jsonString) { jsonString = "[" + jsonString.ToString() + "]"; List<Model.ClsGy_SupType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_SupType_Model>>(jsonString); return list; } /// <summary> /// å¤çæ°å¢å¼å¸¸ç±»å表çjson /// </summary> WebAPI/Service/LuBaoSevice.cs
@@ -331,6 +331,44 @@ } /// <summary> /// ç¨æ·å ³èä»åºæ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_UserStockRelationDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_UserStockRelationDb(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 GetGy_UserStockRelationDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select * from h_v_Gy_UserStockRelation where ç¨æ·ä»£ç = '" + HID + "' ", "h_v_Gy_UserStockRelation"); return dataSet; } /// <summary> /// ç¨æ·å ³èç©ææ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_UserMaterDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_UserMaterDb(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 GetGy_UserMaterDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select * from h_v_Gy_UserMater where ç¨æ·ä»£ç = '" + HID + "' ", "h_v_Gy_UserMater"); return dataSet; } /// <summary> /// å²ä½æè½æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_PostSkillDetail(string HID) @@ -427,6 +465,120 @@ } /// <summary> ///å°åºæ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_AreaSetDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_AreaSetDb(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 GetGy_AreaSetDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_AreaSet where HItemID= " + HID + " ", "h_v_Gy_AreaSet"); return dataSet; } /// <summary> ///é宿¹å¼æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_SellStyleDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_SellStyleDb(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 GetGy_SellStyleDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_SellStyle where HItemID= " + HID + " ", "h_v_Gy_SellStyle"); return dataSet; } /// <summary> ///éè´æ¹å¼æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_PoStockStyleDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_PoStockStyleDb(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 GetGy_PoStockStyleDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_PoStockStyle where HItemID= " + HID + " ", "h_v_Gy_PoStockStyle"); return dataSet; } /// <summary> /// ä¾åºååç±»æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_SupTypeDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_SupTypeDb(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 GetGy_SupTypeDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_SupType where HItemID= " + HID + " ", "h_v_Gy_SupType"); return dataSet; } /// <summary> ///客æ·åç±»æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_CusTypeDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_CusTypeDb(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 GetGy_CusTypeDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_CusType where HItemID= " + HID + " ", "h_v_Gy_CusType"); return dataSet; } /// <summary> ///çç¹æ¹æ¡æ ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_StockCheckItemDetail(string HID) { if (string.IsNullOrEmpty(HID)) return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; var dataSet = GetGy_StockCheckItemDb(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 GetGy_StockCheckItemDb(string HID) { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_StockCheckItem where HItemID= " + HID + " ", "h_v_Gy_StockCheckItem"); return dataSet; } /// <summary> /// 计éå使 ¹æ®idè·åä¿¡æ¯ /// </summary> public static ApiResult<DataSet> GetGy_UnitBillDetail(string HID) WebAPI/WebAPI.csproj
@@ -619,6 +619,12 @@ <Compile Include="DbUntil\DataFormatUntil.cs" /> <Compile Include="DLL\ClsGy_InspectInstruMent_Ctl.cs" /> <Compile Include="DLL\ClsGy_InspectBasis_Ctl.cs" /> <Compile Include="DLL\ClsGy_PoStockStyle_Ctl.cs" /> <Compile Include="DLL\ClsGy_AreaSet_Ctl.cs" /> <Compile Include="DLL\ClsGy_CusType_Ctl.cs" /> <Compile Include="DLL\ClsGy_StockCheckItem_Ctl.cs" /> <Compile Include="DLL\ClsGy_SupType_Ctl.cs" /> <Compile Include="DLL\ClsGy_SellStyle_Ctl.cs" /> <Compile Include="DLL\ClsGy_PostSkill_Ctl.cs" /> <Compile Include="DLL\ClsGy_StockOutStyle_Ctl.cs" /> <Compile Include="DLL\ClsGy_StockInStyle_Ctl.cs" />