protected void btnSubmitActionRemarks_Click(object sender, EventArgs e) { try { PPRDataBL obj = new PPRDataBL(); DataTable dt = new DataTable(); int success; obj = new PPRDataBL(); success = obj.ApprovePprBL("Reject", ViewState["ActionRemarksId"].ToString(), txtActionRemarks.Text, Session["UserId"].ToString()); //success = obj.InsertNotificationBL(Session["LoginId"].ToString(), "PPR Id:-" + ViewState["ActionRemarksId"].ToString() + " has Been Reject by Nodal Officer ", ViewState["ActionRemarksId"].ToString(), "RejectPpr"); SaveNotification(Session["LoginId"] != null ? Session["LoginId"].ToString() : "0", ViewState["ActionRemarksId"].ToString() + " has Been Reject by Nodal Officer ,", GetUserID(ViewState["ActionRemarksId"].ToString()), ViewState["ActionRemarksId"].ToString(), "2", "~/Authenticate/LinMin/Default.aspx.aspx", "~/Authenticate/LinMin/PprApprovalRequest.aspx", "0"); DisplayPPRDetailsApprovalRequest(); dt = obj.GetEmailOfSelectPprIdBL(ViewState["ActionRemarksId"].ToString()); if (dt.Rows.Count > 0) { string ActionRemarksPprIdEmail = dt.Rows[0]["N_Email"].ToString(); MailUtility objm = new MailUtility(); objm.SendActionRemarksMailReject(ViewState["ActionRemarksId"].ToString(), ViewState["ProjectName"].ToString(), ActionRemarksPprIdEmail, txtActionRemarks.Text); obj = new PPRDataBL(); } if (success > 0) { Alert.show("Ppr has been successfully Rejected!"); } DisplayPPRDetailsApprovalRequest(); txtActionRemarks.Text = ""; } catch (Exception ex) { LogError(ex); } }
protected void PPRDetailsGridView_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Approve") { //Determine the RowIndex of the Row whose Button was clicked. //int PprId = Convert.ToInt32(e.CommandArgument); string temp = e.CommandArgument.ToString(); string[] tokens = temp.Split('_'); string PprId = HttpUtility.HtmlEncode(tokens[0]); string ProjectName = HttpUtility.HtmlEncode(tokens[1]); try { PPRDataBL obj = new PPRDataBL(); DataTable dt = new DataTable(); int success; obj = new PPRDataBL(); success = obj.ApprovePprBL("Approve", PprId.ToString(), "", Session["UserId"].ToString()); SaveNotification(Session["LoginId"] != null ? Session["LoginId"].ToString() : "0", PprId + " has Been Successfully Approved by Nodal Officer ,", GetUserID(PprId), PprId, "2", "~/Authenticate/LinMin/Default.aspx.aspx", "~/Authenticate/LinMin/PprApprovalRequest.aspx", "0"); //success = obj.InsertNotificationBL(Session["LoginId"].ToString(),"PPR Id:-" + PprId + " has Been Successfully Approved by Nodal Officer ",PprId, "ApprovePpr"); DisplayPPRDetailsApprovalRequest(); dt = obj.GetEmailOfSelectPprIdBL(PprId.ToString()); if (dt.Rows.Count > 0) { string ActionRemarksPprIdEmail = dt.Rows[0]["N_Email"].ToString(); MailUtility objm = new MailUtility(); objm.SendActionRemarksMailForApprove(PprId.ToString(), ProjectName, ActionRemarksPprIdEmail); obj = new PPRDataBL(); } if (success > 0) { Alert.ShowWithRedirect("PPR has been successfully Approved!, now you need to mark this PPR to Line Ministries/Departments", "PPMRemark.aspx?PPR=" + PprId.ToString()); } DisplayPPRDetailsApprovalRequest(); DisplayApprovedPPRDetails(); DisplayRejectPPRDetails(); } catch (Exception ex) { LogError(ex); } } if (e.CommandName == "Reject") { try { //Determine the RowIndex of the Row whose Button was clicked. string temp = e.CommandArgument.ToString(); string[] tokens = temp.Split('_'); ViewState["ActionRemarksId"] = HttpUtility.HtmlEncode(tokens[0]); ViewState["ProjectName"] = HttpUtility.HtmlEncode(tokens[1]); ModalPopupExtenderForRemarks.Show(); } catch (Exception ex) { LogError(ex); } } if (e.CommandName == "ProposalPreview") { ViewState["PPRId"] = e.CommandArgument.ToString(); PPRDataBL obj = new PPRDataBL(); DataTable dt = new DataTable(); dt = obj.GetFinalPprDocDataBL(HttpUtility.HtmlEncode(ViewState["PPRId"].ToString())); if (dt.Rows.Count > 0) { if (dt.Rows[0]["RelevantDocumentOne"].ToString() == null || dt.Rows[0]["RelevantDocumentOne"].ToString() == "" || dt.Rows[0]["RelevantDocumentOne"].ToString() == "N") { Label9.Text = "File Not available"; btnRelevantDocumentTwo.Visible = false; RD2.Visible = false; } else { btnRelevantDocumentTwo.CommandArgument = dt.Rows[0]["RelevantDocumentOne"].ToString(); btnRelevantDocumentTwo.Visible = true; } if (dt.Rows[0]["RelevantDocumentTwo"].ToString() == null || dt.Rows[0]["RelevantDocumentTwo"].ToString() == "" || dt.Rows[0]["RelevantDocumentTwo"].ToString() == "N") { Label10.Text = "File Not available"; btnRelevantDocumentThree.Visible = false; RD3.Visible = false; } else { btnRelevantDocumentThree.CommandArgument = dt.Rows[0]["RelevantDocumentTwo"].ToString(); btnRelevantDocumentThree.Visible = true; } if (dt.Rows[0]["TechnicalDocument"].ToString() == null || dt.Rows[0]["TechnicalDocument"].ToString() == "" || dt.Rows[0]["TechnicalDocument"].ToString() == "N") { Label2.Text = "File Not available"; lnkTechnicalDocument.Visible = false; Sd.Visible = false; } else { lnkTechnicalDocument.CommandArgument = dt.Rows[0]["TechnicalDocument"].ToString(); lblpd.Text = ""; lnkTechnicalDocument.Visible = true; } if (dt.Rows[0]["DebtSustCert"].ToString() == "NA") { lnkpd.Visible = false; lblpd.Text = "File Not available"; } else { lnkpd.CommandArgument = dt.Rows[0]["DebtSustCert"].ToString(); lblpd.Text = ""; lnkpd.Visible = true; } if (dt.Rows[0]["PrevPhase"].ToString() == "NA") { lnkPPD.Visible = false; lblPPD.Text = "File Not available"; PP.Visible = false; } else { lnkPPD.CommandArgument = dt.Rows[0]["PrevPhase"].ToString(); lblPPD.Text = ""; lnkPPD.Visible = true; } if (dt.Rows[0]["StaClearance"].ToString() == "NA") { lnkSc.Visible = false; lblSc.Text = "File Not available"; } else { lnkSc.Visible = true; lblSc.Text = ""; lnkSc.CommandArgument = dt.Rows[0]["StaClearance"].ToString(); } if (dt.Rows[0]["RevisedPpr"].ToString() == "RP") { RPpr.Visible = true; } else { RPpr.Visible = false; } if (dt.Rows[0]["DefermentPpr"].ToString() == "DP") { DPpr.Visible = true; } else { DPpr.Visible = false; } } ModalPopupExtender1.Show(); //ProposalPreview(); //pramod } }