| | |
| | | var dset = new DataSet(); |
| | | try |
| | | { |
| | | dset = DbHelperSQL.RunProcedure("[prc_item_tbl_mx]", parameters,"0"); |
| | | dset = DbHelperSQL.RunProcedure("[prc_item_tbl_mx]", parameters, "0"); |
| | | if (dset != null && dset.Tables.Count > 0 && |
| | | dset.Tables[0].Rows.Count > 0) |
| | | { |
| | |
| | | string yy = model.yy; //原因 |
| | | string inDaaGuid = model.inDaaGuid;//工单 |
| | | string inOrgId = model.inOrgId;//组织 |
| | | string _chkOut = model.chkOut; |
| | | var _sb = new StringBuilder(); |
| | | var _split = "|"; |
| | | foreach (var m in model.list) |
| | |
| | | new("@inYy", yy), |
| | | new("@inDaaGuid", inDaaGuid), |
| | | new("@inOrgId", inOrgId), |
| | | new("@chkOut", _chkOut), |
| | | new("@inEdtUserGuid", _userGuid), |
| | | new("@inLineList", _sb.ToString()) |
| | | }; |
| | |
| | | { |
| | | string _guid = mode.guid; |
| | | string _inFieldValue = mode.inFieldValue; |
| | | string _chkOut=mode.chkOut; |
| | | string _proName = "prc_item_tbl_submit"; |
| | | dynamic m = new ExpandoObject(); |
| | | m.outSum = -1; |
| | |
| | | new("@inEdtUserGuid", _userGuid), |
| | | new("@inOrderGuid", _guid), |
| | | new("@inFieldValue", _inFieldValue), |
| | | new("@in1", _chkOut), |
| | | new("@in1", ""), |
| | | new("@in2", "") |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | |
| | | cmd.ExecuteNonQuery(); |
| | | m.outMsg = parameters[0].Value.ToString(); |
| | | m.outSum = int.Parse(parameters[1].Value.ToString()); |
| | | #region 自动处成补料单据 |
| | | if (m.outSum > 0) |
| | | { |
| | | autoBld(_guid); |
| | | } |
| | | #endregion |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | } |
| | | return ReturnDto<dynamic>.QuickReturn(m, ReturnCode.Success, "操作成功!"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 自动生成补料单据 |
| | | /// </summary> |
| | | /// <param name="_tblGuid">退补料guid</param> |
| | | private void autoBld(string _tblGuid) |
| | | { |
| | | dynamic m = new ExpandoObject(); |
| | | m.outSum = -1; |
| | | m.outMsg = ""; |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | using (var cmd = new SqlCommand("prc_item_tbl_submit_autoBld", conn)) |
| | | { |
| | | try |
| | | { |
| | | conn.Open(); |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 2500), |
| | | new("@outSum", SqlDbType.Int), |
| | | new("@inEdtUserGuid", _userGuid), |
| | | new("@inOrderGuid", _tblGuid), |
| | | new("@inFieldValue", "1"), |
| | | new("@in1", ""), |
| | | new("@in2", "") |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | | parameters[1].Direction = ParameterDirection.Output; |
| | | foreach (var parameter in parameters) |
| | | cmd.Parameters.Add(parameter); |
| | | cmd.ExecuteNonQuery(); |
| | | m.outMsg = parameters[0].Value.ToString(); |
| | | m.outSum = int.Parse(parameters[1].Value.ToString()); |
| | | LogHelper.Debug(ToString(), "prc_item_tbl_submit_autoBld error:outSum:" + m.outSum + ",outMsg:" + m.outMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Debug(ToString(), "prc_item_tbl_submit_autoBld error:"+ _tblGuid+":" + ex.Message); |
| | | m.outMsg = ex.Message; |
| | | } |
| | | finally |
| | | { |
| | | conn.Close(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |