protected void SendEmailToApprovar(int fbmid, int requesterid, int approvarid) { int crewfbmidout = 0; BLL_Infra_UserCredentials ojbInfra = new BLL_Infra_UserCredentials(); DataTable dtapprovalDetails = ojbInfra.Get_UserDetails(approvarid); DataTable dtRequesterDetails = ojbInfra.Get_UserDetails(requesterid); DataSet ds = BLL_FBM_Report.FBMReportList(Convert.ToInt32(fbmid)); StringBuilder sbEmailbody = new StringBuilder(); string subject = "Pending for Approval - FBM Number :" + ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString(); string path = System.Configuration.ConfigurationManager.AppSettings["APP_URL"].ToString() + "/QMS/FBM/FBM_Main_Report_Details.aspx?FBMREQUESTID=" + ds.Tables[0].Rows[0]["ID"].ToString() + "&APPROVARID=" + approvarid + "&REQUESTERID=" + requesterid; sbEmailbody.Append("Dear "); sbEmailbody.Append(dtapprovalDetails.Rows[0]["First_Name"].ToString() + ","); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("FBM Number :" + ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString() + " is Pending for your Approval, Click on below link to approve it."); sbEmailbody.Append("<a href=" + path + ">" + path + "</a>"); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("Best Regards,"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtRequesterDetails.Rows[0]["User_name"].ToString().ToUpper() + " " + dtRequesterDetails.Rows[0]["Last_Name"].ToString().ToUpper()); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtRequesterDetails.Rows[0]["Designation"].ToString()); sbEmailbody.AppendLine(Convert.ToString(Session["Company_Address_GL"])); sbEmailbody.AppendLine("<br>"); int val = BLL_FBM_Report.FBMCrewMailSave(Convert.ToInt32(Session["userid"].ToString()), subject, dtapprovalDetails.Rows[0]["MailID"].ToString(), "", sbEmailbody.ToString(), ref crewfbmidout); }
protected void SendEmailForRework(int fbmid, int requesterid, int approverid) { int crewfbmidout = 0; BLL_Infra_UserCredentials ojbInfra = new BLL_Infra_UserCredentials(); DataTable dtRequesterDetails = ojbInfra.Get_UserDetails(requesterid); DataTable dtapprovalDetails = ojbInfra.Get_UserDetails(approverid); DataSet ds = BLL_FBM_Report.FBMReportList(Convert.ToInt32(fbmid)); StringBuilder sbEmailbody = new StringBuilder(); string subject = "Rework - FBM Number :" + ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString(); sbEmailbody.Append("Dear "); sbEmailbody.Append(dtRequesterDetails.Rows[0]["First_Name"].ToString() + ","); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("The FBM Number :" + ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString() + " is sending for Rework."); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("Best Regards,"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtapprovalDetails.Rows[0]["User_name"].ToString().ToUpper() + " " + dtapprovalDetails.Rows[0]["Last_Name"].ToString().ToUpper()); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(dtapprovalDetails.Rows[0]["Designation"].ToString()); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine(Convert.ToString(Session["Company_Address_GL"])); sbEmailbody.AppendLine("<br>"); int val = BLL_FBM_Report.FBMCrewMailSave(Convert.ToInt32(Session["userid"].ToString()), subject, dtRequesterDetails.Rows[0]["MailID"].ToString(), "", sbEmailbody.ToString(), ref crewfbmidout); }
protected void SendEmail(int fbmid) { string ToMail = ""; int crewfbmidout = 0; if (optForUser.SelectedValue == "COMPANY") //company { ToMail = ConfigurationManager.AppSettings["FBM_TO_COMPANY_EMAIL"].ToString(); } else if (optForUser.SelectedValue == "OFFICE") //office { ToMail = ConfigurationManager.AppSettings["FBM_TO_OFFICE_EMAIL"].ToString(); } else if (optForUser.SelectedValue == "SHIP") // ship email { ToMail = ConfigurationManager.AppSettings["FBM_TO_OFFICE_EMAIL"].ToString(); } // if there is a Attachment is associated with FBM Then Send an Email to IT Department. DataTable dtAttachments = BLL_FBM_Report.FBMAttachmentSearch(fbmid); DataSet ds = BLL_FBM_Report.FBMReportList(Convert.ToInt32(fbmid)); // Check the attachment if (dtAttachments.Rows.Count > 0) { // IF USER TYPE IS SHIP THEN EMAI SHOULD GO TO IT DEPT FOR REDUCING THE FILE. if (ds.Tables[0].Rows[0]["FOR_USER"].ToString().ToUpper() == "SHIP") { StringBuilder sbEmailbody = new StringBuilder(); string subject = "FBM Number :" + ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString(); string path = System.Configuration.ConfigurationManager.AppSettings["APP_URL"].ToString() + @"\uploads\FBM\\"; sbEmailbody.Append("Dear IT,"); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("A FBM has been sent with one or more attachments to it."); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("Arrange to reduce the size of the attachment/s listed below:"); sbEmailbody.AppendLine("<br><br>"); foreach (DataRow dr in dtAttachments.Rows) { sbEmailbody.Append(dr["FILEPATH"].ToString()); sbEmailbody.AppendLine("<br>"); } sbEmailbody.Append("This file is located in folder: <a href=" + path + ">" + path + "</a>"); //sbEmailbody.Append("<a href=" + path + ">" + path + "</a>"); sbEmailbody.AppendLine("<br><br>"); sbEmailbody.AppendLine("Best Regards,"); sbEmailbody.AppendLine("<br>"); sbEmailbody.AppendLine("Jibe AutoMessenger"); if (ds.Tables[0].Rows.Count > 0) { subject = ds.Tables[0].Rows[0]["FBM_NUMBER"].ToString(); } int val = BLL_FBM_Report.FBMCrewMailSave(Convert.ToInt32(Session["userid"].ToString()), subject, ToMail, "", sbEmailbody.ToString(), ref crewfbmidout); } //IF USER TYPE IS COMPANY OR OFFICE THEN NO ACTION AS PER SATVINDER SIR. else { //string filepathSave = @"\\server01\uploads\FBM\"; //int val = BLL_FBM_Report.FBMCrewMailSave(Convert.ToInt32(Session["userid"].ToString()), txtSubject.Text, ToMail, "", txtMailBody.Text, ref crewfbmidout); //foreach (DataRow dr in dtAttachments.Rows) //{ // BLL_FBM_Report.FBMCrewAttachmentSave(Convert.ToInt32(Session["userid"].ToString()), crewfbmidout, dr[2].ToString(), filepathSave + dr[2].ToString()); //} } } }