| | |
| | | m = dr.RowToDynamic(); |
| | | m.list1 = dset.Tables[1].TableToDynamicList(); |
| | | m.list2 = dset.Tables[2].TableToDynamicList(); |
| | | m.list3 = dset.Tables[3].TableToDynamicList(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, |
| | | "读取成功!"); |
| | | } |
| | | |
| | | /* /// <summary> |
| | | /// 删除条码 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [RequestMethod(RequestMethods.POST)] |
| | | public ReturnDto<int?> DeleteBarcode([FromBody] dynamic model) |
| | | { |
| | | int? rtnInt = (int)ReturnCode.Default; |
| | | string guidList = model.guidList; |
| | | string aboutType = model.aboutType; |
| | | string aboutGuid = model.aboutGuid; |
| | | var _outMsg = ""; |
| | | var _outSum = -1; |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand("[prc_barcode_del]", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 300), |
| | | new("@outSum", SqlDbType.Int), |
| | | new("@inOrderGuid", aboutGuid), |
| | | new("@inEdtUserGuid", _userGuid), |
| | | new("@guidList", guidList), |
| | | new("@aboutType", aboutType) |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | cmd.ExecuteNonQuery(); |
| | | _outMsg = parameters[0].Value.ToString(); |
| | | _outSum = int.Parse(parameters[1].Value.ToString()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), |
| | | "prc_barcode_del error:" + ex.Message); |
| | | _outMsg = ex.Message; |
| | | _outSum = -1; |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (_outSum <= 0) |
| | | return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Exception, |
| | | _outMsg); |
| | | return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg); |
| | | } |
| | | */ |
| | | /// <summary> |
| | | |
| | | |
| | | /// <summary> |
| | | /// 删除条码 |
| | |
| | | string aboutGuid = model.aboutGuid; |
| | | var _outMsg = ""; |
| | | var _outSum = -1; |
| | | |
| | | // 判断aboutGuid是否为有效的uniqueidentifier |
| | | bool is_validGuid = Guid.TryParse(aboutGuid, out _); |
| | | // 根据验证结果选择对应的存储过程 |
| | | string storedProcedureName = is_validGuid ? "[prc_barcode_del]" : "[prc_barcode_del_hb]"; |
| | | |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand(storedProcedureName, conn)) |
| | | using (var cmd = new SqlCommand("[prc_barcode_del]", conn)) |
| | | { |
| | | try |
| | | { |
| | |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 300), |
| | | new("@outSum", SqlDbType.Int), |
| | | new("@inOrderGuid", aboutGuid), |
| | | new("@inEdtUserGuid", _userGuid), |
| | | new("@guidList", guidList), |
| | | new("@aboutType", aboutType) |
| | | }; |
| | | new("@outMsg", SqlDbType.NVarChar, 300), |
| | | new("@outSum", SqlDbType.Int), |
| | | new("@inOrderGuid", aboutGuid), |
| | | new("@inEdtUserGuid", _userGuid), |
| | | new("@guidList", guidList), |
| | | new("@aboutType", aboutType) |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | foreach (var parameter in parameters) |
| | |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), |
| | | $"{storedProcedureName} error:{ex.Message}"); |
| | | "prc_barcode_del error:" + ex.Message); |
| | | _outMsg = ex.Message; |
| | | _outSum = -1; |
| | | } |
| | |
| | | return ReturnDto<int>.QuickReturn(rtnInt, ReturnCode.Success, _outMsg); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 选择条码 |
| | | /// </summary> |
| | |
| | | string keyWhere = model.keyWhere; |
| | | string aboutGuid = model.aboutGuid; |
| | | string aboutType = model.aboutType; |
| | | string qcGuid = model.qcGuid; |
| | | var dset = new DataSet(); |
| | | try |
| | | { |
| | |
| | | new("@inSortOrder", ""), |
| | | new("@inQueryWhere", keyWhere), |
| | | new("@inP1", aboutGuid), |
| | | new("@inP2", aboutType) |
| | | new("@inP2", aboutType), |
| | | new("@inP3", qcGuid) |
| | | }; |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | |
| | | return ReturnDto<PageList<dynamic>>.QuickReturn(_pglist, |
| | | ReturnCode.Success, "读取成功"); |
| | | } |
| | | |
| | | } |