using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; /// /// Project class /// public class Project { public Project() { // // TODO: Add constructor logic here // } public static string CreateNewPP(string projectTitle, string coeNumber, int? eventCategoryID, string projectDescription, string projectNotes, string createdBy, string modifiedBy, int? primaryBoardPortfolioID, string boardPortfolioName, string keyPartners, int? primaryTargetSegmentID, string secondaryTargetSegments, Int16? expectedNumParcipants, DateTime? startDate, string startDateForEmail, DateTime? startTime, string startTimeForEmail, DateTime? endDate, DateTime? endTime, string endTimeForEmail, int? jkID, int? ppStatusID, string ppStatus, bool sendEmailNotif) { string successFailureMsg = ""; string sendEmailResult = ""; //clean up the input if (eventCategoryID == 0) { eventCategoryID = null; } if (projectDescription == "") { projectDescription = null; } if (projectNotes == "") { projectNotes = null; } if (keyPartners == "") { keyPartners = null; } if (secondaryTargetSegments == "") { secondaryTargetSegments = null; } if (expectedNumParcipants == 0) { expectedNumParcipants = null; } if (jkID == 0) { jkID = null; } dsProjectTableAdapters.QueriesTableAdapter queryAdapter = new dsProjectTableAdapters.QueriesTableAdapter(); try { //call method to insert project details queryAdapter.InsertUpdateCOEData(projectTitle, ref coeNumber, eventCategoryID, projectDescription, projectNotes, createdBy, modifiedBy, primaryBoardPortfolioID, keyPartners, primaryTargetSegmentID, secondaryTargetSegments, expectedNumParcipants, startDate, startTime, endDate, endTime, jkID, ppStatusID); // send email notification if (sendEmailNotif == true) { sendEmailResult = PPSNotification.SendNewPPCreatedEmail(coeNumber, projectTitle, startDateForEmail, startTimeForEmail, endTimeForEmail, boardPortfolioName, (int)primaryBoardPortfolioID, "", ppStatus, ""); } successFailureMsg = "PP " + coeNumber + " created. Access PP under '" + boardPortfolioName + "' node at left."; } catch(Exception ex) { successFailureMsg = "ERROR: PP " + coeNumber + " not created for " + boardPortfolioName + "

" + ex.Message; } return successFailureMsg + " - " + sendEmailResult; } }