Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
| | |
| | | /PayM/obj/Debug |
| | | /NETERPNoWin/obj |
| | | /WebAPI/Sc_MouldProdOutBill/Log |
| | | /PayM/bin/Debug |
New file |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using WebAPI.Service; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | | public class Gy_TechParamByProcController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | /// <summary> |
| | | /// è¿åå·¥èºåæ°å¯¹åºè¡¨å表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechParamByProc/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_TechParamByProc", 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_TechParamByProc where 1 = 1");//where ç»ç»åç§°='" + Organization + "' |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn(sql1 + sWhere + " order by HEntryID ", "h_v_Gy_TechParamByProc"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + " order by HEntryID"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_TechParamByProc"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechParamByProc/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_TechParamByProcList where hmainid=" + HInterID, "h_v_Gy_TechParamByProcList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°å¢åæ®-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechParamByProc/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | //ååºåå |
| | | msg1 = "[" + msg1.ToString() + "]"; |
| | | |
| | | DAL.ClsGy_Customer_Ctl oDept = new DAL.ClsGy_Customer_Ctl(); |
| | | DAL.ClsGy_Customer_View oDeptHlp = new DAL.ClsGy_Customer_View(); |
| | | |
| | | //ç¼è¾æé |
| | | //if (!DBUtility.ClsPub.Security_Log_second("Gy_TechnologyParameter_Add_Edit_", 1, false, msg2)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | List<TechParamByProc> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TechParamByProc>>(msg1); |
| | | |
| | | long HInterID = list[0].HInterID; |
| | | string HMaker = list[0].HMaker; |
| | | string HChecker = list[0].HChecker; |
| | | string HRemark = list[0].HRemark; |
| | | //long HStopflag = list[0].HStopflag; |
| | | long HMaterID = list[0].HMaterID; |
| | | long HProcID = list[0].HProcID; |
| | | long HTechParamID = list[0].HTechParamID; |
| | | long HTechParamUnitID = list[0].HTechParamUnitID; |
| | | string HStd = list[0].HStd; |
| | | long HDeptID = list[0].HDeptID; |
| | | DateTime HMakeDate = list[0].HMakeDate; |
| | | |
| | | //DateTime HDeleteDate = list[0].HDeleteDate; |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HStd)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //å½åæ¶é´ |
| | | var currentTime = DateTime.Now.ToString(); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_TechParamByProc " + |
| | | " (HInterID,HMaker,HChecker,HRemark,HMaterID" + |
| | | ",HProcID,HTechParamID,HTechParamUnitID,HStd,HMakeDate" + |
| | | ",HDeptID) " + |
| | | " Values('" + HInterID + "','" + HChecker + "','" + HChecker + "','" + HRemark + "','" + HMaterID + "','" + HProcID + "','" + HTechParamID + "','" + HTechParamUnitID + "','" + HStd + "','" + currentTime + "','" + HDeptID + "')"); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | //oCN.RunProc("Update Gy_TechParamByProc set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢åæ®æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | //oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechParamByProc/ModifyByID")] |
| | | [HttpPost] |
| | | public object ModifyByID([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | DAL.ClsGy_Warehouse_Ctl oDept = new DAL.ClsGy_Warehouse_Ctl(); |
| | | DAL.ClsGy_Warehouse_View oDeptHlp = new DAL.ClsGy_Warehouse_View(); |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<TechParamByProc> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TechParamByProc>>(msg2); |
| | | |
| | | long HInterID = list[0].HInterID; |
| | | string HMaker = list[0].HMaker; |
| | | string HChecker = list[0].HChecker; |
| | | string HRemark = list[0].HRemark; |
| | | //string HStopflag = list[0].HStopflag; |
| | | long HMaterID = list[0].HMaterID; |
| | | long HProcID = list[0].HProcID; |
| | | long HTechParamID = list[0].HTechParamID; |
| | | long HTechParamUnitID = list[0].HTechParamUnitID; |
| | | string HStd = list[0].HStd; |
| | | long HDeptID = list[0].HDeptID; |
| | | DateTime HMakeDate = list[0].HMakeDate; |
| | | |
| | | ////夿æé |
| | | //if (!ClsPub.Security_Log("Gy_TechnologyParameter_Add_Edit_", 1, false, msg3)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HStd)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç éå¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HInterID == 0) |
| | | { |
| | | //å½åæ¶é´ |
| | | var currentTime = DateTime.Now.ToString(); |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_TechParamByProc " + |
| | | " (HInterID,HMaker,HChecker,HRemark,HMaterID" + |
| | | ",HProcID,HTechParamID,HTechParamUnitID,HStd,HMakeDate" + |
| | | ",HDeptID) " + |
| | | " Values('" + HInterID + "','" + HChecker + "','" + HChecker + "','" + HRemark + "','" + HMaterID + "','" + HProcID + "','" + HTechParamID + "','" + HTechParamUnitID + "','" + HStd + "','" + currentTime + "','" + HDeptID + "')"); |
| | | |
| | | // Convert.ToString(HEndFlag ? 1 : 0); Convert.ToString(HStopflag ? 1 : 0);HUseFlag |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_TechnologyParameter set HEndflag=0 where HEntryID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | | { |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_TechParamByProc set " + |
| | | " HStd='" + HStd + "'" + |
| | | //",HName='" + HName + "'" + |
| | | //",HShortNumber='" + HShortNumber + "'" + |
| | | //",HHelpCode='" + HHelpCode + "'" + |
| | | //",HLevel='" + HLevel.ToString() + "'" + |
| | | //",HParentID='" + HParentID.ToString() + "'" + |
| | | //",HEndflag=" + Convert.ToString(HEndFlag ? 1 : 0) + |
| | | //",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) + |
| | | //",HUseFlag=" + Convert.ToString(HUseFlag ? 1 : 0) + |
| | | //",HMakeTime= getdate()" + |
| | | //",HMakeEmp='" + HMakeEmp + "'" + |
| | | /*",HRemark='" + HRemark + */"Where HEntryID='" + HInterID + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Warehouse,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | //oCN.RunProc("Update Gy_TechParamByProc set HEndflag=0 where HEntryID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | //oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·¥èºåæ°å¯¹åºè¡¨å表å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("DeltetGy_TechParamByProc")] |
| | | [HttpGet] |
| | | public object DeltetGy_TechParamByProc(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | try |
| | | { |
| | | //å 餿é |
| | | //if (!DBUtility.ClsPub.Security_Log("DeltetGy_TechnologyParameter", 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_TechParamByProc where HInterID=" + HItemID, "Gy_TechParamByProc"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | //if (HStopflag) |
| | | //{ |
| | | // oCN.RollBack();//åæ»äºå¡ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ°æ®å·²å 餿 æ³å次å é¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //ds1 = oCN.RunProcReturn("Select HItemID from Gy_TechParamByProc Where HParentID='" + HItemID + "'", "Gy_TechParamByProc"); |
| | | //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_TechParamByProc where HInterID=" + 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using WebAPI.Service; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | | public class Gy_TechnologyController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | /// <summary> |
| | | /// è¿åå·¥èºå表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechnologyParameter/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_TechnologyParameter", 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_TechnologyParameter where 1 =1 ");//where ç»ç»åç§°='" + Organization + "' |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn(sql1 + sWhere + " order by HItemID ", "h_v_Gy_TechnologyParameter"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + " order by HItemID"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_TechnologyParameter"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechnologyParameter/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_TechnologyParameterList where HitemID=" + HInterID, "h_v_Gy_TechnologyParameterList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·¥èºåè¡¨ä¿®æ¹æé®æ¹æ³ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechnologyParameter/xg")] |
| | | [HttpGet] |
| | | public object xg(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | string sql = string.Format(@"select HItemID,HNumber å·¥èºåæ°ä»£ç ,HName å·¥èºåæ°åç§°,HRemark 夿³¨,HUseFlag ä½¿ç¨æ è®° from Gy_TechnologyParameter" + HInterID + "'"); |
| | | ds = oCN.RunProcReturn(sql, "Gy_TechnologyParameter"); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = ""; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°å¢åæ®-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechnologyParameter/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | //ååºåå |
| | | msg1 = "[" + msg1.ToString() + "]"; |
| | | |
| | | DAL.ClsGy_Customer_Ctl oDept = new DAL.ClsGy_Customer_Ctl(); |
| | | DAL.ClsGy_Customer_View oDeptHlp = new DAL.ClsGy_Customer_View(); |
| | | |
| | | //ç¼è¾æé |
| | | //if (!DBUtility.ClsPub.Security_Log_second("Gy_TechnologyParameter_Add_Edit_", 1, false, msg2)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | List<TechnologyParameter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TechnologyParameter>>(msg1); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HShortNumber; |
| | | long HParentID = list[0].HParentID; |
| | | long HLevel = list[0].HLevel; |
| | | string HEndFlag = list[0].HEndFlag; |
| | | string HStopflag = list[0].HStopflag; |
| | | string HRemark = list[0].HRemark; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | DateTime HMakeTime = list[0].HMakeTime; |
| | | string HMakeEmp = list[0].HMakeEmp; |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å½åæ¶é´ |
| | | var currentTime = DateTime.Now.ToString(); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_TechnologyParameter " + |
| | | " (HNumber,HName,HShortNumber,HParentID,HLevel" + |
| | | ",HEndFlag,HStopflag,HRemark,HHelpCode" + |
| | | ",HUseFlag,HMakeTime,HMakeEmp) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HShortNumber + "','" + HParentID + "','" + HLevel + |
| | | "','" + HEndFlag + "','" + HStopflag + "','" + HRemark + |
| | | "','" + HHelpCode + "','" + HUseFlag + "','" + currentTime + "','" + HMakeEmp + "')"); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_TechnologyParameter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢åæ®æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechnologyParameter/ModifyByID")] |
| | | [HttpPost] |
| | | public object ModifyByID([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | DAL.ClsGy_Warehouse_Ctl oDept = new DAL.ClsGy_Warehouse_Ctl(); |
| | | DAL.ClsGy_Warehouse_View oDeptHlp = new DAL.ClsGy_Warehouse_View(); |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<TechnologyParameter> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TechnologyParameter>>(msg2); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HShortNumber; |
| | | long HParentID = list[0].HParentID; |
| | | long HLevel = list[0].HLevel; |
| | | string HEndFlag = list[0].HEndFlag; |
| | | string HStopflag = list[0].HStopflag; |
| | | string HRemark = list[0].HRemark; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | DateTime HMakeTime = list[0].HMakeTime; |
| | | string HMakeEmp = list[0].HMakeEmp; |
| | | |
| | | ////夿æé |
| | | //if (!ClsPub.Security_Log("Gy_TechnologyParameter_Add_Edit_", 1, false, msg3)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç éå¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HItemID == 0) |
| | | { |
| | | //å½åæ¶é´ |
| | | var currentTime = DateTime.Now.ToString(); |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Insert into Gy_TechnologyParameter " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID,HLevel" + |
| | | ",HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HMakeEmp) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HParentID.ToString() + |
| | | "','" + HLevel.ToString() + "','" + HEndFlag + "','" + HStopflag + "','" + HRemark + "','" + HUseFlag + "','" + currentTime + "','" + HMakeEmp + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // Convert.ToString(HEndFlag ? 1 : 0); Convert.ToString(HStopflag ? 1 : 0);HUseFlag |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_TechnologyParameter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | | { |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_TechnologyParameter set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HLevel='" + HLevel.ToString() + "'" + |
| | | ",HParentID='" + HParentID.ToString() + "'" + |
| | | ",HEndflag='" + HEndFlag + "'" + |
| | | ",HStopflag='" + HStopflag + "'" + |
| | | ",HUseFlag='" + HUseFlag + "'" + |
| | | //",HMakeTime= getdate()" + |
| | | ",HMakeEmp='" + HMakeEmp + "'" + |
| | | ",HRemark='" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Warehouse,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCN.RunProc("Update Gy_TechnologyParameter set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | //oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·¥èºåæ°å表å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("DeltetGy_TechnologyParameter")] |
| | | [HttpGet] |
| | | public object DeltetGy_TechnologyParameter(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | try |
| | | { |
| | | //å 餿é |
| | | //if (!DBUtility.ClsPub.Security_Log("DeltetGy_TechnologyParameter", 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_TechnologyParameter where HItemID=" + HItemID, "Gy_TechnologyParameter"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | //if (HStopflag) |
| | | //{ |
| | | // oCN.RollBack();//åæ»äºå¡ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ°æ®å·²å 餿 æ³å次å é¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | ds1 = oCN.RunProcReturn("Select HItemID from Gy_TechnologyParameter Where HParentID='" + HItemID + "'", "Gy_TechnologyParameter"); |
| | | 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_TechnologyParameter 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | using WebAPI.Service; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | | public class Gy_TechnologyParUnitController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | |
| | | /// <summary> |
| | | /// è¿åå·¥èºåæ°åä½å表 |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechnologyParameterUnit/list")] |
| | | [HttpGet] |
| | | public object list(string sWhere, string user, string Organization) |
| | | { |
| | | try |
| | | { |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_TechnologyParameterUnit", 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_TechnologyParameterUnit where 1 = 1");//where ç»ç»åç§°='" + Organization + "' |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn(sql1 + sWhere + " order by HItemID ", "h_v_Gy_TechnologyParameterUnit"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + " order by HItemID"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_TechnologyParameterUnit"); |
| | | } |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®åºç¡èµæID æ¥æ¾è®°å½ |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechnologyParameterUnit/cx")] |
| | | [HttpGet] |
| | | public object cx(long HInterID) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_TechnologyParameterUnitList where HitemID=" + HInterID, "h_v_Gy_TechnologyParameterUnitList"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "falseï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ°å¢åæ®-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechnologyParameterUnit/AddBill")] |
| | | [HttpPost] |
| | | public object AddBill([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | //ååºåå |
| | | msg1 = "[" + msg1.ToString() + "]"; |
| | | |
| | | DAL.ClsGy_Customer_Ctl oDept = new DAL.ClsGy_Customer_Ctl(); |
| | | DAL.ClsGy_Customer_View oDeptHlp = new DAL.ClsGy_Customer_View(); |
| | | |
| | | //ç¼è¾æé |
| | | //if (!DBUtility.ClsPub.Security_Log_second("Gy_TechnologyParameter_Add_Edit_", 1, false, msg2)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | List<TechnologyParameterUnit> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TechnologyParameterUnit>>(msg1); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HShortNumber; |
| | | long HParentID = list[0].HParentID; |
| | | long HLevel = list[0].HLevel; |
| | | string HEndFlag = list[0].HEndFlag; |
| | | string HStopflag = list[0].HStopflag; |
| | | string HRemark = list[0].HRemark; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | DateTime HMakeTime = list[0].HMakeTime; |
| | | string HMakeEmp = list[0].HMakeEmp; |
| | | |
| | | //DateTime HDeleteDate = list[0].HDeleteDate; |
| | | |
| | | |
| | | if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | //å½åæ¶é´ |
| | | var currentTime = DateTime.Now.ToString(); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Insert into Gy_TechnologyParameterUnit " + |
| | | " (HNumber,HName,HShortNumber,HParentID,HLevel" + |
| | | ",HEndFlag,HStopflag,HRemark,HHelpCode" + |
| | | ",HUseFlag,HMakeTime,HMakeEmp) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HShortNumber + "','" + HParentID + "','" + HLevel + |
| | | "','" + HEndFlag + "','" + HStopflag + "','" + HRemark + |
| | | "','" + HHelpCode + "','" + HUseFlag + "','" + currentTime + "','" + HMakeEmp + "')"); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_TechnologyParameterUnit set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ°å¢åæ®æåï¼"; |
| | | //objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Gy_TechnologyParameterUnit/ModifyByID")] |
| | | [HttpPost] |
| | | public object ModifyByID([FromBody] JObject oMain) |
| | | { |
| | | try |
| | | { |
| | | DAL.ClsGy_Warehouse_Ctl oDept = new DAL.ClsGy_Warehouse_Ctl(); |
| | | DAL.ClsGy_Warehouse_View oDeptHlp = new DAL.ClsGy_Warehouse_View(); |
| | | |
| | | var _value = oMain["oMain"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | |
| | | //ååºåå |
| | | msg2 = "[" + msg2.ToString() + "]"; |
| | | List<TechnologyParameterUnit> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TechnologyParameterUnit>>(msg2); |
| | | |
| | | long HItemID = list[0].HItemID; |
| | | string HNumber = list[0].HNumber; |
| | | string HName = list[0].HName; |
| | | string HShortNumber = list[0].HShortNumber; |
| | | long HParentID = list[0].HParentID; |
| | | long HLevel = list[0].HLevel; |
| | | string HEndFlag = list[0].HEndFlag; |
| | | string HStopflag = list[0].HStopflag; |
| | | string HRemark = list[0].HRemark; |
| | | string HHelpCode = list[0].HHelpCode; |
| | | string HUseFlag = list[0].HUseFlag; |
| | | DateTime HMakeTime = list[0].HMakeTime; |
| | | string HMakeEmp = list[0].HMakeEmp; |
| | | |
| | | ////夿æé |
| | | //if (!ClsPub.Security_Log("Gy_TechnologyParameter_Add_Edit_", 1, false, msg3)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ²¡ææ¾å°è¯¥åè½æ¨¡åï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //if (!DBUtility.ClsPub.AllowNumber(HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç ä¸ä¸è½åºç°è¿ç»â.âå¹¶ä¸é¦ä½æ«ä½ä¸è½ä¸ºâ.âï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | |
| | | //if (oDept.HavSameNumber(HItemID, HNumber)) |
| | | //{ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "代ç éå¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | if (HItemID == 0) |
| | | { |
| | | //å½åæ¶é´ |
| | | var currentTime = DateTime.Now.ToString(); |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Insert into Gy_TechnologyParameterUnit " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID,HLevel" + |
| | | ",HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HMakeEmp) " + |
| | | " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HParentID.ToString() + |
| | | "','" + HLevel.ToString() + "','" + HEndFlag + "','" + HStopflag + "','" + HRemark + "','" + HUseFlag + "','" + currentTime + "','" + HMakeEmp + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // Convert.ToString(HEndFlag ? 1 : 0); Convert.ToString(HStopflag ? 1 : 0);HUseFlag |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCN.RunProc("Update Gy_TechnologyParameterUnit set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.Commit(); |
| | | } |
| | | else |
| | | { |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | oCN.BeginTran(); |
| | | //主表 |
| | | oCN.RunProc("Update Gy_TechnologyParameterUnit set " + |
| | | " HNumber='" + HNumber + "'" + |
| | | ",HName='" + HName + "'" + |
| | | ",HShortNumber='" + HShortNumber + "'" + |
| | | ",HHelpCode='" + HHelpCode + "'" + |
| | | ",HLevel='" + HLevel.ToString() + "'" + |
| | | ",HParentID='" + HParentID.ToString() + "'" + |
| | | ",HEndflag='" + HEndFlag + "'" + |
| | | ",HStopflag='" + HStopflag + "'" + |
| | | ",HUseFlag='" + HUseFlag + "'" + |
| | | //",HMakeTime= getdate()" + |
| | | ",HMakeEmp='" + HMakeEmp + "'" + |
| | | ",HRemark='" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Warehouse,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCN.RunProc("Update Gy_TechnologyParameterUnit set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | oCN.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·¥èºåæ°åä½å表å é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("DeltetGy_TechnologyParameterUnit")] |
| | | [HttpGet] |
| | | public object DeltetGy_TechnologyParameterUnit(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | try |
| | | { |
| | | //å 餿é |
| | | //if (!DBUtility.ClsPub.Security_Log("DeltetGy_TechnologyParameter", 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_TechnologyParameterUnit where HItemID=" + HItemID, "Gy_TechnologyParameterUnit"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ²¡ææ°æ®ï¼æ æ³å é¤ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | } |
| | | //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]); |
| | | //if (HStopflag) |
| | | //{ |
| | | // oCN.RollBack();//åæ»äºå¡ |
| | | // objJsonResult.code = "0"; |
| | | // objJsonResult.count = 0; |
| | | // objJsonResult.Message = "æ°æ®å·²å 餿 æ³å次å é¤ï¼"; |
| | | // objJsonResult.data = null; |
| | | // return objJsonResult; |
| | | //} |
| | | ds1 = oCN.RunProcReturn("Select HItemID from Gy_TechnologyParameterUnit Where HParentID='" + HItemID + "'", "Gy_TechnologyParameterUnit"); |
| | | 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_TechnologyParameterUnit 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | public DateTime HEndDate; |
| | | public string HICMOBillNo; |
| | | public string HWorkShopID; |
| | | public string HSeOrderBillNo; |
| | | public string F_BSV_WYID; |
| | | public string HBillNo; |
| | | public string HMaterNumber; |
| | | } |
| | | [Route("ProductionPlanReport/ProductionPlanReportList")] |
| | |
| | | ProductionPlanReport com = JsonConvert.DeserializeObject<ProductionPlanReport>(sWhere.ToString()); |
| | | |
| | | ds = oCN.RunProcReturn($"exec h_p_Cj_ProductionPlanReportList {com.HOrgID},'{com.HBeginDate}','{com.HEndDate}'" + |
| | | $",'{com.HICMOBillNo}',{com.HWorkShopID},'{com.HSeOrderBillNo}','{com.HMaterNumber}'", "h_p_Cj_ProductionPlanReportList"); |
| | | $",'{com.HICMOBillNo}',{com.HWorkShopID},'{com.F_BSV_WYID}','{com.HMaterNumber}','{com.HBillNo}'", "h_p_Cj_ProductionPlanReportList"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_MES_StationInBillList", "h_v_MES_StationInBillList"); |
| | | } |
| | | else |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_MES_StationInBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_MES_StationInBillList"); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | /// </summary> |
| | | [Route("LEMS/MES_Sc_ProcessExchangeBillQuery_Json")] |
| | | [HttpGet] |
| | | public object MES_Sc_ProcessExchangeBillList_Json(string sWhere,string user) |
| | | public object MES_Sc_ProcessExchangeBillList_Json(string sWhere, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | |
| | | //} |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere+ " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery"); |
| | | ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery"); |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | string sql = "select * from h_v_Sc_ProcessExchangeBillQuerySub where hmainid = "; |
| | | string sql1 = sql + sWhere; |
| | | ds = oCN.RunProcReturn(sql1+ " order by cast(å·¥åºå· as int)", "h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | ds = oCN.RunProcReturn(sql1 + " order by cast(å·¥åºå· as int)", "h_v_Sc_ProcessExchangeBillQuerySub"); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | } |
| | | return GetObjectJson(ds); |
| | | } |
| | | |
| | | #region å·¥åºæµè½¬å¡ï¼ä¸è¾¾ï¼ |
| | | |
| | | /// <summary> |
| | | /// è¿åå·¥åºæµè½¬å¡ï¼ä¸è¾¾ï¼å表 |
| | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// ä¸è¾¾ |
| | | /// å·¥åºæµè½¬å¡ä¸è¾¾ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("LEMS/MES_Sc_ProcessExchangeIssue")] |
| | | [HttpGet] |
| | | public object MES_Sc_ProcessExchangeIssue(string HGroupID, string HSourceID, string HEntryId) { |
| | | public object MES_Sc_ProcessExchangeIssue(string HGroupID, string HSourceID, string HEntryId) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·¥åºæµè½¬å¡åä¸è¾¾ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("LEMS/MES_Sc_ProcessExchangeCancelIssue")] |
| | | [HttpGet] |
| | | public object MES_Sc_ProcessExchangeCancelIssue(string HEntryId) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | string sql = string.Empty; |
| | | //å é¤çäº§ç¶æè¡¨ä¸´æ¶è¡¨æ°æ® |
| | | sql = string.Format(@" |
| | | delete from Sc_ICMOBillStatus_Tmp |
| | | where |
| | | cast(HSOURCEINTERID as varchar(20)) +'-'+ cast(HSOURCEENTRYID as varchar(20)) in |
| | | ( |
| | | select * from fn_Split('{0}',',') |
| | | )", HEntryId); |
| | | oCN.RunProc(sql); |
| | | //æ´æ¹è®¢åç¶æ |
| | | sql = string.Format(@" |
| | | update Sc_ProcessExchangeBillSub set |
| | | HGroupID=0, --çç» |
| | | HSourceID=0, --çäº§èµæº |
| | | HIssue = 0 --ä¸è¾¾ç¶æ |
| | | where cast(HInterID as varchar(20)) +'-'+ cast(HEntryID as varchar(20)) in |
| | | ( |
| | | select * from fn_Split('{0}',',') |
| | | )", HEntryId); |
| | | oCN.RunProc(sql); |
| | | objJsonResult.code = "1"; |
| | | 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> |
| | | [Route("LEMS/MES_Gy_RoutingBillList_Json")] |
| | | [HttpGet] |
| | | public object MES_Gy_RoutingBillList_Json(string sWhere,string user) |
| | | public object MES_Gy_RoutingBillList_Json(string sWhere, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | |
| | | else |
| | | { |
| | | string sql1 = "select top 1000 * from h_v_Gy_RoutingBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere+ " order by hmainid desc,cast(å·¥åºå· as int)"; |
| | | string sql = sql1 + sWhere + " order by hmainid desc,cast(å·¥åºå· as int)"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_RoutingBillList"); |
| | | } |
| | | } |
| | |
| | | /// <returns></returns> |
| | | [Route("LEMS/DeltetGy_RoutingBillSub")] |
| | | [HttpGet] |
| | | public object DeltetGy_RoutingBillSub(Int64 lngBillKey,string user) |
| | | public object DeltetGy_RoutingBillSub(Int64 lngBillKey, string user) |
| | | { |
| | | DataSet ds; |
| | | string ModRightNameCheck = "Gy_RoutingBill_Drop"; |
| | |
| | | /// </summary> |
| | | [Route("LEMS/MES_IF_ICMOBillList_Json")] |
| | | [HttpGet] |
| | | public object MES_IF_ICMOBillList_Json(string sWhere,string user) |
| | | public object MES_IF_ICMOBillList_Json(string sWhere, string user) |
| | | { |
| | | DataSet ds; |
| | | try |
| | |
| | | /// </summary> |
| | | [Route("LEMS/Update_Gy_BarCodeBill_HQty")] |
| | | [HttpGet] |
| | | public object Update_Gy_BarCodeBill_HQty(string HBarCode,string HQty) |
| | | public object Update_Gy_BarCodeBill_HQty(string HBarCode, string HQty) |
| | | { |
| | | DataSet ds; |
| | | try |
| | |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain '" + HBillNo + "',''", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain"); |
| | | } |
| | | else |
| | | else |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain '" + HBillNo + "','" + HRemark + "'", "h_p_Save_KF_PonderationBillMain_TempToSc_PackUnionBillMain"); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | public DAL.ClsSc_MouldMaintainRuleBill BillNew = new DAL.ClsSc_MouldMaintainRuleBill(); //对åºåæ®ç±» |
| | | public DAL.ClsSc_MouldMaintainRuleBill BillOld = new DAL.ClsSc_MouldMaintainRuleBill(); //对åºåæ®ç±» |
| | | |
| | | |
| | | //public class HlpBill |
| | | //{ |
| | | // public int HSouceInterID = 0; |
| | | // public int HSourceEntryID = 0; |
| | | // public int Type = 0; |
| | | // public string user { get; set; } |
| | | //} |
| | | #region å¨å
·ä¿å
»è§ç¨åå表 |
| | | [Route("Sc_MouldMaintainRuleBill/GetMouldMaintainRuleList")] |
| | | [HttpGet] |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //ååºååä¼ éçå¼ |
| | | //HlpBill com = JsonConvert.DeserializeObject<HlpBill>(sWhere.ToString()); |
| | | //ç¼è¾æé |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainRuleBillList", 1, false, user)) |
| | | { |
| | |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_MouldMaintainRuleBillList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | DAL.ClsCg_POInStockBill oBill = new DAL.ClsCg_POInStockBill(); |
| | | var hinterID = list[0].HInterID; |
| | | var FID = list[0].FID; |
| | | |
| | | #region éè¶å®¡æ ¸åä¼éæ°åæ¥åæ®å°mes æ
ä¸éè¦æ´æ°mesçæ¶æéç¥å |
| | | /* |
| | | oCn.BeginTran(); |
| | | string sql = string.Empty; |
| | | |
| | | foreach (var item in list) |
| | | { |
| | | if (item.HSQty == 0) |
| | |
| | | oCn.RunProc(sql); |
| | | } |
| | | oCn.RunProc("exec h_p_Cg_UpDatePOOrderRelation_Del " + hinterID);//å é¤å
³èå
³ç³» |
| | | sql = string.Format(@"update Cg_POInStockBillMain set |
| | | HBillStatus = 2 , |
| | | HCheckDate = getdate() |
| | | where HInterID in ({0})", HInterID); |
| | | oCn.RunProc(sql);//æ´æ°mesç¶æ |
| | | //æ´æ°æåå åæ¥æ´æ°éè¶ |
| | | oCn.Commit(); |
| | | **/ |
| | | #endregion |
| | | |
| | | JObject jsonRoot = new JObject(); |
| | | jsonRoot.Add("Creator", ""); |
| | |
| | | continue; |
| | | JObject jsonFPOOrderEntry = new JObject(); |
| | | jsonFPOOrderEntry.Add("FEntryID", item.FEntryID); |
| | | jsonFPOOrderEntry.Add("FHQty ", item.HSQty); ; |
| | | jsonFPOOrderEntry.Add("FActReceiveQty ", item.HSQty); ; |
| | | Entry.Add(jsonFPOOrderEntry); |
| | | } |
| | | jsonModel.Add("FEntity", Entry); |
| | | jsonModel.Add("FDetailEntity", Entry); |
| | | jsonRoot.Add("Model", jsonModel); |
| | | var loginRet = InvokeHelper.Login(); |
| | | var isSuccess = JObject.Parse(loginRet)["LoginResultType"].Value<int>(); |
| | |
| | | } |
| | | var result = InvokeHelper.Save("PUR_ReceiveBill", jsonRoot.ToString()); |
| | | //LogService.Write(result); |
| | | if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() == "TRUE") |
| | | if (JObject.Parse(result)["Result"]["ResponseStatus"]["IsSuccess"].ToString().ToUpper() != "TRUE") |
| | | { |
| | | LogService.Write("æ¶æéç¥åä¿®æ¹å¤±è´¥jsonRoot:" + jsonRoot.ToString()); |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | } |
| | | |
| | | sql = string.Format(@"update Cg_POInStockBillMain set |
| | | HBillStatus = 2 , |
| | | HCheckDate = getdate() |
| | | where HInterID in ({0})", HInterID); |
| | | oCn.RunProc(sql);//æ´æ°mesç¶æ |
| | | //æ´æ°æåå åæ¥æ´æ°éè¶ |
| | | oCn.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æä½æåï¼"; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | //oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å¼å¸¸ï¼" + e.ToString(); |
| | |
| | | { |
| | | try |
| | | { |
| | | //var code = HBarcode.Split('#')[0]; |
| | | //æ ¡éªæ¡ç æ¯å¦åå¨ |
| | | string sql = $"select* from Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode}'"; |
| | | string sql = $"select* from Gy_BarCodeBill where HSourceInterID ={HInterID} and HBarCode = '{HBarcode.Split('#')[0]}' and HQty = {HBarcode.Split('#')[1]}"; |
| | | DataSet ds = oCn.RunProcReturn(sql, "H_v_SRM_POOrderBillList"); |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | string sql = sql1 + sWhere + " order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckBillList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sb_EquipDotCheckRuleBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckRuleList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sb_EquipMaintainBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sc_EquipMaintain"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sb_EquipMaintainRuleBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipMaintainRuleList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sb_EquipRepairWorkBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sb_EquipRepairWorkBill_s(sWhere); |
| | | |
| | | //æ·»å åå |
| | | 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 = "è¿åè®°å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sb_EquipConkBookBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sb_EqpConkBookBillList_s(sWhere); |
| | | |
| | | //æ·»å åå |
| | | 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 = "è¿åè®°å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | |
| | | } |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldMaintainBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sc_MouldMaintainBillList_s(sWhere); |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldDotCheckBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | } |
| | | ds = Sc_MouldDotCheckBillList_s(sWhere); |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldConkBookBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sc_MouldConkBookBillList_s(sWhere); |
| | | |
| | | //æ·»å åå |
| | | 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 ex) |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Sb_MouldRepairWorkBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sc_MouldRepairWorkBillList_s(sWhere); |
| | | |
| | | //æ·»å åå |
| | | 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å对象çåå |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | |
| | | if (!DBUtility.ClsPub.Security_Log("Sc_MouldLifeChangeBillList", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sc_GetMouldLifeChangeBill(sWhere); |
| | | |
| | | //æ·»å åå |
| | | 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 = "è¿åè®°å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | |
| | | FentityModel.Add("FCostRate", dr1["FCostRate"].ToString());// ææ¬æé |
| | | FentityModel.Add("FISBACKFLUSH", dr1["FISBACKFLUSH"].ToString() == "1" ? true : false);// åå²é¢æ |
| | | FentityModel.Add("F_bsv_Base1", new JObject() { ["Fnumber"] = dr1["FPREBDONENUMBER"].ToString() }); //å
è£
æ è¯ |
| | | FentityModel.Add("FLot", new JObject() { ["FNumber"] = dr1["FBATCHNO"].ToString() }); //å
è£
æ è¯ |
| | | FentityModel.Add("FLot", new JObject() { ["FNumber"] = dr1["FBATCHNO"].ToString() }); //æ¹å· |
| | | //æ¹å· |
| | | //FFLOWID FFLOWLINEID FRULEID FSTABLENAME |
| | | //f6e6eec3 - 5267 - 4f02 - 8593 - b633da508a72 3 PRD_MO2MORPT T_PRD_MOENTRY |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_Group", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | |
| | | |
| | | ds = Sc_GetGroupEmpBill(sWhere); |
| | | |
| | | //æ·»å åå |
| | | 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 = "è¿åè®°å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
New file |
| | |
| | | using Newtonsoft.Json.Linq; |
| | | using Pub_Class; |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlClient; |
| | | using System.Web.Http; |
| | | using WebAPI.Models; |
| | | |
| | | namespace WebAPI.Controllers |
| | | { |
| | | |
| | | public class Pay_PurchaseWallclothBillController : ApiController |
| | | { |
| | | public DBUtility.ClsPub.Enum_BillStatus BillStatus; |
| | | |
| | | private json objJsonResult = new json(); |
| | | public DataSet ds = new DataSet(); |
| | | public WebServer webserver = new WebServer(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | /// <summary> |
| | | /// è¿åå·¥èµç»ç®ä¸ªäººå表(个人) |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | [Route("Pay_PurchaseWallclothBill/GetSingleBalBill")] |
| | | [HttpGet] |
| | | public object GetSingleBalBill(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = Sc_GetSingleBalBill(sWhere); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è¿åè®°å½æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | public static DataSet Sc_GetSingleBalBill(string sWhere) |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Pay_PurchaseWallclothBillMain order by hinterid desc", "h_v_Pay_PurchaseWallclothBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_Pay_PurchaseWallclothBillMain where 1 = 1 "; |
| | | string sql = sql1 + sWhere + " order by hinterid desc"; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Pay_PurchaseWallclothBillList"); |
| | | } |
| | | |
| | | } |
| | | |
| | | #region[å·¥èµç»ç®ä¸ªäººåç¼è¾æ¶è·åè¡¨å¤´æ°æ®] |
| | | [Route("Pay_PurchaseWallclothBill/Pay_PurchaseWallclothBillListCheckDetail")] |
| | | [HttpGet] |
| | | public ApiResult<DataSet> Pay_PurchaseWallclothBillListCheckDetail(string HID) |
| | | { |
| | | if (string.IsNullOrEmpty(HID)) |
| | | return new ApiResult<DataSet> { code = -1, msg = "IDä¸è½ä¸ºç©º" }; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Pay_PurchaseWallclothBillMain where HInterID= " + HID + " ", "Pay_PurchaseWallclothBillMain"); |
| | | 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 }; |
| | | } |
| | | #endregion |
| | | |
| | | #region[å·¥èµç»ç®ä¸ªäººåç¼è¾æ¶è·åè¡¨ä½æ°æ®] |
| | | [Route("Pay_PurchaseWallclothBill/Pay_PurchaseWallclothBillListProjectDetai")] |
| | | [HttpGet] |
| | | public object Pay_PurchaseWallclothBillListProjectDetai(string sqlWhere) |
| | | { |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | string sql1 = "SELECT * FROM Pay_PurchaseWallclothBillSub where 1 = 1 "; |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Pay_PurchaseWallclothBillList"); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | [Route("Pay_PurchaseWallclothBill/SaveGetSingleBalBillList")] |
| | | [HttpPost] |
| | | /// <summary> |
| | | /// æ°å¢åæ®-ä¿åæé® |
| | | ///åæ°ï¼string sqlã |
| | | ///è¿åå¼ï¼objectã |
| | | /// </summary> |
| | | public object SaveGetSingleBalBillList([FromBody] JObject msg) |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString();//主表 |
| | | string msg3 = sArray[1].ToString();//å表 |
| | | string refSav = sArray[2].ToString();//add update |
| | | string msg4 = sArray[3].ToString();//æä½ç¨æ· |
| | | |
| | | string sql = string.Empty; |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | var lsmain = Newtonsoft.Json.JsonConvert.DeserializeObject<ClsPay_PurchaseWallclothBillMain>(msg2); |
| | | var DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsPay_PurchaseWallclothBillSub>>(msg3); |
| | | oCN.BeginTran(); |
| | | if (refSav == "Add") |
| | | { |
| | | sql = string.Format(@" |
| | | INSERT INTO [dbo].[Pay_PurchaseWallclothBillMain]([HInterID],[HBillType] |
| | | ,[HBillSubType],[HDate],[HBillNo],[HBillStatus],[HGroupID1],[HGroupID2],[HGroupID3] |
| | | ,[HEmpID1],[HEmpID2],[HEmpID3],[HEmpID4],[HEmpID5],[HEmpID6],[HRemark],[HMaker],[HMakeDate] |
| | | ,[HUpDater],[HUpDateDate]) select '{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}'" |
| | | , lsmain.HInterID, "7789", lsmain.HBillSubType, lsmain.HDate, lsmain.HBillNo, lsmain.HBillStatus, lsmain.HGroupID1 |
| | | , lsmain.HGroupID2, lsmain.HGroupID3, lsmain.HEmpID1, lsmain.HEmpID2, lsmain.HEmpID3, lsmain.HEmpID4, lsmain.HEmpID5, lsmain.HEmpID6, lsmain.HRemark |
| | | , lsmain.HMaker, lsmain.HMakeDate, lsmain.HUpDater, lsmain.HUpDateDate); |
| | | oCN.RunProc(sql); |
| | | int HEntryID = 1; |
| | | foreach (var item in DetailColl) |
| | | { |
| | | sql = string.Format(@"insert into[Pay_PurchaseWallclothBillSub]([HInterID],[HEntryID],[HSelOrderNo],[HRemark]) select {0},{1},'{2}','{3}'" |
| | | , lsmain.HInterID, HEntryID, item.HSelOrderNo,item.HRemark); |
| | | oCN.RunProc(sql); |
| | | HEntryID++; |
| | | } |
| | | } |
| | | else if (refSav == "Update") |
| | | { |
| | | sql = string.Format(@" |
| | | update [Pay_PurchaseWallclothBillMain] set |
| | | [HGroupID1] = {0}, |
| | | [HGroupID2] = {1}, |
| | | [HGroupID3] = {2}, |
| | | [HEmpID1] = {3}, |
| | | [HEmpID2] = {4}, |
| | | [HEmpID3] = {5}, |
| | | [HEmpID4] = {6}, |
| | | [HEmpID5] = {7}, |
| | | [HEmpID6] = {8}, |
| | | [HRemark] = '{9}', |
| | | [HUpDater] = {10}, |
| | | [HUpDateDate] = '{11}', |
| | | where HInterID = {12}", |
| | | lsmain.HGroupID1, |
| | | lsmain.HGroupID2, |
| | | lsmain.HGroupID3, |
| | | lsmain.HEmpID1, |
| | | lsmain.HEmpID2, |
| | | lsmain.HEmpID3, |
| | | lsmain.HEmpID4, |
| | | lsmain.HEmpID5, |
| | | lsmain.HEmpID6, |
| | | lsmain.HRemark, |
| | | lsmain.HUpDater, |
| | | lsmain.HUpDateDate, |
| | | lsmain.HInterID); |
| | | oCN.RunProc(sql); |
| | | sql = $"delete Pay_PurchaseWallclothBillSub where HinterID = {lsmain.HInterID}"; |
| | | oCN.RunProc(sql); |
| | | int HEntryID = 1; |
| | | foreach (var item in DetailColl) |
| | | { |
| | | sql = string.Format(@"insert into[Pay_PurchaseWallclothBillSub]([HInterID],[HEntryID],[HSelOrderNo],[HRemark]) select {0},{1},'{2}','{3}'" |
| | | , lsmain.HInterID, HEntryID, item.HSelOrderNo, item.HRemark); |
| | | oCN.RunProc(sql); |
| | | HEntryID++; |
| | | } |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | ///å·¥èµç»ç®ä¸ªäººåå é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Pay_PurchaseWallclothBill/DeltetSingleBalBill")] |
| | | [HttpGet] |
| | | public object Pay_PurchaseWallclothBill(string HInterID, string user) |
| | | { |
| | | try |
| | | { |
| | | if (!DBUtility.ClsPub.Security_Log("Pay_PurchaseWallclothBill_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran(); |
| | | oCN.RunProc("Delete From Pay_PurchaseWallclothBillMain where HInterID = " + HInterID); |
| | | oCN.RunProc("Delete From Pay_PurchaseWallclothBillSub where HInterID = " + HInterID); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class TechParamByProc |
| | | { |
| | | public long HInterID { get; set; } |
| | | public string HMaker { get; set; } |
| | | public string HChecker { get; set; } |
| | | public string HRemark { get; set; } |
| | | public string HStopflag { get; set; } |
| | | public long HMaterID { get; set; } |
| | | public int HProcID { get; set; } |
| | | public Int64 HTechParamID { get; set; } |
| | | public Int64 HTechParamUnitID { get; set; } |
| | | public string HStd { get; set; } |
| | | public Int64 HDeptID { get; set; } |
| | | public DateTime HMakeDate { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class TechnologyParameter |
| | | { |
| | | public long HItemID { get; set; } |
| | | public string HNumber { get; set; } |
| | | public string HName { get; set; } |
| | | public string HShortNumber { get; set; } |
| | | public long HParentID { get; set; } |
| | | public long HLevel { get; set; } |
| | | public string HEndFlag { get; set; } |
| | | public string HStopflag { get; set; } |
| | | public string HRemark { get; set; } |
| | | public string HHelpCode { get; set; } |
| | | public string HUseFlag { get; set; } |
| | | public DateTime HMakeTime { get; set; } |
| | | public string HMakeEmp { get; set; } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class TechnologyParameterUnit |
| | | { |
| | | public long HItemID { get; set; } |
| | | public string HNumber { get; set; } |
| | | public string HName { get; set; } |
| | | public string HShortNumber { get; set; } |
| | | public long HParentID { get; set; } |
| | | public long HLevel { get; set; } |
| | | public string HEndFlag { get; set; } |
| | | public string HStopflag { get; set; } |
| | | public string HRemark { get; set; } |
| | | public string HHelpCode { get; set; } |
| | | public string HUseFlag { get; set; } |
| | | public DateTime HMakeTime { get; set; } |
| | | public string HMakeEmp { get; set; } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class ClsPay_PurchaseWallclothBillMain : DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | public Int64 HGroupID1; |
| | | public Int64 HGroupID2; |
| | | public Int64 HGroupID3; |
| | | |
| | | public Int64 HEmpID1; |
| | | public Int64 HEmpID2; |
| | | public Int64 HEmpID3; |
| | | public Int64 HEmpID4; |
| | | public Int64 HEmpID5; |
| | | public Int64 HEmpID6; |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace WebAPI.Models |
| | | { |
| | | public class ClsPay_PurchaseWallclothBillSub : DBUtility.ClsXt_BaseBillSub |
| | | { |
| | | public string HSelOrderNo; |
| | | } |
| | | } |
| | |
| | | <Compile Include="Controllers\PurchaseOrderController.cs" /> |
| | | <Compile Include="Controllers\QC_POStockInCheckBillController.cs" /> |
| | | <Compile Include="Controllers\å·¥èµç®¡ç\Gy_GroupEmpBillController.cs" /> |
| | | <Compile Include="Controllers\å·¥èµç®¡ç\Pay_PurchaseWallclothBillController.cs" /> |
| | | <Compile Include="Controllers\å·¥èµç®¡ç\Pay_WorkTimesBillController.cs" /> |
| | | <Compile Include="Controllers\å·¥èµç®¡ç\Pay_SingleBalBillController.cs" /> |
| | | <Compile Include="Controllers\ProductionOrderController.cs" /> |
| | |
| | | <Compile Include="Models\åºç¡èµæ\Gy_Employee.cs" /> |
| | | <Compile Include="Models\åºç¡èµæ\Gy_Process.cs" /> |
| | | <Compile Include="Models\åºç¡èµæ\Warehouse.cs" /> |
| | | <Compile Include="Models\å·¥èµç®¡ç\ClsPay_PurchaseWallclothBillMain.cs" /> |
| | | <Compile Include="Models\å·¥èµç®¡ç\ClsPay_WorkTimesBillMain.cs" /> |
| | | <Compile Include="Models\å·¥èµç®¡ç\ClsPay_PurchaseWallclothBillSub.cs" /> |
| | | <Compile Include="Models\å·¥èµç®¡ç\ClsPay_WorkTimesBillSub.cs" /> |
| | | <Compile Include="obj\Debug\.NETFramework,Version=v4.5.AssemblyAttributes.cs" /> |
| | | <Compile Include="Properties\Resources.Designer.cs"> |