| | |
| | | <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsKF_BarCodeStatusChangeBill.cs" /> |
| | | <Compile Include="åºç¡èµæ\InterFaceåºç¡èµæ\ClsIF_ORGANIZATIONS_View.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_BadType_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_CardChangeType_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_CardStatus_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_CardAddress_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_CustLocation_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_EquipStatus_Ctl.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_CardChangeType_Ctl : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_CardChangeType_Model oModel = new Model.ClsGy_CardChangeType_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) " + |
| | | " 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 + "'" + ")", 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 + "'" + |
| | | ",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_CardChangeType_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_CardChangeType"; |
| | | MvarReportTitle = "å卿¹å¼"; |
| | | oModel = new Model.ClsGy_CardChangeType_Model(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_CardStatus_Ctl : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_CardStatus_Model oModel = new Model.ClsGy_CardStatus_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) " + |
| | | " 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 + "'" + ")", 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 + "'" + |
| | | ",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_CardStatus_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_CardStatus"; |
| | | MvarReportTitle = "èµäº§ç¶æ"; |
| | | oModel = new Model.ClsGy_CardStatus_Model(); |
| | | } |
| | | } |
| | | } |
| | |
| | | "" + |
| | | "" + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ",HProjectMoneyID,HTypeSub,HMoney,HTaxRate,HSumMoney,HQty,HPrice) " + |
| | | ",HProjectMoneyID,HTypeSub,HMoney,HTaxRate,HSumMoney,HQty,HPrice,HRemark) " + |
| | | " values(" + |
| | | "" + omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID.ToString() + |
| | |
| | | "','" + oSub.HMoney + |
| | | "','" + oSub.HTaxRate + |
| | | "','" + oSub.HSumMoney + |
| | | "','" + oSub.HQty + |
| | | "','" + oSub.HPrice + |
| | | "','" + oSub.HQty + |
| | | "','" + oSub.HPrice + |
| | | "','" + oSub.HRemark + |
| | | "')"; |
| | | oCn.RunProc(subSql); |
| | | } |
| | |
| | | "" + |
| | | "" + |
| | | "(HInterID,HEntryID,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType" + |
| | | ",HProjectMoneyID,HTypeSub,HMoney,HTaxRate,HSumMoney,HQty,HPrice) " + |
| | | ",HProjectMoneyID,HTypeSub,HMoney,HTaxRate,HSumMoney,HQty,HPrice,HRemark) " + |
| | | " values(" + |
| | | "" + omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID.ToString() + |
| | |
| | | "','" + oSub.HMoney + |
| | | "','" + oSub.HTaxRate + |
| | | "','" + oSub.HSumMoney + |
| | | "','" + oSub.HQty + |
| | | "','" + oSub.HPrice + |
| | | "','" + oSub.HQty + |
| | | "','" + oSub.HPrice + |
| | | "','" + oSub.HRemark + |
| | | "')"; |
| | | oCn.RunProc(subSql); |
| | | } |
| | |
| | | <SubType>Code</SubType> |
| | | </Compile> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_BadResult_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CardChangeType_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CardStatus_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CardAddress_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_CardType_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_StockCheckItem_Model.cs" /> |
| | |
| | | <Compile Include="éå®ç®¡ç\ClsXs_SellPlanBillSub.cs" /> |
| | | <Compile Include="éå®ç®¡ç\ClsXs_SellPlanExecuteBillMain.cs" /> |
| | | <Compile Include="éå®ç®¡ç\ClsXs_SellPlanExecuteBillSub.cs" /> |
| | | <Compile Include="éå®ç®¡ç\ClsXs_OutDoorCheckBillMain.cs" /> |
| | | <Compile Include="éå®ç®¡ç\ClsXs_SeQuotation_ccjgBillMain.cs" /> |
| | | <Compile Include="éå®ç®¡ç\ClsXs_SeQuotation_ccjgBillSub.cs" /> |
| | | <Compile Include="éå®ç®¡ç\ClsXs_SeDownStockBillMain.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | //using System.Drawing; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsGy_CardChangeType_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; } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | //using System.Drawing; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsGy_CardStatus_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 double HSumMoney;// dec(18,8) //æ»éé¢ |
| | | public double HQty;// dec(18,8) //ç¨ç |
| | | public double HPrice;// dec(18,8) //æ»éé¢ |
| | | public string HSubHremark;// varchar(20) -å夿³¨ |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsXs_OutDoorCheckBillMain:DBUtility.ClsXt_BaseBillMain |
| | | { |
| | | public string HExplanation; // varchar(200) --åºé¨è¯´æ |
| | | |
| | | } |
| | | } |
| | |
| | | using Newtonsoft.Json; |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | public DAL.ClsGy_CardAddress_Ctl BillOld = new DAL.ClsGy_CardAddress_Ctl(); |
| | | |
| | | #region èµäº§ä½ç½®å表æ¥è¯¢ |
| | | [Route("Gy_CardAddress/list")] |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region èµäº§ä½ç½® å®¡æ ¸ |
| | | [Route("Gy_CardAddress/AuditGy_CardAddress")] |
| | | [HttpGet] |
| | | public object AuditGy_CardAddress(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_CardAddress_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»å®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from Gy_CardAddress where HItemID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åå®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from Gy_CardAddress where HItemID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCheckEmp"] == null || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åå®¡æ ¸åæ® |
| | | if (!BillOld.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region èµäº§ä½ç½® ç¦ç¨ |
| | | [Route("Gy_CardAddress/StopGy_CardAddress")] |
| | | [HttpGet] |
| | | public object StopGy_CardAddress(int HInterID, int IsStop, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_CardAddress_Stop", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from Gy_CardAddress where HItemID=" + HInterID, "Gy_CardAddress"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªç¦ç¨!ä¸éè¦åç¦ç¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | //ç¦ç¨åæ® |
| | | if (!BillOld.StopByHItemID(HInterID, CurUserName, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | //åç¦ç¨åæ® |
| | | if (!BillOld.AbandonStopByHItemID(HInterID, CurUserName, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | 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 = "ç¦ç¨å¤±è´¥æè
åç¦ç¨å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | 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_CardChangeTypeController : 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; |
| | | public DAL.ClsGy_CardChangeType_Ctl BillOld = new DAL.ClsGy_CardChangeType_Ctl(); |
| | | |
| | | #region å卿¹å¼å表æ¥è¯¢ |
| | | [Route("Gy_CardChangeType/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_CardChangeType_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_CardChangeTypeList where 使ç¨ç»ç»='" + Organization + "'"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn(sql1 + sWhere + " order by hmainid desc", "h_v_Gy_CardChangeTypeList"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + "order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_CardChangeTypeList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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_CardChangeType/SaveGy_CardChangeType")] |
| | | [HttpPost] |
| | | public object SaveGy_CardChangeType([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_CardChangeType_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_CardChangeType_Ctl oBill = new DAL.ClsGy_CardChangeType_Ctl(); |
| | | List<Model.ClsGy_CardChangeType_Model> lsmain = new List<Model.ClsGy_CardChangeType_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | msg1 = "[" + msg1 + "]"; |
| | | lsmain = JsonConvert.DeserializeObject<List<Model.ClsGy_CardChangeType_Model>>(msg1); |
| | | foreach (Model.ClsGy_CardChangeType_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_CardChangeType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CardChangeType"); |
| | | |
| | | 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_CardChangeType")] |
| | | [HttpGet] |
| | | public object DeltetGy_CardChangeType(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | try |
| | | { |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_CardChangeType_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_CardChangeType where HItemID=" + HItemID, "Gy_CardChangeType"); |
| | | 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_CardChangeType Where HParentID='" + HItemID + "'", "Gy_CardChangeType"); |
| | | 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_CardChangeType where HItemID=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å卿¹å¼ å®¡æ ¸ |
| | | [Route("Gy_CardChangeType/AuditGy_CardChangeType")] |
| | | [HttpGet] |
| | | public object AuditGy_CardChangeType(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_CardChangeType_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»å®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from Gy_CardChangeType where HItemID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åå®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from Gy_CardChangeType where HItemID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCheckEmp"] == null || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åå®¡æ ¸åæ® |
| | | if (!BillOld.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å卿¹å¼ ç¦ç¨ |
| | | [Route("Gy_CardChangeType/StopGy_CardChangeType")] |
| | | [HttpGet] |
| | | public object StopGy_CardChangeType(int HInterID, int IsStop, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_CardChangeType_Stop", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from Gy_CardChangeType where HItemID=" + HInterID, "Gy_CardChangeType"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªç¦ç¨!ä¸éè¦åç¦ç¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | //ç¦ç¨åæ® |
| | | if (!BillOld.StopByHItemID(HInterID, CurUserName, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | //åç¦ç¨åæ® |
| | | if (!BillOld.AbandonStopByHItemID(HInterID, CurUserName, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | 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 = "ç¦ç¨å¤±è´¥æè
åç¦ç¨å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using DBUtility; |
| | | 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_CardStatusController : 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; |
| | | public DAL.ClsGy_CardStatus_Ctl BillOld = new DAL.ClsGy_CardStatus_Ctl(); |
| | | |
| | | #region èµäº§ç¶æå表æ¥è¯¢ |
| | | [Route("Gy_CardStatus/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_CardStatus_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_CardStatusList where 使ç¨ç»ç»='" + Organization + "'"); |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn(sql1 + sWhere + " order by hmainid desc", "h_v_Gy_CardStatusList"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + "order by hmainid desc"; |
| | | ds = oCN.RunProcReturn(sql, "h_v_Gy_CardStatusList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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_CardStatus/SaveGy_CardStatus")] |
| | | [HttpPost] |
| | | public object SaveGy_CardStatus([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_CardStatus_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | try |
| | | { |
| | | DAL.ClsGy_CardStatus_Ctl oBill = new DAL.ClsGy_CardStatus_Ctl(); |
| | | List<Model.ClsGy_CardStatus_Model> lsmain = new List<Model.ClsGy_CardStatus_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | msg1 = "[" + msg1 + "]"; |
| | | lsmain = JsonConvert.DeserializeObject<List<Model.ClsGy_CardStatus_Model>>(msg1); |
| | | foreach (Model.ClsGy_CardStatus_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_CardStatus where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CardStatus"); |
| | | |
| | | 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_CardStatus")] |
| | | [HttpGet] |
| | | public object DeltetGy_CardStatus(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | DataSet ds1; |
| | | try |
| | | { |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_CardStatus_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_CardStatus where HItemID=" + HItemID, "Gy_CardStatus"); |
| | | 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_CardStatus Where HParentID='" + HItemID + "'", "Gy_CardStatus"); |
| | | 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_CardStatus where HItemID=" + HItemID); |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "* æ°æ®å 餿åï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å卿¹å¼ å®¡æ ¸ |
| | | [Route("Gy_CardStatus/AuditGy_CardStatus")] |
| | | [HttpGet] |
| | | public object AuditGy_CardStatus(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_CardStatus_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»å®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from Gy_CardStatus where HItemID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åå®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from Gy_CardStatus where HItemID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCheckEmp"] == null || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åå®¡æ ¸åæ® |
| | | if (!BillOld.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å卿¹å¼ ç¦ç¨ |
| | | [Route("Gy_CardStatus/StopGy_CardStatus")] |
| | | [HttpGet] |
| | | public object StopGy_CardStatus(int HInterID, int IsStop, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_CardStatus_Stop", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from Gy_CardStatus where HItemID=" + HInterID, "Gy_CardStatus"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªç¦ç¨!ä¸éè¦åç¦ç¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | //ç¦ç¨åæ® |
| | | if (!BillOld.StopByHItemID(HInterID, CurUserName, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | //åç¦ç¨åæ® |
| | | if (!BillOld.AbandonStopByHItemID(HInterID, CurUserName, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | 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 = "ç¦ç¨å¤±è´¥æè
åç¦ç¨å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | using Newtonsoft.Json; |
| | | using DBUtility; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | private json objJsonResult = new json(); |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | DataSet ds; |
| | | public DAL.ClsGy_CardType_Ctl BillOld = new DAL.ClsGy_CardType_Ctl(); |
| | | |
| | | #region èµäº§ç±»å«å表æ¥è¯¢ |
| | | [Route("Gy_CardType/list")] |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region èµäº§ç±»å« å®¡æ ¸ |
| | | [Route("Gy_CardType/AuditGy_CardType")] |
| | | [HttpGet] |
| | | public object AuditGy_CardType(string HInterID, int Type, string user) |
| | | { |
| | | try |
| | | { |
| | | //夿æ¯å¦æå®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_CardType_Check", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ æéå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (string.IsNullOrWhiteSpace(HInterID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HInterID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | ClsPub.CurUserName = user; |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | |
| | | //Type 1 å®¡æ ¸ 2 åå®¡æ ¸ |
| | | if (Type == 1) |
| | | { |
| | | //夿忮æ¯å¦å·²ç»å®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from Gy_CardType where HItemID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®å·²å®¡æ ¸!ä¸è½åæ¬¡å®¡æ ¸ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //å®¡æ ¸åæ® |
| | | if (!BillOld.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | else |
| | | { |
| | | //夿忮æ¯å¦å·²ç»åå®¡æ ¸ |
| | | DataSet ds; |
| | | string sql = "select * from Gy_CardType where HItemID = " + HInterID; |
| | | ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey); |
| | | if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HCheckEmp"] == null || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªå®¡æ ¸!ä¸éè¦åå®¡æ ¸!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | //åå®¡æ ¸åæ® |
| | | if (!BillOld.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "åå®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | |
| | | oCN.Commit();//æäº¤äºå¡ |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ§è¡æåï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; ; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ§è¡å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region èµäº§ç±»å« ç¦ç¨ |
| | | [Route("Gy_CardType/StopGy_CardType")] |
| | | [HttpGet] |
| | | public object StopGy_CardType(int HInterID, int IsStop, string CurUserName) |
| | | { |
| | | try |
| | | { |
| | | //å®¡æ ¸æé |
| | | if (!DBUtility.ClsPub.Security_Log_second("Gy_CardType_Stop", 1, false, CurUserName)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ç¦ç¨å¤±è´¥ï¼æ æéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | var ds = oCN.RunProcReturn("select * from Gy_CardType where HItemID=" + HInterID, "Gy_CardType"); |
| | | if (ds.Tables[0].Rows.Count > 0) |
| | | { |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "忮已ç¦ç¨!ä¸è½å次ç¦ç¨ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®æªç¦ç¨!ä¸éè¦åç¦ç¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åæ®ä¸åå¨!"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | if (IsStop == 0) //ç¦ç¨å¤æ |
| | | { |
| | | //ç¦ç¨åæ® |
| | | if (!BillOld.StopByHItemID(HInterID, CurUserName, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | if (IsStop == 1) //åç¦ç¨å¤æ |
| | | { |
| | | //åç¦ç¨åæ® |
| | | if (!BillOld.AbandonStopByHItemID(HInterID, CurUserName, ref ClsPub.sExeReturnInfo)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸å¤±è´¥!åå :" + ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | 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 = "ç¦ç¨å¤±è´¥æè
åç¦ç¨å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å·²ä¸ä¼ æ¥è¯¢çé¢ï¼æ ¹æ®åæ®ç±»åãåæ®å·ãæºåå·ãç¨æ·ãèªå®ä¹å段æ¥è¯¢å·²ä¸ä¼ åæ®ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/GetKf_ICStockBillList_Json")] |
| | | [HttpGet] |
| | | public object GetKf_ICStockBillList_Json(string HBillType, string HBillNo, string HSourceBillNo, string HMaker, Int64 HStockOrgID, string sWhere) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_Kf_ICStockBillQueryList_New '" + HBillType + "','" + HBillNo + "','" + HSourceBillNo + "','" + HMaker + "'," + HStockOrgID.ToString() + ",'" + sWhere+"'", "h_p_Kf_ICStockBillQueryList_New"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥è¯¢ä¸å°è¯¥åæ®è®°å½ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ·»å åå |
| | | 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 = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·ååæ®ä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è·åå·²ä¸ä¼ åæ®ä¿¡æ¯å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | |
| | | #endregion |
| | | |
| | | |
| | | #region åºé¨ç¡®è®¤å模åè°ç¨æ¹æ³ 20240308 |
| | | |
| | | #region æ«æåæ®å·æ¡ç è°ç¨ |
| | | |
| | | /// <summary> |
| | | /// æ«æåæ®å·æ¡ç |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/Get_SourceBarCode_OutDoorCheck_Json")] |
| | | [HttpGet] |
| | | public object Get_SourceBarCode_OutDoorCheck_Json(string HBarCode, Int64 HStockOrgID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCn.RunProcReturn("exec h_p_WMS_AddSourceBarCode_OutDoorCheck '" + HBarCode + "'," + HStockOrgID.ToString(), "h_p_WMS_AddSourceBarCode_OutDoorCheck"); |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ«æåæ®å·æ¡ç å¤æå¤±è´¥ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | if (DBUtility.ClsPub.isLong(ds.Tables[0].Rows[0][0]) == 0) |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ·»å åå |
| | | 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 = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.list = columnNameList; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ«æåæ®å·æ¡ç 失败ï¼" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HRemark"]); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "è·å忮巿¡ç ä¿¡æ¯å¤±è´¥ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region åºé¨ç¡®è®¤å ä¸ä¼ çå |
| | | |
| | | /// <summary> |
| | | /// æ°å¢çæåºé¨ç¡®è®¤å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("WEBSController/set_SaveOutDoorCheckBill_Json")] |
| | | [HttpPost] |
| | | public object set_SaveOutDoorCheckBill_Json([FromBody] JObject sMainSub) |
| | | { |
| | | var _value = sMainSub["sMainSub"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | try |
| | | { |
| | | List<Model.ClsXs_OutDoorCheckBillMain> lsmain = new List<Model.ClsXs_OutDoorCheckBillMain>(); |
| | | ListModels oListModels = new ListModels(); |
| | | lsmain = oListModels.getOutDoorCheckBillMainByJson(msg1); |
| | | ClsXs_OutDoorCheckBillMain oMain = new ClsXs_OutDoorCheckBillMain(); |
| | | string sSourceType = lsmain[0].HMainSourceBillType; |
| | | oMain.HInterID = lsmain[0].HInterID; |
| | | oMain.HBillNo = lsmain[0].HBillNo; |
| | | oMain.HBillType = lsmain[0].HBillType; |
| | | oMain.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString()); |
| | | oMain.HMainSourceBillType = lsmain[0].HMainSourceBillType; |
| | | oMain.HMainSourceInterID = lsmain[0].HMainSourceInterID; |
| | | oMain.HMainSourceEntryID = lsmain[0].HMainSourceEntryID; |
| | | oMain.HMainSourceBillNo = lsmain[0].HMainSourceBillNo; |
| | | oMain.HExplanation = lsmain[0].HExplanation; |
| | | oMain.HRemark = lsmain[0].HRemark; |
| | | oMain.HMaker = lsmain[0].HMaker; |
| | | oMain.HSTOCKORGID = lsmain[0].HSTOCKORGID; |
| | | |
| | | //夿ä¼è®¡ææ¯å¦åç |
| | | string s = ""; |
| | | int sYear = 0; |
| | | int sPeriod = 0; |
| | | if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(oMain.HDate, ref sYear, ref sPeriod, ref s) == false) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = s; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | oMain.HYear = sYear; |
| | | oMain.HPeriod = sPeriod; |
| | | } |
| | | |
| | | oCn.BeginTran(); |
| | | //çæåºé¨ç¡®è®¤åï¼åªéçæä¸»è¡¨æ°æ®ï¼ |
| | | //æå
¥ä¸»è¡¨ |
| | | oCn.RunProc("Insert Into Xs_OutDoorCheckBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HBillStatus,HRemark,HMaker,HMakeDate" + |
| | | ",HMainSourceBillType,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo" + |
| | | ",HExplanation,HSTOCKORGID" + |
| | | ") " + |
| | | " values('" + oMain.HBillType + "','" + oMain.HBillType + "'," + oMain.HInterID.ToString() + ",'" + oMain.HBillNo + "','" + oMain.HDate.ToShortDateString() + "'" + |
| | | ", " + oMain.HYear.ToString() + "," + oMain.HPeriod.ToString() + ",1,'" + oMain.HRemark + "','" + oMain.HMaker + "',getdate()" + |
| | | ",'" + oMain.HMainSourceBillType + "'," + oMain.HMainSourceInterID.ToString() + "," + oMain.HMainSourceEntryID.ToString() + ",'" + oMain.HMainSourceBillNo + "'" + |
| | | ",'" + oMain.HExplanation + "'," + oMain.HSTOCKORGID.ToString() + |
| | | ") "); |
| | | |
| | | //å®¡æ ¸åæ® |
| | | oCn.RunProc("Update Xs_OutDoorCheckBillMain Set HChecker='" + oMain.HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + oMain.HInterID.ToString()); |
| | | |
| | | oCn.Commit(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "çæå¹¶å®¡æ ¸åºé¨ç¡®è®¤åæåï¼åæ®å·ä¸ºï¼" + oMain.HBillNo; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åºé¨ç¡®è®¤åä¸ä¼ 失败ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region å¤çæ¹æ³ |
| | | |
| | | |
| | |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºé¨ç¡®è®¤åååºåå |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsXs_OutDoorCheckBillMain> getOutDoorCheckBillMainByJson(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsXs_OutDoorCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsXs_OutDoorCheckBillMain>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <Compile Include="Controllers\å质管ç\å·¡æ£å\QC_PatrolProcCheckBillController.cs" /> |
| | | <Compile Include="Controllers\å质管ç\å·¥åºæ£éªå\MES_ProcessCheckBill_PDAController.cs" /> |
| | | <Compile Include="Controllers\å质管ç\è´¨éæ¥è¡¨\QC_QualityReportsController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_CardChangeTypeController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_CardStatusController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_CardAddressController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_CardTypeController.cs" /> |
| | | <Compile Include="Controllers\åºç¡èµæ\åºç¡èµæ\Gy_COMMONCONTACTBillController.cs" /> |