Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ExecDeleteCatalog(long? passUserID, long? passCatalogID, out byte? status)
- {
- string connStr = System.Configuration.ConfigurationManager.ConnectionStrings[ParametersDb.ConnectionStringName].ConnectionString;
- using (SqlConnection conn = new SqlConnection(connStr))
- {
- using (SqlCommand command = new SqlCommand("P_DeleteCatalog", conn))
- {
- SqlParameter ReturnValue = new SqlParameter(ParametersDb.ParamReturnValue, SqlDbType.Int, 4);
- ReturnValue.Direction = ParameterDirection.ReturnValue;
- command.Parameters.Add(ReturnValue);
- command.Parameters.Add(new SqlParameter("@PassUserID", passUserID));
- command.Parameters.Add(new SqlParameter("@PassCatalogID", passCatalogID));
- SqlParameter Status = new SqlParameter("@Status", SqlDbType.TinyInt, 1);
- Status.Direction = ParameterDirection.Output;
- command.Parameters.Add(Status);
- command.CommandType = CommandType.StoredProcedure;
- conn.Open();
- command.ExecuteNonQuery();
- int? func_ret = UtilDal.ToIntN(ReturnValue.Value);
- if (func_ret != null && func_ret != 0)
- {
- throw new SpNonZeroReturnException(func_ret.Value, "P_DeleteCatalog", command.Parameters);
- }
- status = UtilDal.ToByteN(Status.Value);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement