public string EmailContentReturnSlip(string headercode, string remarks) { string str = "<table style='font-family:Arial; font-size:12px;width:95%' align='center'>"; DataTable dtTransheader = transModel.GetGatepassByCode(headercode); foreach (DataRow row in dtTransheader.Rows) { str += "<tr><td style='width:15%'><strong>Gate Pass ID</strong></td><td>:  </td><td>" + row["code"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Gate Pass Owner</strong></td><td>:  </td><td>" + row["Requestor"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Department</strong></td><td>:  </td><td>" + row["Department"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Return Date</strong></td><td>:  </td><td>" + row["ReturnDate"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Purpose</strong></td><td>:  </td><td>" + row["Purpose"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Supplier Name</strong></td><td>:  </td><td>" + row["SupplierName"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Remarks</strong></td><td>:  </td><td>" + remarks + "</td></tr>"; } str += "</table>"; str += "<br/>"; DataTable dtTransDetails = transModel.GetGatepassDetailsByCode(headercode); str += "<style>table, th, td {border: 1px solid black;border-collapse:collapse;}</style>"; str += "<table style='width:95%; font-family:Arial;font-size:12px' align='center'>"; str += "<tr style='background-color:#12AFCB; color:white;font-weight:bold;height:25px'><td>To be Return</td><td>Returned Qty</td><td>Total Qty</td><td style='width:30%'>Item Name</td><td>Serial Number</td><td>Tag Number</td><td>PO Number</td><td>Unit of Measure</td><td style='width:15%'>Status</td></tr>"; foreach (DataRow row in dtTransDetails.Rows) { double quantitywithoutzero = double.Parse(row["Quantity"].ToString().Split(separator: new char[] { ',' })[0]); double quantityReturnedwithoutzero = double.Parse(row["QtyReturned"].ToString().Split(separator: new char[] { ',' })[0]); double tobereturn = quantitywithoutzero - quantityReturnedwithoutzero; string itemStatus; if (quantitywithoutzero > quantityReturnedwithoutzero && quantityReturnedwithoutzero != 0) { itemStatus = "Partially Returned"; } else if (quantityReturnedwithoutzero == 0) { itemStatus = "Not Return"; } else { itemStatus = "Returned"; } str += "<tr><td>" + tobereturn + "</td><td>" + quantityReturnedwithoutzero + "</td><td>" + quantitywithoutzero + "</td><td>" + row["ItemName"] + "</td><td>" + row["SerialNbr"] + "</td><td>" + row["TagNbr"] + "</td><td>" + row["PONbr"] + "</td><td>" + row["UOMName"] + "</td><td>" + itemStatus + "</td></ tr >"; } str += "</table>"; str += "<br/>"; str += "<br/>"; str += "<p style='font-size:12px'> </p>"; return(str); } // End
public void ApprovalEmailContent(string headercode, string approverCode, string email, string emialLabelApprover) { string str = "<table style='font-family:Arial; font-size:12px;width:95%' align='center'>"; DataTable dtTransheader = transModel.GetGatepassByCode(headercode); string requestor = overrideModels.GetRequestor(headercode); foreach (DataRow row in dtTransheader.Rows) { str += "<tr><td style='width:15%'><strong>Gate Pass ID</strong></td><td>:  </td><td>" + row["code"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Gate Pass Owner</strong></td><td>:  </td><td>" + row["Requestor"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Department</strong></td><td>:  </td><td>" + row["Department"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Return Date</strong></td><td>:  </td><td>" + row["ReturnDate"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Purpose</strong></td><td>:  </td><td>" + row["Purpose"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Supplier Name</strong></td><td>:  </td><td>" + row["SupplierName"] + "</td></tr>"; } str += "</table>"; str += "<br/>"; DataTable dtTransDetails = transModel.GetGatepassDetailsByCode(headercode); str += "<style>table, th, td {border: 1px solid black;border-collapse:collapse;}</style>"; str += "<table style='width:95%; font-family:Arial;font-size:12px' align='center'>"; str += "<tr style='background-color:#12AFCB; color:white;font-weight:bold;height:25px'><td>Quantity</td><td style='width:30%'>Item Name</td><td>Serial Number</td><td>Tag Number</td><td>PO Number</td><td>Unit of Measure</td><td>Item Type</td></tr>"; foreach (DataRow row in dtTransDetails.Rows) { double quantitywithoutzero = double.Parse(row["Quantity"].ToString().Split(separator: new char[] { ',' })[0]); str += "<tr><td>" + quantitywithoutzero + "</td><td>" + row["ItemName"] + "</td><td>" + row["SerialNbr"] + "</td><td>" + row["TagNbr"] + "</td><td>" + row["PONbr"] + "</td><td>" + row["UOMName"] + "</td><td>" + row["ItemTypeName"] + "</td></ tr >"; } str += "</table>"; str += "<br/>"; str += " <a href='" + ConfigurationManager.AppSettings["link_into_email"].ToString() + headercode + "&approverCode=" + approverCode + "'>Click here to approve/reject the request</a>"; str += "<br/>"; str += "<p style='font-size:12px;font-family:Arial'> <strong>Note :</strong> Use Google Chrome browser for better display.</p>"; SendEmailSpecialCase(email, str, requestor, emialLabelApprover); } // End
public void EmailContent(string headercode, string approvalType, string distinguisher) { string str = "<table style='font-family:Arial; font-size:12px;width:95%' align='center'>"; DataTable dtTransheader = trans_model.GetGatepassByCode(headercode); string remarks = overrideModels.GetRemarks(headercode, approvalType); string name = overrideModels.GetName(Session["userId_local"].ToString()); DataTable approverEmail; if (distinguisher == "approve") { approverEmail = overrideModels.GetApproverEmails(headercode, approvalType); } else { approverEmail = overrideModels.GetApproverEmailsReject(headercode, approvalType); } string requestor = overrideModels.GetRequestor(headercode); List <string> Email = new List <string>(); foreach (DataRow row in approverEmail.Rows) { Email.Add(row["Email"].ToString()); } foreach (DataRow row in dtTransheader.Rows) { str += "<tr><td style='width:15%'><strong>Overridden By</strong></td><td>:  </td><td>" + name + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Override Reason</strong></td><td>:  </td><td>" + remarks + "</td></tr>"; str += "<tr><td style='width:15%'><strong></strong></td><td>  </td><td></td></tr>"; str += "<tr><td style='width:15%'><strong>Gate Pass ID</strong></td><td>:  </td><td>" + row["code"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Gate Pass Owner</strong></td><td>:  </td><td>" + row["Requestor"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Department</strong></td><td>:  </td><td>" + row["Department"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Return Date</strong></td><td>:  </td><td>" + row["ReturnDate"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Purpose</strong></td><td>:  </td><td>" + row["Purpose"] + "</td></tr>"; str += "<tr><td style='width:15%'><strong>Supplier Name</strong></td><td>:  </td><td>" + row["SupplierName"] + "</td></tr>"; } str += "</table>"; str += "<br/>"; DataTable dtTransDetails = trans_model.GetGatepassDetailsByCode(headercode); str += "<style>table, th, td {border: 1px solid black;border-collapse:collapse;}</style>"; str += "<table style='width:95%; font-family:Arial;font-size:12px' align='center'>"; str += "<tr style='background-color:#12AFCB; color:white;font-weight:bold;height:25px'><td>Quantity</td><td style='width:30%'>Item Name</td><td>Serial Number</td><td>Tag Number</td><td>PO Number</td><td>Unit of Measure</td><td>Item Type</td></tr>"; foreach (DataRow row in dtTransDetails.Rows) { double quantitywithoutzero = double.Parse(row["Quantity"].ToString().Split(separator: new char[] { ',' })[0]); str += "<tr><td>" + quantitywithoutzero + "</td><td>" + row["ItemName"] + "</td><td>" + row["SerialNbr"] + "</td><td>" + row["TagNbr"] + "</td><td>" + row["PONbr"] + "</td><td>" + row["UOMName"] + "</td><td>" + row["ItemTypeName"] + "</td></ tr >"; } str += "</table>"; str += "<br/>"; str += "<br/>"; str += "<br/>"; SendEmail(str, Email, requestor, distinguisher); }