DAL/DAL.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DAL/基础资料/公用基础资料/ClsGy_CardAddress_Ctl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DAL/基础资料/公用基础资料/ClsGy_CardType_Ctl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/Model.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/基础资料/基础资料/ClsGy_CardAddress_Model.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Model/基础资料/基础资料/ClsGy_CardType_Model.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/WebAPIController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/基础资料/基础资料/Gy_CardAddressController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/Controllers/基础资料/基础资料/Gy_CardTypeController.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
WebAPI/WebAPI.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DAL/DAL.csproj
@@ -97,8 +97,10 @@ <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsKF_BarCodeStatusChangeBill.cs" /> <Compile Include="åºç¡èµæ\InterFaceåºç¡èµæ\ClsIF_ORGANIZATIONS_View.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_BadType_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_CardAddress_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_CustLocation_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_EquipStatus_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_CardType_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_MouldStatus_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_Operator_Ctl.cs" /> <Compile Include="åºç¡èµæ\å ¬ç¨åºç¡èµæ\ClsGy_RateType_Ctl.cs" /> DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_CardAddress_Ctl.cs
New file @@ -0,0 +1,96 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsGy_CardAddress_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_CardAddress_Model oModel = new Model.ClsGy_CardAddress_Model(); //æ°å¢ public override bool AddNew() { try { oCn.BeginTran(); oCn.RunProc("Insert into " + MvarItemKey + " " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeEmp,HMakeTime,HUSEORGID,HCREATEORGID,HUseFlag,HAllAddress ) " + " 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 + "','"+ oModel.HMakeEmp.ToString() + "',getdate()," + oModel.HUSEORGID + "," + oModel.HCREATEORGID + ",'"+ oModel.HUseFlag + "','" + oModel.HAllAddress + "'" + ")", 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 + "'" + ",HHelpCode='" + oModel.HHelpCode + "'" + ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + ",HModifyEmp='" + oModel.HMakeEmp.ToString() + "'" + ",HModifyTime= getdate()" + ",HUSEORGID=" + oModel.HUSEORGID + ",HUseFlag='" + oModel.HUseFlag + "'" + ",HAllAddress='" + oModel.HAllAddress + "'" + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, 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_CardAddress_Ctl() { MvarItemKey = "Gy_CardAddress"; MvarReportTitle = "èµäº§ä½ç½®"; oModel = new Model.ClsGy_CardAddress_Model(); } } } DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_CardType_Ctl.cs
New file @@ -0,0 +1,96 @@ using System; using System.Collections.Generic; using System.Text; using System.Data; namespace DAL { public class ClsGy_CardType_Ctl : DBUtility.ClsGy_Base_Ctl { SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //å代ç ç¨äº æ¿æ¢åé¡¹ç® public string HOldNumber; public Model.ClsGy_CardType_Model oModel = new Model.ClsGy_CardType_Model(); //æ°å¢ public override bool AddNew() { try { oCn.BeginTran(); oCn.RunProc("Insert into " + MvarItemKey + " " + " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + ",HLevel,HEndFlag,HStopflag,HRemark,HMakeEmp,HMakeTime,HUSEORGID,HCREATEORGID,HUseFlag,HUnitID) " + " 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 + "','"+ oModel.HMakeEmp.ToString() + "',getdate()," + oModel.HUSEORGID + "," + oModel.HCREATEORGID + ",'"+ oModel.HUseFlag + "'," + oModel.HUnitID + ")", 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 + "'" + ",HHelpCode='" + oModel.HHelpCode + "'" + ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + ",HModifyEmp='" + oModel.HMakeEmp.ToString() + "'" + ",HModifyTime= getdate()" + ",HUSEORGID=" + oModel.HUSEORGID + ",HUseFlag='" + oModel.HUseFlag + "'" + ",HUnitID='" + oModel.HUnitID + "'" + ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, 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_CardType_Ctl() { MvarItemKey = "Gy_CardType"; MvarReportTitle = "èµäº§ç±»å«"; oModel = new Model.ClsGy_CardType_Model(); } } } Model/Model.csproj
@@ -340,6 +340,8 @@ <SubType>Code</SubType> </Compile> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_BadResult_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CardAddress_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CardType_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_StockCheckItem_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_InspectInstruMent_Model.cs" /> <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_InspectBasis_Model.cs" /> Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_CardAddress_Model.cs
New file @@ -0,0 +1,22 @@ using System; using System.Collections.Generic; using System.Text; //using System.Drawing; namespace Model { public class ClsGy_CardAddress_Model : DBUtility.ClsGy_Base_Model { public long HUSEORGID { get; set; } public long HCREATEORGID { get; set; } public string HMakeEmp { get; set; } public DateTime HMakeTime { get; set; } public string HCheckEmp { get; set; } public DateTime HCheckTime { get; set; } public string HModifyEmp { get; set; } public DateTime HModifyTime { get; set; } public string HStopEmp { get; set; } public DateTime HStopTime { get; set; } public string HAllAddress{ get; set; } } } Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_CardType_Model.cs
New file @@ -0,0 +1,22 @@ using System; using System.Collections.Generic; using System.Text; //using System.Drawing; namespace Model { public class ClsGy_CardType_Model : DBUtility.ClsGy_Base_Model { public long HUSEORGID { get; set; } public long HCREATEORGID { get; set; } public string HMakeEmp { get; set; } public DateTime HMakeTime { get; set; } public string HCheckEmp { get; set; } public DateTime HCheckTime { get; set; } public string HModifyEmp { get; set; } public DateTime HModifyTime { get; set; } public string HStopEmp { get; set; } public DateTime HStopTime { get; set; } public Int64 HUnitID { get; set; } } } WebAPI/Controllers/WebAPIController.cs
@@ -10135,7 +10135,7 @@ HView = "h_v_Sb_EquipMaintainBillList"; break; case "WX": HView = "h_v_Sb_EquipRepairCheckBillList"; HView = "h_v_Sb_EquipRepairWorkBillList"; break; case "GZ": HView = "h_v_Sb_EquipConkBookBillList"; WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_CardAddressController.cs
New file @@ -0,0 +1,274 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using WebAPI.Models; namespace WebAPI.Controllers { public class Gy_CardAddressController : ApiController { //è·åç³»ç»åæ° Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DBUtility.ClsPub.Enum_BillStatus BillStatus; private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; #region èµäº§ä½ç½®å表æ¥è¯¢ [Route("Gy_CardAddress/list")] [HttpGet] public object list(string sWhere, string user, string Organization) { try { List<object> columnNameList = new List<object>(); //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Gy_CardAddress_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = string.Format(@"select * from h_v_Gy_CardAddressList where 使ç¨ç»ç»='" + Organization + "'"); if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn(sql1 + sWhere + " order by hmainid desc", "h_v_Gy_CardAddressList"); } else { string sql = sql1 + sWhere + "order by hmainid desc"; ds = oCN.RunProcReturn(sql, "h_v_Gy_CardAddressList"); } //æ·»å åå 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 èµäº§ä½ç½® ä¿å/ç¼è¾ [Route("Gy_CardAddress/SaveGy_CardAddress")] [HttpPost] public object SaveGy_CardAddress([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();//ç¨æ· string msg_HUSEORGID = sArray[2].ToString();//ç»ç» SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Gy_CardAddress_Edit", 1, false, msg2)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } try { DAL.ClsGy_CardAddress_Ctl oBill = new DAL.ClsGy_CardAddress_Ctl(); List<Model.ClsGy_CardAddress_Model> lsmain = new List<Model.ClsGy_CardAddress_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); //\n msg1 = "[" + msg1 + "]"; lsmain = JsonConvert.DeserializeObject<List<Model.ClsGy_CardAddress_Model>>(msg1); foreach (Model.ClsGy_CardAddress_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_CardAddress where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CardAddress"); if (ds.Tables[0].Rows.Count > 0) { if (oItem.HItemID == 0 || (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString() && oItem.HItemID != 0)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; objJsonResult.data = 1; return objJsonResult; } } oItem.HCREATEORGID = Convert.ToInt32(msg_HUSEORGID); //ç»ç»id oItem.HMakeEmp = msg2; oItem.HEndFlag = true;//æ«çº§æ å¿ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //ç级 oBill.oModel = oItem; } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.oModel.HItemID == 0) { bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } if (bResult) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } #endregion #region èµäº§ä½ç½® å é¤ [Route("DeltetGy_CardAddress")] [HttpGet] public object DeltetGy_CardAddress(string HItemID, string user) { DataSet ds; DataSet ds1; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_CardAddress_Delete", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿é"; objJsonResult.data = null; return objJsonResult; } SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (string.IsNullOrWhiteSpace(HItemID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HItemID为空ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran();//å¼å§äºå¡ ds = oCN.RunProcReturn("select * from Gy_CardAddress where HItemID=" + HItemID, "Gy_CardAddress"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } ds1 = oCN.RunProcReturn("Select HItemID from Gy_CardAddress Where HParentID='" + HItemID + "'", "Gy_CardAddress"); if (ds1.Tables[0].Rows.Count != 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤é¡¹ç®åå¨å项ç®ï¼ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]); if (HUseFlag == "已使ç¨") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤é¡¹ç®å·²ä½¿ç¨ï¼ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.RunProc("delete from Gy_CardAddress 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 } } WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_CardTypeController.cs
New file @@ -0,0 +1,274 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using WebAPI.Models; namespace WebAPI.Controllers { public class Gy_CardTypeController : ApiController { //è·åç³»ç»åæ° Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); public DBUtility.ClsPub.Enum_BillStatus BillStatus; private json objJsonResult = new json(); SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); DataSet ds; #region èµäº§ç±»å«å表æ¥è¯¢ [Route("Gy_CardType/list")] [HttpGet] public object list(string sWhere, string user, string Organization) { try { List<object> columnNameList = new List<object>(); //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Gy_CardType_Query", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ æ¥çæéï¼"; objJsonResult.data = null; return objJsonResult; } string sql1 = string.Format(@"select * from h_v_Gy_CardTypeList where 使ç¨ç»ç»='" + Organization + "'"); if (sWhere == null || sWhere.Equals("")) { ds = oCN.RunProcReturn(sql1 + sWhere + " order by hmainid desc", "h_v_Gy_CardTypeList"); } else { string sql = sql1 + sWhere + "order by hmainid desc"; ds = oCN.RunProcReturn(sql, "h_v_Gy_CardTypeList"); } //æ·»å åå 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 èµäº§ç±»å« ä¿å/ç¼è¾ [Route("Gy_CardType/SaveGy_CardType")] [HttpPost] public object SaveGy_MaterType([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();//ç¨æ· string msg_HUSEORGID = sArray[2].ToString();//ç»ç» SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); //ç¼è¾æé if (!DBUtility.ClsPub.Security_Log_second("Gy_CardType_Edit", 1, false, msg2)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ ä¿åæéï¼"; objJsonResult.data = null; return objJsonResult; } try { DAL.ClsGy_CardType_Ctl oBill = new DAL.ClsGy_CardType_Ctl(); List<Model.ClsGy_CardType_Model> lsmain = new List<Model.ClsGy_CardType_Model>(); msg1 = msg1.Replace("\\", ""); msg1 = msg1.Replace("\n", ""); //\n msg1 = "[" + msg1 + "]"; lsmain = JsonConvert.DeserializeObject<List<Model.ClsGy_CardType_Model>>(msg1); foreach (Model.ClsGy_CardType_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_CardType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CardType"); if (ds.Tables[0].Rows.Count > 0) { if (oItem.HItemID == 0 || (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString() && oItem.HItemID != 0)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; objJsonResult.data = 1; return objJsonResult; } } oItem.HCREATEORGID = Convert.ToInt32(msg_HUSEORGID); //ç»ç»id oItem.HMakeEmp = msg2; oItem.HEndFlag = true;//æ«çº§æ å¿ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //ç级 oBill.oModel = oItem; } //ä¿å //ä¿å宿¯åå¤ç bool bResult; if (oBill.oModel.HItemID == 0) { bResult = oBill.AddNew(); } else { bResult = oBill.ModifyByID(oBill.oModel.HItemID); } if (bResult) { objJsonResult.code = "1"; objJsonResult.count = 1; objJsonResult.Message = "ä¿åæåï¼"; objJsonResult.data = 1; return objJsonResult; } else { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; objJsonResult.data = 1; return objJsonResult; } } catch (Exception e) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); objJsonResult.data = 1; return objJsonResult; } } #endregion #region èµäº§ç±»å« å é¤ [Route("DeltetGy_CardType")] [HttpGet] public object DeltetGy_CardType(string HItemID, string user) { DataSet ds; DataSet ds1; try { //å 餿é if (!DBUtility.ClsPub.Security_Log("Gy_CardType_Delete", 1, false, user)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ å 餿é"; objJsonResult.data = null; return objJsonResult; } SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (string.IsNullOrWhiteSpace(HItemID)) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "HItemID为空ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.BeginTran();//å¼å§äºå¡ ds = oCN.RunProcReturn("select * from Gy_CardType where HItemID=" + HItemID, "Gy_CardType"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; objJsonResult.data = null; return objJsonResult; ; } ds1 = oCN.RunProcReturn("Select HItemID from Gy_CardType Where HParentID='" + HItemID + "'", "Gy_CardType"); if (ds1.Tables[0].Rows.Count != 0) { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤é¡¹ç®åå¨å项ç®ï¼ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]); if (HUseFlag == "已使ç¨") { objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "æ¤é¡¹ç®å·²ä½¿ç¨ï¼ä¸è½å é¤ï¼"; objJsonResult.data = null; return objJsonResult; } oCN.RunProc("delete from Gy_CardType 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 } } WebAPI/WebAPI.csproj
@@ -508,6 +508,8 @@ <Compile Include="Controllers\å质管ç\å·¡æ£å\QC_PatrolProcCheckBillController.cs" /> <Compile Include="Controllers\å质管ç\å·¥åºæ£éªå\MES_ProcessCheckBill_PDAController.cs" /> <Compile Include="Controllers\å质管ç\è´¨éæ¥è¡¨\QC_QualityReportsController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_CardAddressController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_CardTypeController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_COMMONCONTACTBillController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_CustLocationController.cs" /> <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_DutyBillController.cs" />