| | |
| | | m = dr.RowToDynamic(); |
| | | var _tb = dset.Tables[1].TableToDynamicList(); |
| | | m.list = _tb; |
| | | var _tb2 = dset.Tables[2].TableToDynamicList(); |
| | | m.list2 = _tb2; |
| | | //var _tb2 = dset.Tables[2].TableToDynamicList(); |
| | | //m.list2 = _tb2; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "操作成功!"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除主表或明细 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [RequestMethod(RequestMethods.POST)] |
| | | public ReturnDto<int?> DeleteModelOrMx([FromBody] dynamic model) |
| | | { |
| | | int? rtnInt = (int)ReturnCode.Default; |
| | | Guid? guid = model.guid; |
| | | string mxGuid = model.mxGuid; |
| | | var _outMsg = ""; |
| | | var _outSum = -1; |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand("[prc_ww_gd_del]", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 300), |
| | | new("@outSum", SqlDbType.Int), |
| | | new("@inOrderGuid", |
| | | UtilityHelper.CheckGuid(guid) |
| | | ? guid |
| | | : DBNull.Value), |
| | | new("@inEdtUserGuid", _userGuid), |
| | | new("@inMxGuid", mxGuid) |
| | | }; |
| | | 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_ww_gd_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); |
| | | } |
| | | |
| | | } |