| | |
| | | } |
| | | #endregion |
| | | |
| | | #region [å®¢æ·æ ç¾ä¿¡æ¯å é¤åè½] |
| | | [Route("Sc_CustomerTagInfo/Delete")] |
| | | [HttpGet] |
| | | public object Delete(string HItemSubIDs, string user) |
| | | { |
| | | try |
| | | { |
| | | DataSet Ds; |
| | | DataSet Ds2; |
| | | |
| | | if (HItemSubIDs == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-009]éæ©å®¢æ·æ ç¾ä¿¡æ¯ä¸ºç©ºï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | Ds = oCN.RunProcReturn("Select * from h_v_Sc_CustomerTagInfoList with(nolock) Where HItemSubID in (" + HItemSubIDs + ")", "h_v_Sc_CustomerTagInfoList"); |
| | | if (Ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | |
| | | //å é¤å®¢æ·æ ç¾ä¿¡æ¯--å表 |
| | | oCN.RunProc("Delete from Sc_CustomerTagInfoSub Where HItemSubID in (" + HItemSubIDs + ")"); |
| | | |
| | | //åå
¥ç³»ç»æ¥å¿ |
| | | for (int i = 0; i < Ds.Tables[0].Rows.Count; i++) |
| | | { |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','','" + "Sc_CustomerTagInfoListââDelete" + "','LMES-å®¢æ·æ ç¾ä¿¡æ¯æ¨¡å','" + DBUtility.ClsPub.IPAddress + "','" + user + "å é¤å®¢æ·æ ç¾ä¿¡æ¯," + "客æ·åç§°ï¼" + Ds.Tables[0].Rows[i]["客æ·åç§°"] + ",ç©æä»£ç ï¼" + Ds.Tables[0].Rows[i]["ç©æä»£ç "] + ",åæ®å·ï¼" + Ds.Tables[0].Rows[i]["åæ®å·"] + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "[0000-1-008]å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-045]åæ®æªæ¾å°"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-007]" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å®¢æ·æ ç¾æ¡£æ¡çæ |
| | | [Route("Sc_CustomerTagBarCode/Save")] |
| | | [HttpGet] |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region å®¢æ·æ ç¾æ¡ç æ¥è¯¢-å页 |
| | | [Route("Sc_CustomerTagBarCode/BarPageList")] |
| | | [HttpGet] |
| | | public object BarPageList(string sWhere, string user, string Organization, int page, int size) |
| | | { |
| | | try |
| | | { |
| | | List<object> columnNameList = new List<object>(); //å®ä¹å£°æåé ï¼æéè¿ new List<object>()å建ç å®ä¾ï¼èµå¼ç»åé |
| | | |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_CustomerTagBarCodeList " + page + "," + size + ",'" + Organization + "'," + "''", "h_p_Sc_CustomerTagBarCodeList"); |
| | | } |
| | | else |
| | | { |
| | | sWhere = sWhere.Replace("'", "''"); |
| | | ds = oCN.RunProcReturn("exec h_p_Sc_CustomerTagBarCodeList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_Sc_CustomerTagBarCodeList"); |
| | | } |
| | | |
| | | //æ·»å åå |
| | | 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 = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.list = columnNameList; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "Exceptionï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region [å®¢æ·æ ç¾æ¡ç å é¤åè½] |
| | | [Route("Sc_CustomerTagBarCode/DeleteBarCode")] |
| | | [HttpGet] |
| | | public object DeleteBarCode(string HItemIDs,string user) |
| | | { |
| | | try |
| | | { |
| | | DataSet Ds; |
| | | |
| | | if (HItemIDs == "") |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-009]éæ©æ¡ç 为空ï¼"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | |
| | | |
| | | Ds = oCN.RunProcReturn("Select * from h_v_Sc_CustomerTagBarCodeList with(nolock) Where HItemID in (" + HItemIDs + ")", "h_v_Sc_CustomerTagBarCodeList"); |
| | | if (Ds.Tables[0].Rows.Count != 0) |
| | | { |
| | | oCN.BeginTran(); |
| | | |
| | | //å é¤å®¢æ·æ ç¾æ¡ç |
| | | oCN.RunProc("Delete from Sc_CustomerTagBarCode Where HItemID in (" + HItemIDs + ")"); |
| | | |
| | | //åå
¥ç³»ç»æ¥å¿ |
| | | for (int i = 0; i < Ds.Tables[0].Rows.Count; i++) |
| | | { |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','','" + "Sc_CustomerTagBarCodeListââDelete" + "','LMES-å®¢æ·æ ç¾æ¡ç 模å','" + DBUtility.ClsPub.IPAddress + "','" + user + "å é¤å®¢æ·æ ç¾æ¡ç ," + "ç产订åï¼" + Ds.Tables[0].Rows[i]["ç产订åå·"] + ",ç©æä»£ç ï¼" + Ds.Tables[0].Rows[i]["ç©æä»£ç "] + ",æµæ°´å·ï¼" + Ds.Tables[0].Rows[i]["æµæ°´å·"] + "'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "[0000-1-008]å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-045]åæ®æªæ¾å°"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "[0000-1-007]" + e.Message; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | } |
| | | } |