protected void gv_PurchaseOrder_RowDeleting(object sender, GridViewDeleteEventArgs e) { // =========== Sending Email ============= string to, from, subject, body; to = "*****@*****.**"; from = "*****@*****.**"; subject = "[Auto Generated Email] Order Cancelled"; body = "Dear customer, we regret to inform you that your order has not been successful. Please contact FixTech support team for clarifications. Thank you."; MailMessage message = new MailMessage(from, to, subject, body); message.IsBodyHtml = true; SmtpClient client = new SmtpClient("smtp.gmail.com", 587); client.EnableSsl = true; client.Credentials = new System.Net.NetworkCredential("*****@*****.**", "votechvotech"); client.Send(message); // =========== Delete ============= int selectedRow = e.RowIndex; int PO_ID = (int)gv_PurchaseOrder.DataKeys[selectedRow].Value; BindGridView(); obj.deletePurchaseOrder(PO_ID); Response.Redirect("PurchaseOrder.aspx"); }
protected void gv_PurchaseOrder_RowDeleting(object sender, GridViewDeleteEventArgs e) { // =========== Delete ============= //Update the status process rejected int selectedRow = e.RowIndex; int PO_ID = (int)gv_PurchaseOrder.DataKeys[selectedRow].Value; BindGridView(); obj.deletePurchaseOrder(PO_ID); Response.Redirect("PurchaseOrder.aspx"); }