public async Task <string> AddStrategyProposal(StrategyProposal strategyproposal) { string mailSent = ""; string MailSubject = "Strategy Proposal"; string MailBody = ""; strategyproposal.Status = "Created"; if (strategyproposal.Status == "Created") { MailBody = "Project Strategy Proposal is created for <ProjectName>. Please review and approve /suggest."; } int inserstrategyproposal = await StrategyProposalRepository.AddStrategyProposal(strategyproposal); if (inserstrategyproposal > 0) { mailSent = Mail.SendMail(strategyproposal.ProjectId, strategyproposal.Status, MailSubject, MailBody); } return(inserstrategyproposal > 0 ? "Successfully added StrategyProposal" : "Insertion failed"); }
public async Task <string> AddTeaser(Teaser teaser) { string mailSent = ""; string MailSubject = "Teaser"; string MailBody = ""; teaser.Status = "Created"; if (teaser.Status == "Created") { MailBody = "Project Teaser is created for <ProjectName>. Please review and approve /suggest."; } int inserteaser = await TeaserRepository.AddTeaser(teaser); if (inserteaser > 0) { mailSent = Mail.SendMail(teaser.ProjectId, teaser.Status, MailSubject, MailBody); } return(inserteaser > 0 ? "Successfully added Teaser" : "Insertion failed"); }
public async Task <string> UpdateProjectPlan(ProjectPlan projectplans) { string mailSent = ""; string MailSubject = "Project Plan Status"; string MailBody = ""; ProjectPlan projectplan = ProjectPlanRepository.GetProjectPlans().FirstOrDefault(c => c.ProjectPlanID == projectplans.ProjectPlanID); if (projectplan == default(ProjectPlan)) { return("projectplan doen't exist"); } else { projectplan.ProjectPlanStatus = projectplans.ProjectPlanStatus; projectplan.ReopenReason = projectplans.ReopenReason; projectplan.CreatedDate = DateTime.Now; } if (projectplans.ProjectPlanStatus == "Submitted") { MailBody = "Project Plan has been submitted.Kindly approve."; } if (projectplans.ProjectPlanStatus == "Rejected") { MailBody = "Project Plan has been rejected by following reason <br/><br/>" + projectplans.ReopenReason; } if (projectplans.ProjectPlanStatus == "Approved") { MailBody = "Project Plan has been Approved."; } if (projectplans.ProjectPlanStatus == "ReOpened") { MailBody = "Project Plan has been ReOpened by following reason <br/><br/>" + projectplans.ReopenReason; } int updateprojectplan = await ProjectPlanRepository.UpdateProjectPlan(projectplan); if (updateprojectplan > 0) { mailSent = Mail.SendMail(projectplans.ProjectID, projectplans.ProjectPlanStatus, MailSubject, MailBody); } return(updateprojectplan == 0 ? "Successfully updated projectplan and reply record" : "Updation failed"); }