不良原因加 不良类型选项
不良类型编辑页面
不良类型列表
单品过站功能完善
| | |
| | | <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsGy_BarCodeBill_ChaiMa.cs" /> |
| | | <Compile Include="ä»åºç®¡ç\æ¡ç 管ç\ClsKF_BarCodeStatusChangeBill.cs" /> |
| | | <Compile Include="åºç¡èµæ\InterFaceåºç¡èµæ\ClsIF_ORGANIZATIONS_View.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_BadType_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_CustLocation_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_EquipStatus_Ctl.cs" /> |
| | | <Compile Include="åºç¡èµæ\å
¬ç¨åºç¡èµæ\ClsGy_MouldStatus_Ctl.cs" /> |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using System.Data; |
| | | |
| | | namespace DAL |
| | | { |
| | | public class ClsGy_BadType_Ctl : DBUtility.ClsGy_Base_Ctl |
| | | { |
| | | SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); |
| | | //å代ç ç¨äº æ¿æ¢åé¡¹ç® |
| | | public string HOldNumber; |
| | | public Model.ClsGy_BadType_Model oModel = new Model.ClsGy_BadType_Model(); |
| | | //æ°å¢ |
| | | public override bool AddNew() |
| | | { |
| | | |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc("Insert into " + MvarItemKey + " " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HGroupID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HUSEORGID,HCREATEORGID,HUseFlag,HMakeEmp,HMakeTime) " + |
| | | " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + |
| | | "," + oModel.HGroupID.ToString() + |
| | | "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "'," + oModel.HOrgID + "," + oModel.HOrgID + ",'" + oModel.HUseFlag + "','" + oModel.HMakeEmp + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | |
| | | //ä¿®æ¹ |
| | | public override bool ModifyByID(Int64 sItemID) |
| | | { |
| | | try |
| | | { |
| | | oCn.BeginTran(); |
| | | oCn.RunProc("Update " + MvarItemKey + " set " + |
| | | " HNumber='" + oModel.HNumber + "'" + |
| | | ",HName='" + oModel.HName + "'" + |
| | | ",HShortNumber='" + oModel.HShortNumber + "'" + |
| | | ",HHelpCode='" + oModel.HHelpCode + "'" + |
| | | ",HModifyEmp='" + oModel.HMakeEmp + "'" + |
| | | ",HModifyTime='" + DateTime.Now + "'" + |
| | | ",HLevel=" + oModel.HLevel.ToString() + |
| | | ",HGroupID=" + oModel.HGroupID.ToString() + |
| | | ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + |
| | | ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + |
| | | ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹å项ç®ä»£ç |
| | | oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //å°ä¸çº§ ä¸ºéæ«çº§ |
| | | oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | // |
| | | oCn.Commit(); |
| | | return true; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | throw (e); |
| | | } |
| | | } |
| | | //æ ¹æ®ä»£ç å¤æä¿¡æ¯ |
| | | public override bool HavParentCode(string sCode, Int64 sItemID) |
| | | { |
| | | DataSet DS; |
| | | try |
| | | { |
| | | DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo); |
| | | if (DS.Tables[0].Rows.Count == 0) |
| | | return false; |
| | | else |
| | | { |
| | | oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]); |
| | | return true; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | throw (e); |
| | | } |
| | | } |
| | | //æé 彿° |
| | | public ClsGy_BadType_Ctl() |
| | | { |
| | | MvarItemKey = "Gy_BadType"; |
| | | MvarReportTitle = "ä¸è¯ç±»å设置"; |
| | | oModel = new Model.ClsGy_BadType_Model(); |
| | | } |
| | | } |
| | | } |
| | |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_AreaUser_Model.cs"> |
| | | <SubType>Code</SubType> |
| | | </Compile> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_BadType_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_BigArea_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_BusinessUnit_Model.cs" /> |
| | | <Compile Include="åºç¡èµæ\åºç¡èµæ\ClsGy_Carbook_Model.cs" /> |
| | |
| | | public Int64 HDeptID; |
| | | public string HDeptNumber; |
| | | public Int64 HProcID; |
| | | public Int64 HBadTypeID; |
| | | public string HBarCode; |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace Model |
| | | { |
| | | public class ClsGy_BadType_Model : DBUtility.ClsGy_Base_Model |
| | | { |
| | | // |
| | | public Int64 HGroupID; |
| | | public string HDeptNumber; |
| | | public Int64 HProcID; |
| | | public string HBarCode; |
| | | public string HMakeEmp; |
| | | public Int64 HOrgID; |
| | | } |
| | | } |
| | |
| | | { |
| | | List<object> columnNameList = new List<object>(); |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_BadReason", 1, false, user)) |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Query", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_IF_BadReasonList " + sWhere + " order by ä¸è¯åå 代ç ", "h_v_IF_BadReasonList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_IF_BadReasonList where 1 = 1"; |
| | | string sql = sql1 + sWhere + " order by ä¸è¯åå 代ç "; |
| | | ds = oCN.RunProcReturn(sql, "h_v_IF_BadReasonList"); |
| | | } |
| | | string sql1 = "select * from h_v_gy_BadTypeList where 1 = 1"; |
| | | string sql = sql1 + sWhere + " order by ä¸è¯ç±»å代ç "; |
| | | ds = oCN.RunProcReturn(sql, "h_v_gy_BadTypeList"); |
| | | |
| | | //æ·»å åå |
| | | foreach (DataColumn col in ds.Tables[0].Columns) |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "") |
| | | if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "æ£å¸¸") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | |
| | | oCN.RunProc($@"insert into Sc_StationOutBillSub_SN(HInterID,HBillNo_bak,HEntryID,HBarCode,HBarCodeQty,HMakeTime,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney) |
| | | values({omodel.HInterID}, '{omodel.HBillNo}', {ds.Tables[0].Rows.Count + 1}, '{omodel.HBarCode_P}', 1, GETDATE(), '', 0, 0, '', '', 0, 0)"); |
| | | |
| | | //ååå·¥åºåºç«åçåæ ¼æ°é |
| | | oCN.RunProc("update Sc_StationOutBillMain set HQty+=1 where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID); |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | |
| | | return objJsonResult; |
| | | } |
| | | |
| | | if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "") { |
| | | if (ds.Tables[0].Rows[0]["HStatus"].ToString() != "æ£å¸¸") { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å½åæ¡ç ç¶æä¸º"+ ds.Tables[0].Rows[0]["HStatus"].ToString() + "!"; |
| | |
| | | #region å·¥åºååè¿ç« æ¥è¯¢åæ ¼è®°å½ |
| | | [Route("Cj_SingleStation/HGRecordsList")] |
| | | [HttpGet] |
| | | public object HGRecordsList(string HBarCode, string user) |
| | | public object HGRecordsList(string sWhere, string user) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = oCN.RunProcReturn(@"select * from h_v_Sc_AssemblyBillList where HProcExchBillNo='" + HBarCode + "'", "h_v_Sc_AssemblyBillList"); |
| | | ds = oCN.RunProcReturn(@"select * from h_v_Gy_QualifiedRecordsList where 1=1"+ sWhere, "h_v_Gy_QualifiedRecordsList"); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥åºååè¿ç« å é¤ä¸è¯è®°å½ |
| | | [Route("Cj_SingleStation/DelBadRecords")] |
| | | [HttpGet] |
| | | public object DelBadRecords(int HInterID, int HEntryID, string user,int HProcID) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_BadRecordsList where HInterID = " + HInterID, "h_v_Gy_BadRecordsList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥æ æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | string sql = ""; |
| | | sql = "delete from Sc_QualityReportBillMain where HInterID = " + HInterID; |
| | | oCN.RunProc(sql); |
| | | sql = "delete from Sc_QualityReportBillSub where HInterID = " + HInterID + " and HEntryID = " + HEntryID; |
| | | oCN.RunProc(sql); |
| | | string HProcExchInterID = ds.Tables[0].Rows[0]["HProcExchInterID"].ToString(); |
| | | string HProcExchEntryID = ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString(); |
| | | //ååå·¥åºåºç«åçä¸è¯æ°é |
| | | oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1 where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID); |
| | | |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥åºååè¿ç« å é¤åæ ¼è®°å½ |
| | | [Route("Cj_SingleStation/DelQualifiedRecords")] |
| | | [HttpGet] |
| | | public object DelQualifiedRecords(int HInterID, int HEntryID, string user) |
| | | { |
| | | try |
| | | { |
| | | ds = oCN.RunProcReturn("select * from h_v_Gy_QualifiedRecordsList where hmainid = " + HInterID, "h_v_Gy_QualifiedRecordsList"); |
| | | |
| | | if (ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ¥æ æ°æ®ï¼"; |
| | | objJsonResult.data = null; |
| | | } |
| | | |
| | | oCN.BeginTran(); |
| | | |
| | | string sql = ""; |
| | | if (ds.Tables[0].Rows.Count == 1) { |
| | | sql = "delete from Sc_StationOutBillMain where HInterID = " + HInterID; |
| | | oCN.RunProc(sql); |
| | | } |
| | | sql = "delete from Sc_StationOutBillSub_SN where HInterID = " + HInterID + " and HEntryID = " + HEntryID; |
| | | oCN.RunProc(sql); |
| | | string HProcExchInterID = ds.Tables[0].Rows[0]["HProcExchInterID"].ToString(); |
| | | string HProcExchEntryID = ds.Tables[0].Rows[0]["HProcExchEntryID"].ToString(); |
| | | //ååå·¥åºåºç«åçåæ ¼æ°é |
| | | oCN.RunProc("update Sc_StationOutBillMain set HBadCount-=1 where HProcExchInterID='" + HProcExchInterID + "' and HProcExchEntryID=" + HProcExchEntryID); |
| | | |
| | | |
| | | oCN.Commit(); |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | 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; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region å·¥åºååè¿ä¿®å° æ«ç æ¥è¯¢ |
| | | [Route("Cj_SingleStation/HFBardCodeList")] |
| | | [HttpGet] |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿åä¸è¯ç±»å |
| | | /// </summary> |
| | | /// <param name="msg"></param> |
| | | /// <returns></returns> |
| | | [Route("SaveGy_BadType")] |
| | | [HttpPost] |
| | | public object SaveGy_BadType([FromBody] JObject msg) |
| | | { |
| | | DataSet ds; |
| | | var _value = msg["msg"].ToString(); |
| | | string msg3 = _value.ToString(); |
| | | string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg1 = sArray[0].ToString(); |
| | | string msg2 = sArray[1].ToString(); |
| | | |
| | | //æ¥çæé |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Edit", 1, false, msg2)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ ä¿åæéï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | Int64 HItemID = 0; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //è·åæå¤§IDå¼èµå¼ |
| | | DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_BadType ", "Gy_BadType"); |
| | | if (Maxds != null || Maxds.Tables[0].Rows.Count > 0) |
| | | { |
| | | //HItemID= Maxds.Tables[0].Rows[0]["HItemID"] |
| | | var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]); |
| | | maxid += 1; |
| | | HItemID = maxid; |
| | | } |
| | | ListModels oListModels = new ListModels(); |
| | | try |
| | | { |
| | | DAL.ClsGy_BadType_Ctl oBill = new DAL.ClsGy_BadType_Ctl(); |
| | | List<Model.ClsGy_BadType_Model> lsmain = new List<Model.ClsGy_BadType_Model>(); |
| | | msg1 = msg1.Replace("\\", ""); |
| | | msg1 = msg1.Replace("\n", ""); //\n |
| | | lsmain = oListModels.getObjectByJson_Gy_BadType(msg1); |
| | | foreach (Model.ClsGy_BadType_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_BadType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_BadType"); |
| | | if (oItem.HNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç 为空ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //æ°å¢æ¶å¤æ |
| | | if (oItem.HItemID == 0) |
| | | { |
| | | if (ds == null || ds.Tables[0].Rows.Count == 0) |
| | | { |
| | | |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä»£ç éå¤ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | //æ£æ¥ç¶çº§æ¯å¦åå¨ |
| | | string sParent; |
| | | sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); |
| | | if (sParent.Trim() == "") |
| | | { |
| | | oBill.oModel.HParentID = 0; |
| | | } |
| | | else |
| | | { |
| | | if (oBill.HavParentCode(sParent.Trim(), HItemID)) |
| | | { |
| | | oBill.oModel.HParentID = oBill.oModel.HItemID; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | else//ç¼è¾æ¶å¤æ |
| | | { |
| | | //æ£æ¥ç¶çº§æ¯å¦åå¨ |
| | | string sParent; |
| | | sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim()); |
| | | if (sParent.Trim() == "") |
| | | { |
| | | oBill.oModel.HParentID = 0; |
| | | } |
| | | else |
| | | { |
| | | if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID)) |
| | | { |
| | | oBill.oModel.HParentID = oBill.oModel.HItemID; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ä¸çº§ä»£ç ä¸åå¨æè¢«ç¦ç¨ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | } |
| | | //å¾å°ç代ç |
| | | string sShortNumber; |
| | | sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim()); |
| | | if (sShortNumber.Trim() == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼ç代ç 为空ï¼"; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | oItem.HShortNumber = sShortNumber;//ç代ç |
| | | oItem.HEndFlag = true;//æ«çº§æ å¿ |
| | | oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //ç级 |
| | | |
| | | oBill.oModel = oItem; |
| | | } |
| | | |
| | | //ä¿å |
| | | //ä¿å宿¯åå¤ç |
| | | bool bResult; |
| | | if (oBill.oModel.HItemID == 0) |
| | | { |
| | | // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); |
| | | bResult = oBill.AddNew(); |
| | | } |
| | | else |
| | | { |
| | | bResult = oBill.ModifyByID(oBill.oModel.HItemID); |
| | | } |
| | | if (bResult) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "ä¿åæåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + DBUtility.ClsPub.sExeReturnInfo; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "ä¿å失败ï¼" + e.ToString(); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// ä¸è¯ç±»åè·åä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("GetGy_BadTypeDetail")] |
| | | [HttpGet] |
| | | public ApiResult<DataSet> GetGy_BadTypeDetail(string HID) |
| | | { |
| | | var dataSet = oCN.RunProcReturn("select top 1 * from h_v_gy_BadTypeList where HItemID= " + HID + " ", "h_v_gy_BadTypeList"); |
| | | 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 }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸è¯ç±»åå é¤åè½ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("DeltetGy_BadType")] |
| | | [HttpGet] |
| | | public object DeltetGy_BadType(string HItemID, string user) |
| | | { |
| | | DataSet ds; |
| | | //string ModRightNameCheck = "Sc_ProcessReport_check"; |
| | | try |
| | | { |
| | | //å 餿é |
| | | if (!DBUtility.ClsPub.Security_Log("Gy_BadType_Drop", 1, false, user)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "æ å 餿éï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (string.IsNullOrWhiteSpace(HItemID)) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "HItemID为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | oCN.BeginTran();//å¼å§äºå¡ |
| | | ds = oCN.RunProcReturn("select * from Gy_BadType where HItemID=" + HItemID, "Gy_BadType"); |
| | | 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; |
| | | //} |
| | | |
| | | oCN.RunProc("delete Gy_BadType 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; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¸è¯åå è·åä¿¡æ¯ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | oCn.RunProc("Insert into " + MvarItemKey + " " + |
| | | " (HNumber,HName,HHelpCode,HShortNumber,HParentID" + |
| | | ",HDeptID,HProcID" + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark) " + |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HBadTypeID) " + |
| | | " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() + |
| | | "," + oModel.HDeptID.ToString() + "," + oModel.HProcID.ToString() + |
| | | "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "',"+oModel.HBadTypeID + ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCn.Commit(); |
| | |
| | | ",HHelpCode='" + oModel.HHelpCode + "'" + |
| | | ",HLevel=" + oModel.HLevel.ToString() + |
| | | ",HDeptID=" + oModel.HDeptID.ToString() + |
| | | ",HBadTypeID=" + oModel.HBadTypeID.ToString() + |
| | | ",HProcID=" + oModel.HProcID.ToString() + |
| | | ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) + |
| | | ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) + |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢ä¸è¯ç±»å表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |
| | | /// <returns></returns> |
| | | public List<Model.ClsGy_BadType_Model> getObjectByJson_Gy_BadType(string jsonString) |
| | | { |
| | | jsonString = "[" + jsonString.ToString() + "]"; |
| | | List<Model.ClsGy_BadType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_BadType_Model>>(jsonString); |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å¤çæ°å¢æ
éåå 表çjson |
| | | /// </summary> |
| | | /// <param name="jsonString"></param> |