Ejemplo n.º 1
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtSetFirstInstallment.Text) && !string.IsNullOrEmpty(txtSetSecondInstallment.Text))
         {
             double firstInstallment  = Convert.ToDouble(txtSetFirstInstallment.Text);
             double secondInstallment = Convert.ToDouble(txtSetSecondInstallment.Text);
             if (firstInstallment <= 100.00 && secondInstallment <= 100.00)
             {
                 ManageInstallmentBAL.Instance.UpdateInstallments(Convert.ToInt32(ddlTigerReserve.SelectedValue), firstInstallment, secondInstallment);
                 string strSuccess = "Installments has been updated successfully.";
                 vmSuccess.Message = strSuccess;
                 FlashMessage.InfoMessage(vmSuccess.Message);
                 UserBAL.Instance.InsertAuditTrailDetail("Updated Installment Ratio", "Manage Installment");
             }
             else
             {
                 string strError = "First installment should be greater than or equal to 000.00 and less than or equal to 100.00 !";
                 vmError.Message = strError;
                 FlashMessage.ErrorMessage(vmError.Message);
                 return;
             }
         }
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         //return;
     }
 }
Ejemplo n.º 2
0
 protected void imgbtnPdf_click(object sender, EventArgs e)
 {
     try
     {
         ImageButton ibtn     = sender as ImageButton;
         GridViewRow gvrow    = ibtn.NamingContainer as GridViewRow;
         string      fileName = cgvDocuments.DataKeys[gvrow.RowIndex].Value.ToString();
         string      filePath = "~/Downloads/" + fileName;
         Response.ContentType = "doc/pdf";
         Response.AddHeader("Content-Disposition", "attachment;filename=\"" + filePath + "\"");
         if (System.IO.File.Exists(Server.MapPath(filePath)))
         {
             Response.TransmitFile(Server.MapPath(filePath));
         }
         else
         {
             ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "File Error", "alert('File does not exists');", true);
         }
         Response.End();
     }
     catch (FileNotFoundException ex)
     {
         string strInvalid = ex.Message;
         vmError.Message = strInvalid;
         FlashMessage.ErrorMessage(vmError.Message);
         return;
     }
 }
Ejemplo n.º 3
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (GridViewRow row in gvUtilizationCertificate.Rows)
                {
                    FileUpload fuUpload = (FileUpload)row.FindControl("fuUpload");

                    if (fuUpload.HasFile)
                    {
                        string fileName = Path.GetFileName(fuUpload.PostedFile.FileName);
                        fuUpload.PostedFile.SaveAs(Server.MapPath("~/Upload/ApoDocuments/") + fileName);
                        string uploadedFile = fuUpload.FileName;
                        string strError     = ConfigurationManager.AppSettings["FinalUc"];
                        vmError.Message = strError;
                        FlashMessage.ErrorMessage(vmError.Message);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
                Response.RedirectPermanent("~/ErrorPage.aspx", false);
            }
        }
        protected void cgvCentralStateShare_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                Label   lblAPOFileId            = cgvCentralStateShare.Rows[e.RowIndex].FindControl("lblAPOFileId") as Label;
                int     apoFileId               = Convert.ToInt32(lblAPOFileId.Text);
                TextBox txtFirstReleasedAmount  = cgvCentralStateShare.Rows[e.RowIndex].FindControl("txtFirstReleasedAmount") as TextBox;
                TextBox txtSecondReleasedAmount = cgvCentralStateShare.Rows[e.RowIndex].FindControl("txtSecondReleasedAmount") as TextBox;
                string  firstReleasedAmount     = txtFirstReleasedAmount.Text;
                string  secondReleasedAmount    = txtSecondReleasedAmount.Text;
                DesignationBAL.Instance.UpdateDesignation(apoFileId, firstReleasedAmount);

                cgvCentralStateShare.EditIndex = -1;
                GetCentralStateShare();

                string strSuccess = "Data updated successfully.";
                vmSuccess.Message = strSuccess;
                FlashMessage.ErrorMessage(vmSuccess.Message);
            }
            catch (Exception ex)
            {
                LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
                Response.RedirectPermanent("~/ErrorPage.aspx", false);
                //string strError = ex.Message;
                //vmError.Message = strError;
                //FlashMessage.ErrorMessage(vmError.Message);
                //return;
            }
        }
Ejemplo n.º 5
0
        protected void cgvManageGuidelines_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                Label   lblId = cgvManageGuidelines.Rows[e.RowIndex].FindControl("lblId") as Label;
                int     Id    = Convert.ToInt32(lblId.Text);
                TextBox txtCSSPTParaNumber = cgvManageGuidelines.Rows[e.RowIndex].FindControl("txtCSSPTParaNumber") as TextBox;
                TextBox txtCSSPTGuideline  = cgvManageGuidelines.Rows[e.RowIndex].FindControl("txtCSSPTGuideline") as TextBox;
                string  cssPTParaNumber    = txtCSSPTParaNumber.Text;
                string  cssPTGuideline     = txtCSSPTGuideline.Text;
                ManageGuidelineBAL.Instance.UpdateGuideline(Id, cssPTParaNumber, cssPTGuideline);

                cgvManageGuidelines.EditIndex = -1;
                GetGuidelineList();

                string strSuccess = "Data updated successfully.";
                vmSuccess.Message = strSuccess;
                FlashMessage.ErrorMessage(vmSuccess.Message);
                UserBAL.Instance.InsertAuditTrailDetail("Modified CSS-PT Guideline", "Manage CSS-PT Guidelines");
            }
            catch (Exception ex)
            {
                LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
                Response.RedirectPermanent("~/ErrorPage.aspx", false);
                //string strError = ex.Message;
                //vmError.Message = strError;
                //FlashMessage.ErrorMessage(vmError.Message);
                //return;
            }
        }
Ejemplo n.º 6
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtCSSPTParaNumber.Text) && !string.IsNullOrEmpty(txtCSSPTGuidelines.Text))
         {
             ManageGuidelineBAL.Instance.AddGuideline(txtCSSPTParaNumber.Text, txtCSSPTGuidelines.Text);
             GetGuidelineList();
             string strSuccess = "Data saved successfully.";
             vmSuccess.Message = strSuccess;
             FlashMessage.ErrorMessage(vmSuccess.Message);
             txtCSSPTParaNumber.Text = string.Empty;
             txtCSSPTGuidelines.Text = string.Empty;
             UserBAL.Instance.InsertAuditTrailDetail("Added CSS-PT Guideline", "Manage CSS-PT Guideline");
         }
         else
         {
             string strError = "Please Enter the CSSPTParaNumber and CSSPT Guideline.";
             vmError.Message = strError;
             FlashMessage.ErrorMessage(vmError.Message);
             return;
         }
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         //return;
     }
 }
Ejemplo n.º 7
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (ddlObligationFor.SelectedIndex != 0)
         {
             ObligationMasterBAL.Instance.AddObligation(Convert.ToInt32(ddlObligationFor.SelectedValue), txtObligation.Text);
             GetObligationList();
             string strSuccess = "Data saved successfully.";
             vmSuccess.Message = strSuccess;
             FlashMessage.ErrorMessage(vmSuccess.Message);
             txtObligation.Text             = string.Empty;
             ddlObligationFor.SelectedIndex = 0;
             UserBAL.Instance.InsertAuditTrailDetail("Created New Obligation", "Manage Obligation");
         }
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         //return;
     }
 }
Ejemplo n.º 8
0
        protected void cgvManageFDObligation_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                Label   Obligation    = cgvManageFDObligation.Rows[e.RowIndex].FindControl("lblObligationId") as Label;
                int     obligationId  = Convert.ToInt32(Obligation.Text);
                TextBox txtObligation = cgvManageFDObligation.Rows[e.RowIndex].FindControl("txtObligation") as TextBox;
                string  strObligation = txtObligation.Text;
                ObligationMasterBAL.Instance.UpdateObligation(obligationId, strObligation);

                cgvManageFDObligation.EditIndex = -1;
                GetObligationList();
                UserBAL.Instance.InsertAuditTrailDetail("Updated Obligation", "Manage Obligation");
                string strSuccess = "Data updated successfully.";
                vmSuccess.Message = strSuccess;
                FlashMessage.ErrorMessage(vmSuccess.Message);
            }
            catch (Exception ex)
            {
                LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
                Response.RedirectPermanent("~/ErrorPage.aspx", false);
                //string strError = ex.Message;
                //vmError.Message = strError;
                //FlashMessage.ErrorMessage(vmError.Message);
                //return;
            }
        }
Ejemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             BindGrid();
             if (Session["UserId"] != null && Convert.ToString(Session["Updatebtn"]) == "1")
             {
                 string strSuccess = "User has been updated successfully.";
                 vmSuccess.Message = strSuccess;
                 FlashMessage.ErrorMessage(vmSuccess.Message);
                 Session.Remove("Updatebtn");
             }
             UserBAL.Instance.InsertAuditTrailDetail("Visited User List Page", "Manage User");
         }
         catch (Exception ex)
         {
             LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
             Response.RedirectPermanent("~/ErrorPage.aspx", false);
             //string strError = ex.Message;
             //vmError.Message = strError;
             //FlashMessage.ErrorMessage(vmError.Message);
             //return;
         }
     }
 }
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         int tigerReserveId           = Convert.ToInt32(ddlTigerReserve.SelectedValue);
         int centralNonRecurringRatio = Convert.ToInt32(txtCentralNonRecurringRatio.Text);
         int centralRecurringRatio    = Convert.ToInt32(txtCentralRecurringRatio.Text);
         int stateNonRecurringRatio   = Convert.ToInt32(txtStateNonRecurringRatio.Text);
         int stateRecurringRatio      = Convert.ToInt32(txtStateRecurringRatio.Text);
         if (centralNonRecurringRatio <= 100 && centralRecurringRatio <= 100)
         {
             ManageNonRecurringRecurringRatioBAL.Instance.UpdateRecuringAndNonReecurringRatio(tigerReserveId, centralNonRecurringRatio, centralRecurringRatio, stateNonRecurringRatio, stateRecurringRatio);
             string strSuccess = "Non-Recurring and Recurring ratio updated successfully.";
             vmSuccess.Message = strSuccess;
             FlashMessage.InfoMessage(vmSuccess.Message);
         }
         else
         {
             string strError = "Non-Recurring ratio should be less than or equal to 100 !";
             vmError.Message = strError;
             FlashMessage.ErrorMessage(vmError.Message);
             return;
         }
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         //return;
     }
 }
Ejemplo n.º 11
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (!ValidateEmail(txtEmail.Text))
            {
                return;
            }
            if (!ValidateCaptcha())
            {
                return;
            }
            User user = new User();

            UserId = Convert.ToInt32(Session["UserId"]);
            if (UserId != 0)
            {
                UpdateUser(user, UserId);
                string strSuccess = "User has been updated successfully.";
                vmSuccess.Message = strSuccess;
                FlashMessage.ErrorMessage(vmSuccess.Message);
                //oNotySender.SendUserRegisterNotifications(user.UserName);
                UserBAL.Instance.InsertAuditTrailDetail("Updated User details", "Manage User");
            }
            else
            {
                CreateUser(user);
                string strSuccess = "User has been registered successfully.";
                vmSuccess.Message = strSuccess;
                FlashMessage.ErrorMessage(vmSuccess.Message);
                oNotySender.SendUserRegisterNotifications(txtUsername.Text);
                Clear();
                UserBAL.Instance.InsertAuditTrailDetail("Created New User", "Manage User");
            }
        }
 protected void btnSecondRelease_Click(object sender, EventArgs e)
 {
     try
     {
         if (Session["centralStateShare"] != null)
         {
             centralStateShare = (CentralStateShare)Session["centralStateShare"];
             CentralStateShareBAL.Instance.UpdateStateSecondReleasedAmount(centralStateShare);
             string strSuccess = "Second installment of state share has been released successfully.";
             vmSuccess.Message = strSuccess;
             FlashMessage.ErrorMessage(vmSuccess.Message);
             Session["centralStateShare"] = null;
             GetCentralStateShare();
             IFDdiv.Style.Add("display", "none");
             FistInstallmentDiv.Style.Add("display", "none");
             SecondInstallmentDiv.Style.Add("display", "none");
             UserBAL.Instance.InsertAuditTrailDetail("Released Second Installment of State Share", "Monitoring Central-State Share");
         }
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         //return;
     }
 }
Ejemplo n.º 13
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtDesignation.Text))
         {
             DesignationBAL.Instance.AddDesignation(txtDesignation.Text);
             GetDesignationList();
             string strSuccess = "Data saved successfully.";
             vmSuccess.Message = strSuccess;
             FlashMessage.ErrorMessage(vmSuccess.Message);
             txtDesignation.Text = string.Empty;
             UserBAL.Instance.InsertAuditTrailDetail("Created New Designation", "Manage Designation");
         }
         else
         {
             string strError = "Please Enter the Designation.";
             vmError.Message = strError;
             FlashMessage.ErrorMessage(vmError.Message);
             return;
         }
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         //return;
     }
 }
Ejemplo n.º 14
0
        private void GetUcDetails(int tigerReserveId, string previousYFinancialYear)
        {
            DataSet dsUc = UtilizationCertificateBAL.Instance.GetUtilizationCertificateDetails(tigerReserveId, previousYFinancialYear);

            if (dsUc.Tables[0].Rows.Count > 0)
            {
                gvUtilizationCertificate.DataSource = dsUc;
                gvUtilizationCertificate.DataBind();
                DataRow dr = dsUc.Tables[0].Rows[0];
                uCertificate.SanctionAmount = Convert.ToDouble(dr["SanctionAmount"]);
                if (!string.IsNullOrEmpty(dr["SpentAmount"].ToString()))
                {
                    uCertificate.UCAmount = Convert.ToDouble(dr["SpentAmount"]);
                }
                else
                {
                    uCertificate.UCAmount = 0.0;
                }
                if (!string.IsNullOrEmpty(dr["UnspentAmount"].ToString()))
                {
                    uCertificate.UnSpendAmount = Convert.ToDouble(dr["UnspentAmount"]);
                }
                else
                {
                    uCertificate.UnSpendAmount = 0.0;
                }
                //if (uCertificate.SanctionAmount > uCertificate.UCAmount)
                //{
                //    SettledUcDiv.Attributes.Add("Style", "display:block");
                //}
                if (!string.IsNullOrEmpty(dr["FirstCentralRelease"].ToString()))
                {
                    uCertificate.FreshRelease = Convert.ToDouble(dr["FirstCentralRelease"]);
                }
                else
                {
                    uCertificate.FreshRelease = 0.0;
                }
                if (!string.IsNullOrEmpty(dr["SecondCentralRelease"].ToString()))
                {
                    uCertificate.SecondRelease = Convert.ToDouble(dr["SecondCentralRelease"]);
                }
                else
                {
                    uCertificate.SecondRelease = 0.0;
                }
                if (uCertificate.FreshRelease + uCertificate.SecondRelease > uCertificate.UCAmount)
                {
                    SettledUcDiv.Attributes.Add("Style", "display:block");
                }
            }
            else
            {
                string strError = "Oops!! there's no data to generate utilization certificate.";
                vmError.Message = strError;
                FlashMessage.ErrorMessage(vmError.Message);
                return;
            }
        }
Ejemplo n.º 15
0
        protected void btnApprove_Click(object sender, EventArgs e)
        {
            try
            {
                string reginalOfficerDiaryNo = string.Empty;
                if (ApoTitle.InnerText != "" && txtComments.Text != "")
                {
                    DataSet dsRODiaryNum = APOBAL.Instance.GetRegionalOfficerDiaryNumber(Convert.ToInt32(Session["APOFileId"]));
                    if (dsRODiaryNum.Tables[0].Rows.Count > 0)
                    {
                        DataRow dr = dsRODiaryNum.Tables[0].Rows[0];
                        if (dr[0] != DBNull.Value)
                        {
                            if (!string.IsNullOrEmpty(dr[0].ToString()))
                            {
                                reginalOfficerDiaryNo = dr["RegionalOfficerDiaryNumner"].ToString();
                                APOBAL.Instance.UpdateStatus(Convert.ToInt32(Session["APOFileId"]), 11, true, txtComments.Text, reginalOfficerDiaryNo, null);
                                string strSuccess = "APO status has been updated successfully.";
                                vmSuccess.Message = strSuccess;
                                FlashMessage.InfoMessage(vmSuccess.Message);
                                Session["apoFileId"] = null;
                            }
                            else
                            {
                                string strError = "Regional Officer has not taken any action against this APO, please alert him / her.";
                                vmError.Message = strError;
                                FlashMessage.ErrorMessage(vmError.Message);
                                return;
                            }
                        }
                        else
                        {
                            string strError = "Regional Officer has not taken any action against this APO, please alert him / her.";
                            vmError.Message = strError;
                            FlashMessage.ErrorMessage(vmError.Message);
                            return;
                        }
                    }
                }

                else
                {
                    string strError = "Please provide remarks / comments before taking action.";
                    vmError.Message = strError;
                    FlashMessage.ErrorMessage(vmError.Message);
                    return;
                }
            }
            catch (Exception ex)
            {
                LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
                Response.RedirectPermanent("~/ErrorPage.aspx", false);
                //string strError = ex.Message;
                //vmError.Message = strError;
                //FlashMessage.ErrorMessage(vmError.Message);
                //return;
            }
        }
Ejemplo n.º 16
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            User user = new User();

            if (Convert.ToInt32(Session["UserId"]) != 0)
            {
                UpdateUserProfile(user, Convert.ToInt32(Session["UserId"]));
                string strSuccess = "User has been updated successfully.";
                vmSuccess.Message = strSuccess;
                FlashMessage.ErrorMessage(vmSuccess.Message);
                UserBAL.Instance.InsertAuditTrailDetail("Updated Edit Profile ", "Edit Profile");
            }
        }
Ejemplo n.º 17
0
 protected void btnGenerateUC_Click(object sender, EventArgs e)
 {
     if (!IsUnspentAmountSettled(uCertificate.TigerReserveId))
     {
         SettledUcDiv.Attributes.Add("style", "display:block");
         string strError = ConfigurationManager.AppSettings["UnspentAmountNotSettled"];
         vmError.Message = strError;
         FlashMessage.ErrorMessage(vmError.Message);
         return;
     }
     GetUcDetails(uCertificate.TigerReserveId, previousFinancialYear);
     UserBAL.Instance.InsertAuditTrailDetail("Generated Utilization Certificate", "UtilizationCertificate");
 }
Ejemplo n.º 18
0
        protected void cgvDueAdditionalApo_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "VIEWAPO")
            {
                LinkButton lnkView = (LinkButton)e.CommandSource;
                string     APOID   = lnkView.CommandArgument;
                Response.Redirect("~/NTCA-RO/ViewAPO.aspx?Id=" + APOID + "", false);
            }

            switch (e.CommandName)
            {
            case "UpdateStatus":
                LinkButton  lnkView                 = (LinkButton)e.CommandSource;
                GridViewRow row                     = (GridViewRow)(((Control)e.CommandSource).NamingContainer);
                Label       lblIsFDObligation       = (Label)row.FindControl("lblIsFDObligation");
                Label       lblUnspentAmountSettled = (Label)row.FindControl("lblUnspentAmountSettled");
                string      APOFileId               = lnkView.CommandArgument;
                //Session["APOFileId"] = APOFileId;
                if (lblIsFDObligation.Text == "False")
                {
                    string strError = "Additonal Apo can't forwarded to CWLW, Field Director has not submitted Obligation Under Tri-MOU";
                    vmError.Message = strError;
                    FlashMessage.ErrorMessage(vmError.Message);
                    return;
                }
                if (lblUnspentAmountSettled.Text == "False")
                {
                    string strError = "Additional Apo can't forwarded to CWLW, Field Director has not settled previous year unspent amount.";
                    vmError.Message = strError;
                    FlashMessage.ErrorMessage(vmError.Message);
                    return;
                }
                int    i          = APOBAL.Instance.AdditionalAPOMoveToCWLW(Convert.ToInt32(APOFileId));
                string strSuccess = "Additional APO Forwarded to CWLW successfully.";
                vmSuccess.Message = strSuccess;
                FlashMessage.ErrorMessage(vmSuccess.Message);
                GetApoDueForSubmission();
                //if (i ==  -1)
                //{
                //    string strSuccess = "Additional APO Forwarded to CWLW successfully.";
                //    vmSuccess.Message = strSuccess;
                //    FlashMessage.ErrorMessage(vmSuccess.Message);
                //    GetApoDueForSubmission();
                //}
                //else
                //{
                //    Response.RedirectPermanent("~/ErrorPage.aspx",true);
                //}
                break;
            }
        }
Ejemplo n.º 19
0
        private bool CheckApoStatusBeforeAnyAction()
        {
            bool    IsAuthorized     = false;
            string  LoggedInUser     = AuthoProvider.User;
            string  loggedInUserRole = string.Empty;
            int     statusId         = 0;
            DataSet dsUserRole       = APOBAL.Instance.GetLoggedUserRole(LoggedInUser);

            if (dsUserRole != null)
            {
                DataRow dr = dsUserRole.Tables[0].Rows[0];
                loggedInUserRole = dr["RoleName"].ToString();
            }
            if (Session["APOFileId"] != null)
            {
                int     apoFileId       = Convert.ToInt32(Session["APOFileId"]);
                DataSet dsCurrentStatus = APOBAL.Instance.GetCurrentAPOStatus(apoFileId);
                if (dsCurrentStatus != null && dsCurrentStatus.Tables[0].Rows.Count > 0)
                {
                    DataRow dr = dsCurrentStatus.Tables[0].Rows[0];
                    statusId = Convert.ToInt32(dr["StatusId"]);
                }
            }
            if ((loggedInUserRole == "FIELDDIRECTOR" && statusId == 1) || (loggedInUserRole == "FIELDDIRECTOR" && statusId == 3))
            {
                IsAuthorized = true;
            }
            else if (loggedInUserRole == "CWLW" && statusId == 10)
            {
                IsAuthorized = true;
            }
            else if (loggedInUserRole == "REGIONALOFFICER" && (statusId == 13 || statusId == 16))
            {
                IsAuthorized = true;
            }
            else if (loggedInUserRole.Equals("NTCA"))
            {
                IsAuthorized = true;
            }
            else
            {
                string strError = ConfigurationManager.AppSettings["CheckApoStatus"];
                vmError.Message = strError;
                FlashMessage.ErrorMessage(vmError.Message);
                IsAuthorized = false;
            }
            return(IsAuthorized);
        }
Ejemplo n.º 20
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         foreach (GridViewRow row in cgvFDCheckList.Rows)
         {
             RequiredFieldValidator rfv = (RequiredFieldValidator)row.FindControl("RequiredFieldValidator1");
             rfv.Enabled = true;
         }
         if (!IsFinalUcOrProvisionalUcExist(Convert.ToInt32(Session["APOFileId"])))
         {
             string strError = ConfigurationManager.AppSettings["UploadProvisionalUc"];
             vmError.Message = strError;
             return;
         }
         if (!CheckApoStatusBeforeAnyAction())
         {
             return;
         }
         if (cgvFDCheckList.Rows.Count > 0)
         {
             SubmitCheckList(cgvFDCheckList);
             string strSuccess = "Checklist saved successfully.";
             vmSuccess.Message = strSuccess;
             FlashMessage.InfoMessage(vmSuccess.Message);
             UserBAL.Instance.InsertAuditTrailDetail("Saved Checklist", "APO");
             LoadCheckListDraftData(cgvFDCheckList);
         }
         else
         {
             string strError = ConfigurationManager.AppSettings["EmptyChecklist"];
             vmError.Message = strError;
             FlashMessage.ErrorMessage(vmError.Message);
             return;
         }
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         //return;
     }
 }
Ejemplo n.º 21
0
 /// <summary>
 /// Method For sending Default Password through e-mail
 /// </summary>
 protected void SendMail(string userName, string defaultPassword)
 {
     try
     {
         string strMailBody = BuildFormat();
         if (!string.IsNullOrEmpty(strMailBody))
         {
             string strMailForm    = ConfigurationManager.AppSettings["MailFrom"].ToString();
             string strEmail       = txtEmail.Text.Trim().ToString();
             string strMailSubject = ConfigurationManager.AppSettings["MailSubjectForDefaultPwd"].ToString();
             strMailBody = strMailBody.Replace("{0}", userName);
             strMailBody = strMailBody.Replace("{1}", userName);
             strMailBody = strMailBody.Replace("{2}", defaultPassword);
             MailMessage oMailMessage = new MailMessage(strMailForm, strEmail, strMailSubject, strMailBody);
             if (defaultPassword != null)
             {
                 if (MailManager.SendMail(oMailMessage))
                 {
                     string strSuccess = "The password has been sent to your email ID. Please check your Inbox.";
                     vmSuccess.Message = strSuccess;
                     FlashMessage.ErrorMessage(vmError.Message);
                 }
                 else
                 {
                     string strFailed = MailManager.ErrorMessage;
                     vmError.Message = strFailed;
                     FlashMessage.ErrorMessage(vmError.Message);
                 }
             }
             else
             {
                 string strInvalid = "Password can not be sent to this email-id.";
                 vmError.Message = strInvalid;
                 FlashMessage.ErrorMessage(vmError.Message);
             }
         }
     }
     catch (Exception ex)
     {
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
     }
 }
Ejemplo n.º 22
0
        protected void btnFirstRelease_Click(object sender, EventArgs e)
        {
            try
            {
                if (!IsFinalUCSubmitted(Convert.ToInt32(ddlApoTitle.SelectedValue)))
                {
                    return;
                }
                if (Session["centralStateShare"] != null)
                {
                    centralStateShare = (CentralStateShare)Session["centralStateShare"];
                    centralStateShare.IFDDiaryNumber = txtIfdDiaryNumber.Text;
                    if (!string.IsNullOrEmpty(txtIfdDate.Text))
                    {
                        centralStateShare.IFDDate = Convert.ToDateTime(txtIfdDate.Text);
                    }
                    else
                    {
                        centralStateShare.IFDDate = DateTime.Now;
                    }
                    CentralStateShareBAL.Instance.UpdateCentralFirstReleasedAmount(centralStateShare);
                    string strSuccess = "First installment of central share has been released successfully.";
                    vmSuccess.Message = strSuccess;
                    FlashMessage.ErrorMessage(vmSuccess.Message);
                    Session["centralStateShare"] = null;
                    GetCentralStateShare();
                    IFDdiv.Style.Add("display", "none");
                    FistInstallmentDiv.Style.Add("display", "none");
                    SecondInstallmentDiv.Style.Add("display", "block");

                    UserBAL.Instance.InsertAuditTrailDetail("Released First Installment of Central Share", "Monitoring Central-State Share");
                }
            }
            catch (Exception ex)
            {
                string strError = ex.Message;
                vmError.Message = strError;
                FlashMessage.ErrorMessage(vmError.Message);
                return;
            }
        }
        protected void txtCentralNonRecurringRatio_TextChanged(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtCentralNonRecurringRatio.Text))
            {
                int tempNonRecurring;
                if (int.TryParse(txtCentralNonRecurringRatio.Text, out tempNonRecurring))
                {
                    if (tempNonRecurring >= 0 && tempNonRecurring <= 100)
                    {
                        int centralNonRecurringRatio = tempNonRecurring;
                        txtStateNonRecurringRatio.Text = Convert.ToString(100 - centralNonRecurringRatio);
                    }
                    else
                    {
                        string strError = "Central non-recurring ratio should be greater than or equal to '0' OR less than or equal to '100' !";
                        vmError.Message = strError;
                        FlashMessage.ErrorMessage(vmError.Message);
                        return;
                    }
                }
                else
                {
                    string strError = "Entered text is not a number, please enter numeric value and try again !";
                    vmError.Message = strError;
                    FlashMessage.ErrorMessage(vmError.Message);
                    return;
                }
            }

            else
            {
                string strError = "Please enter the central non-recurring ratio !";
                vmError.Message                = strError;
                txtStateRecurringRatio.Text    = string.Empty;
                txtStateNonRecurringRatio.Text = string.Empty;
                FlashMessage.ErrorMessage(vmError.Message);
                return;
            }
        }
Ejemplo n.º 24
0
 protected void btnApprove_Click(object sender, EventArgs e)
 {
     try
     {
         string reginalOfficerDiaryNo = string.Empty;
         if (Session["APOFileId"] != null && ApoTitle.InnerText != "" && txtComments.Text != "")
         {
             DataSet dsRODiaryNum = APOBAL.Instance.GetRegionalOfficerDiaryNumber(Convert.ToInt32(Session["APOFileId"]));
             if (dsRODiaryNum.Tables[0].Rows.Count > 0)
             {
                 DataRow dr = dsRODiaryNum.Tables[0].Rows[0];
                 reginalOfficerDiaryNo = Convert.ToString(dr["RegionalOfficerDiaryNumner"]);
                 if (string.IsNullOrEmpty(reginalOfficerDiaryNo) || dr[0] == DBNull.Value)
                 {
                     int apoFileId = Convert.ToInt32(Session["APOFileId"]);
                     APOBAL.Instance.UpdateStatus(apoFileId, 13, false, txtComments.Text, null, null);
                     string strSuccess = "APO status has been approved successfully.";
                     UserBAL.Instance.InsertAuditTrailDetail("Apo Forwarded to Reginal Officer", "Approve - Reject");
                     vmSuccess.Message = strSuccess;
                     FlashMessage.InfoMessage(vmSuccess.Message);
                     Session["apoFileId"] = null;
                 }
                 else
                 {
                     string strError = "You can not approve this APO, since it has been approved by higher authority.";
                     vmError.Message = strError;
                     FlashMessage.ErrorMessage(vmError.Message);
                     return;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
     }
 }
        protected void btnNonRecurringSave_Click(object sender, EventArgs e)
        {
            if (ddlNRMonth.Visible)
            {
                if (ddlNRMonth.SelectedValue == "0")
                {
                    vmError.Message = "Please Select Month......";
                    FlashMessage.ErrorMessage("Please Select Month.......");
                    return;
                }
            }

            try
            {
                if (ddlNRMonth.SelectedValue != "0")
                {
                    oApo.Month = Convert.ToString(ddlNRMonth.SelectedValue);
                }
                else if (!string.IsNullOrEmpty(txtFromDate.Text) && !string.IsNullOrEmpty(txtToDate.Text))
                {
                    oApo.FromDate = txtFromDate.Text.Trim();
                    oApo.ToDate   = txtToDate.Text.Trim();
                }
                SubmitReport(gvNonRecurring);
            }
            catch (Exception ex)
            {
                LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
                Response.RedirectPermanent("~/ErrorPage.aspx", false);
            }
            finally
            {
                if (oApo != null)
                {
                    oApo = null;
                }
            }
        }
Ejemplo n.º 26
0
 protected void cgvDesignation_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     try
     {
         Label Designation   = cgvDesignation.Rows[e.RowIndex].FindControl("lblDesignationId") as Label;
         int   designationId = Convert.ToInt32(Designation.Text);
         DesignationBAL.Instance.DeleteDesignation(designationId);
         UserBAL.Instance.InsertAuditTrailDetail("Deleted Designation", "Manage Designation");
         GetDesignationList();
         string strSuccess = "Data deleted successfully.";
         vmSuccess.Message = strSuccess;
         FlashMessage.ErrorMessage(vmSuccess.Message);
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         //return;
     }
 }
Ejemplo n.º 27
0
 protected void txtSetFirstInstallment_TextChanged(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(txtSetFirstInstallment.Text))
     {
         double temp;
         if (double.TryParse(txtSetFirstInstallment.Text, out temp))
         {
             if (temp >= 000.00 && temp <= 100.00)
             {
                 double firstInstallment = temp;
                 txtSetSecondInstallment.Text = Convert.ToString(100.00 - Convert.ToDouble(firstInstallment));
             }
             else
             {
                 string strError = "First installment should be greater than or equal to '000.00' OR less than or equal to '100.00' !";
                 vmError.Message = strError;
                 FlashMessage.ErrorMessage(vmError.Message);
                 return;
             }
         }
         else
         {
             string strError = "Entered text is not a decimal number, please enter decimal number and try again !";
             vmError.Message = strError;
             FlashMessage.ErrorMessage(vmError.Message);
             return;
         }
     }
     else
     {
         string strError = "Please enter the first installment !";
         txtSetSecondInstallment.Text = string.Empty;
         vmError.Message = strError;
         FlashMessage.ErrorMessage(vmError.Message);
         return;
     }
 }
 protected void btnFirstRelease_Click(object sender, EventArgs e)
 {
     try
     {
         if (Session["centralStateShare"] != null)
         {
             centralStateShare = (CentralStateShare)Session["centralStateShare"];
             centralStateShare.IFDDiaryNumber = txtIfdDiaryNumber.Text;
             if (!string.IsNullOrEmpty(txtIfdDate.Text))
             {
                 centralStateShare.IFDDate = Convert.ToDateTime(txtIfdDate.Text);
             }
             else
             {
                 centralStateShare.IFDDate = DateTime.Now;
             }
             CentralStateShareBAL.Instance.UpdateStateFirstReleasedAmount(centralStateShare);
             string strSuccess = "First installment of state share has been released successfully.";
             vmSuccess.Message = strSuccess;
             FlashMessage.ErrorMessage(vmSuccess.Message);
             Session["centralStateShare"] = null;
             GetCentralStateShare();
             FistInstallmentDiv.Style.Add("display", "none");
             SecondInstallmentDiv.Style.Add("display", "block");
             UserBAL.Instance.InsertAuditTrailDetail("Released First Installment of State Share", "Monitoring Central-State Share");
         }
     }
     catch (Exception ex)
     {
         LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
         Response.RedirectPermanent("~/ErrorPage.aspx", false);
         //string strError = ex.Message;
         //vmError.Message = strError;
         //FlashMessage.ErrorMessage(vmError.Message);
         //return;
     }
 }
Ejemplo n.º 29
0
        private bool IsFinalUCSubmitted(int apoFileId)
        {
            bool    IsFinalUC       = false;
            string  finalUcFileName = string.Empty;
            DataSet dsFinalUc       = UtilizationCertificateBAL.Instance.GetFinalUCFileName(apoFileId);

            if (dsFinalUc != null && dsFinalUc.Tables[0].Rows.Count == 1)
            {
                DataRow dr = dsFinalUc.Tables[0].Rows[0];
                finalUcFileName = dr["FinnalUcFileName"].ToString();
            }
            if (!string.IsNullOrEmpty(finalUcFileName))
            {
                IsFinalUC = true;
            }
            else
            {
                string strError = ConfigurationManager.AppSettings["FinalUcNotSubmitted"];
                vmError.Message = strError;
                FlashMessage.ErrorMessage(vmError.Message);
                IsFinalUC = false;
            }
            return(IsFinalUC);
        }
Ejemplo n.º 30
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                string reginalOfficerDiaryNo = string.Empty;
                if (Session["apoFileId"] != null && ddlName.SelectedValue != "0" && txtComments.Text != "")
                {
                    if (ddlName.SelectedValue == "13")
                    {
                        if (!IsCWLWObligationsSubmitted(Convert.ToInt32(Session["apoFileId"])))
                        {
                            return;
                        }
                    }
                    APOBAL.Instance.UpdateDiaryNumber(Convert.ToInt32(Session["APOFileId"]));
                    DataSet dsRODiaryNum = APOBAL.Instance.GetRegionalOfficerDiaryNumber(Convert.ToInt32(Session["APOFileId"]));
                    if (dsRODiaryNum.Tables[0].Rows.Count > 0)
                    {
                        DataRow dr = dsRODiaryNum.Tables[0].Rows[0];
                        reginalOfficerDiaryNo = Convert.ToString(dr["RegionalOfficerDiaryNumner"]);
                        if (!string.IsNullOrEmpty(reginalOfficerDiaryNo))
                        {
                            APOBAL.Instance.UpdateStatus(Convert.ToInt32(Session["apoFileId"]), Convert.ToInt32(ddlName.SelectedValue), false, txtComments.Text, reginalOfficerDiaryNo, null);

                            UserBAL.Instance.InsertAuditTrailDetail("Updated APO Status", "Update APO Status");
                            if (ddlName.SelectedValue == "13")
                            {
                                string strSuccess = ConfigurationManager.AppSettings["ForwardToRegionalOfficer"];
                                vmSuccess.Message = strSuccess;
                                FlashMessage.InfoMessage(vmSuccess.Message);
                                Session["apoFileId"] = null;
                                Clear();
                            }
                            else if (ddlName.SelectedValue == "8")
                            {
                                string strSuccess = ConfigurationManager.AppSettings["ApoRejected"];
                                vmSuccess.Message = strSuccess;
                                FlashMessage.InfoMessage(vmSuccess.Message);
                                Session["apoFileId"] = null;
                                Clear();
                            }
                            else if (ddlName.SelectedValue == "3")
                            {
                                string strSuccess = ConfigurationManager.AppSettings["ModifyResubmit"];
                                vmSuccess.Message = strSuccess;
                                FlashMessage.InfoMessage(vmSuccess.Message);
                                Session["apoFileId"] = null;
                                Clear();
                            }
                        }
                        else
                        {
                            string strError = ConfigurationManager.AppSettings["ActionTakenByHigherAuthortity"];
                            vmError.Message = strError;
                            FlashMessage.ErrorMessage(vmError.Message);
                            return;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHandler.LogFatal((ex.InnerException != null ? ex.InnerException.Message : ex.Message), ex, this.GetType());
                Response.RedirectPermanent("~/ErrorPage.aspx", false);
            }
        }