Example #1
0
        protected void btnAccrual_Click(object sender, EventArgs e)
        {
            util = new Utilities();
            if (util.UserAuthentication())
            {
                string userRole = Session["UserRole"].ToString();

                //Validation: only Super user can access this page
                if (userRole.ToLower() == UserRole.SuperUser.ToString().ToLower())
                {
                    //JIRA- 1172- Changes by Harshika--Start
                    string runflag = "";
                    if (hdnConfirmation.Value == "RunAccruals")
                    {
                        runflag = "RUN";
                    }
                    else if (hdnConfirmation.Value == "ReRunAccruals")
                    {
                        runflag = "RERUN";
                    }
                    //JIRA- 1172- Changes by Harshika--End
                    string   message;
                    CommonBL commonBl = new CommonBL();
                    commonBl.RunAccrualProcess(runflag, out message, out errorId);
                    commonBl = null;
                    if (errorId == 0)
                    {
                        msgView.SetMessage(message, MessageType.Warning, PositionType.Auto);
                    }
                    else if (errorId == 2)
                    {
                        msgView.SetMessage("Error in Accrual process", MessageType.Warning, PositionType.Auto);
                    }
                }
                else
                {
                    msgView.SetMessage("Accruals can only be run by a SuperUser", MessageType.Warning, PositionType.Auto);
                }
            }
        }