private string AddDocument(SqlCommand command, WorkFlowDocument.DocumentTypes type) { command.Parameters.Clear(); command.CommandType = CommandType.StoredProcedure; command.CommandText = "wfCreateDocument"; command.Parameters.Add("@wfId", this.wfId); command.Parameters.Add("@DocId", (int)type); command.Parameters.Add("@CreatedById", this.userId); command.Parameters.Add("@ActionDocId", SqlDbType.Int).Direction = ParameterDirection.Output; try { command.ExecuteNonQuery(); return(string.Empty); } catch (SqlException exception) { return(exception.Message); } catch (Exception exception2) { return(exception2.Message); } }
public string AddDocuments(SqlCommand command) { this.docList.Sort(); string str = string.Empty; foreach (object obj2 in this.docList) { try { WorkFlowDocument.DocumentTypes type = (WorkFlowDocument.DocumentTypes)obj2; str = this.AddDocument(command, type); if (!str.Equals(string.Empty)) { return(str); } continue; } catch (Exception) { throw new Exception("Wrong Doc ID."); } } return(string.Empty); }