예제 #1
0
        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>: &nbsp;&nbsp</td><td>" + row["code"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Gate Pass Owner</strong></td><td>: &nbsp;&nbsp</td><td>" + row["Requestor"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Department</strong></td><td>: &nbsp;&nbsp</td><td>" + row["Department"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Return Date</strong></td><td>: &nbsp;&nbsp</td><td>" + row["ReturnDate"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Purpose</strong></td><td>: &nbsp;&nbsp</td><td>" + row["Purpose"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Supplier Name</strong></td><td>: &nbsp;&nbsp</td><td>" + row["SupplierName"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Remarks</strong></td><td>: &nbsp;&nbsp</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'>&nbsp;&nbsp;&nbsp;&nbsp;</p>";

            return(str);
        } // End
예제 #2
0
        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>: &nbsp;&nbsp</td><td>" + row["code"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Gate Pass Owner</strong></td><td>: &nbsp;&nbsp</td><td>" + row["Requestor"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Department</strong></td><td>: &nbsp;&nbsp</td><td>" + row["Department"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Return Date</strong></td><td>: &nbsp;&nbsp</td><td>" + row["ReturnDate"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Purpose</strong></td><td>: &nbsp;&nbsp</td><td>" + row["Purpose"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Supplier Name</strong></td><td>: &nbsp;&nbsp</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 += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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'>&nbsp;&nbsp;&nbsp;&nbsp;<strong>Note :</strong> Use Google Chrome browser for better display.</p>";

            SendEmailSpecialCase(email, str, requestor, emialLabelApprover);
        } // End
예제 #3
0
        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>: &nbsp;&nbsp</td><td>" + name + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Override Reason</strong></td><td>: &nbsp;&nbsp</td><td>" + remarks + "</td></tr>";
                str += "<tr><td style='width:15%'><strong></strong></td><td>&nbsp;&nbsp</td><td></td></tr>";
                str += "<tr><td style='width:15%'><strong>Gate Pass ID</strong></td><td>: &nbsp;&nbsp</td><td>" + row["code"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Gate Pass Owner</strong></td><td>: &nbsp;&nbsp</td><td>" + row["Requestor"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Department</strong></td><td>: &nbsp;&nbsp</td><td>" + row["Department"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Return Date</strong></td><td>: &nbsp;&nbsp</td><td>" + row["ReturnDate"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Purpose</strong></td><td>: &nbsp;&nbsp</td><td>" + row["Purpose"] + "</td></tr>";
                str += "<tr><td style='width:15%'><strong>Supplier Name</strong></td><td>: &nbsp;&nbsp</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);
        }