예제 #1
0
    public bool MasterReleaseLocks(long idPAList)
    {
        PAListManager plMgr = new PAListManager();
        plMgr.SelectPAList(idPAList);
        plMgr.MasterReleaseLocks();

        return true;
    }
예제 #2
0
    public bool SoftReleaseLocks(long idPAList, string paLockKey)
    {
        PAListManager plMgr = new PAListManager(paLockKey);
        plMgr.SelectPAList(idPAList);
        plMgr.ReleaseLocks();

        return true;
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //SECURITY CHECK HERE
        //LOCK CHECK HERE

        if (Page.IsPostBack)
            return;

        if (string.IsNullOrEmpty(Request.QueryString["month"]))
        {
            Response.Redirect("PaymentAdviceManager.aspx");
            Response.End();
        }
        else
        {
            Response.Buffer = true;
            Response.BufferOutput = true;

            lblMonth.Text = Request.QueryString["month"];

            HtmlTextWriter txt = new HtmlTextWriter(Response.Output);
            Page.RenderControl(txt);
            Response.Flush();

            if (!checkPreRequisites())
            {
                Response.End();
                return;
            }

            DateTime reqDate = parseDate(lblMonth.Text);
            PAListManager plMgr = new PAListManager();

            try
            {
                plMgr.PreparePAList(reqDate);
                Response.Write("<script language='javascript' type='text/javascript'>" +
                   "document.getElementById('lblSuccess').innerText='Successful';" +
                   "setTimeout('window.location.href=\\\'PaymentAdviceManager.aspx?id="+ plMgr.CurrentPAList.Id +"\\\'',1000);" +
                   "</script>");
            }
            catch (Apas.ApasException ex)
            {
                Response.Write("<script language='javascript' type='text/javascript'>" +
                    "document.getElementById('lblError').innerText='"+ex.Message+"';"+
                    "setTimeout('window.location.href=\\\'PaymentAdviceManager.aspx\\\'',5000);"+
                    "</script>");

                bool rethrow = ExceptionPolicy.HandleException(ex, "UserFeedbackedPolicy");
                if (rethrow) throw;
            }

            Response.End();

        }
    }
예제 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(typeof(APAS_PaymentAdviceManager));

        if (Page.IsPostBack)
        {
            return;
        }

        prepareMonthString();

        lblMonth.Text = "(file not opened)";
        lblStatus.Text = "(file not opened)";
        lblCreatedTime.Text = "(file not opened)";
        lblSMSGenTime.Text = "(file not opened)";

        ddlBranch.DataTextField = "Name";
        ddlBranch.DataValueField = "Id";
        ddlBranch.DataSource = BCBranch.getAllBranches();
        ddlBranch.DataBind();

        ddlClassLevel.DataTextField = "Name";
        ddlClassLevel.DataValueField = "Id";
        ddlClassLevel.DataSource = BCLevel.getAllLevels();
        ddlClassLevel.DataBind();
        ddlClassLevel.Items.Insert(0, new ListItem("Any","Any"));

        ddlClassSubject.DataTextField = "Name";
        ddlClassSubject.DataValueField = "Id";
        ddlClassSubject.DataSource = BCSubject.getAllSubjects();
        ddlClassSubject.DataBind();
        ddlClassSubject.Items.Insert(0, new ListItem("Any", "Any"));

        ddlClassBranch.DataTextField = "Name";
        ddlClassBranch.DataValueField = "Id";
        ddlClassBranch.DataSource = BCBranch.getAllBranches();
        ddlClassBranch.DataBind();
        ddlClassBranch.Items.Insert(0, new ListItem("Any", "Any"));

        if (!string.IsNullOrEmpty(Request.QueryString["id"]))
        {

            PAListManager plMgr = new PAListManager();
            if (plMgr.SelectPAList(Convert.ToInt64(Request.QueryString["id"])))
            {
                hdnIdPAList.Value = Request.QueryString["id"];
                PAScreen.Attributes["src"] = "PaymentAdviceSheet.aspx";
                lblMonth.Text = plMgr.CurrentPAList.Month.ToString("MMM yyyy");
                lblStatus.Text = (plMgr.CurrentPAList.IsFrozen == 1) ? "Frozen" : "Active";
                lblCreatedTime.Text  = plMgr.CurrentPAList.CreatedTime.ToString("dd MMM yyyy hh:mmtt");
                lblSMSGenTime.Text = (plMgr.CurrentPAList.SMSGenTime == null) ?
                    "(not generated)" : plMgr.CurrentPAList.SMSGenTime.Value.ToString("dd MMM yyyy hh:mmtt");
            }
            else
            {
                PAScreen.Attributes["src"] = "DefaultPaymentAdviceSheet.aspx";
            }
        }
        else
        {
            PAScreen.Attributes["src"] = "DefaultPaymentAdviceSheet.aspx";
        }
    }
예제 #5
0
    private void prepareMonthString()
    {
        //populate hdnMonthList with | delimited month strings
        //populate hdnExistList with | delimited 0/1 to indicate if palists exists for each given month
        //a total of 7 monhs will be written. NextMonth + past six months

        PAListManager plMgr = new PAListManager();
        DateTime mth = new DateTime(
            DateTime.Now.AddMonths(1).Year,
            DateTime.Now.AddMonths(1).Month,
            1);

        string monthList = "";
        string existList = "";
        //count backwards 7 times
        for (int i = 0; i < 7; i++)
        {
            monthList += mth.ToString("MMM yyyy") + "|";
            if (plMgr.SelectPAList(mth))
                existList += "1|";
            else
                existList += "0|";

            mth= mth.AddMonths(-1);
        }

        monthList = monthList.Substring(0, monthList.Length - 1);
        existList = existList.Substring(0, existList.Length - 1);

        hdnMonthList.Value = monthList;
        hdnExistList.Value = existList;
    }