コード例 #1
0
    protected void btn_reconAgn2_Click(object sender, EventArgs e)
    {
        resultDiv2.Visible = false;
        div2_error.Visible = false;
        div2_alert.Visible = false;
        String     yrmo = ddlYrmo2.SelectedValue;
        HRASofoDAL robj = new HRASofoDAL();

        if (Page.IsValid)
        {
            if (txtPrevYRMO2.Visible)
            {
                lbl_error2.Text = "Enter YRMO in format 'yyyymm'";
                return;
            }
            try
            {
                MultiView1.SetActiveView(view_main2);
                robj.ReconDelete(yrmo);
            }
            catch (Exception ex)
            {
                resultDiv2.Visible = false;
                div2_error.Visible = true;
                lbl_error2.Text    = "Error - " + ex.Message;
            }
        }
    }
コード例 #2
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        resultDiv2.Visible = false;
        div2_error.Visible = false;
        div2_alert.Visible = false;
        String     yrmo = ddlYrmo2.SelectedValue;
        HRASofoDAL robj = new HRASofoDAL();

        if (Page.IsValid)
        {
            if (txtPrevYRMO2.Visible)
            {
                lbl_error2.Text = "Enter YRMO in format 'yyyymm'";
                return;
            }

            try
            {
                ManualReconcile();
                HRA_Results.SavePrintFiles(_category, yrmo);
                viewresult2(yrmo);
                Session["taskId"] = Convert.ToInt32(Session["taskId"]) + 1;
                Audit.auditUserTaskR(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "HRA", "Reconciliation", "SOFO Reconciliation", yrmo);
            }
            catch (Exception ex)
            {
                resultDiv2.Visible = false;
                MultiView1.SetActiveView(view_main2);
                robj.ReconDelete(yrmo);
                div2_error.Visible = true;
                lbl_error2.Text    = "Error - " + ex.Message;
            }
        }
    }
コード例 #3
0
    protected void btn_manImport_Click(object sender, EventArgs e)
    {
        string yrmo = ddlYrmo1.SelectedItem.Text;

        div1_error.Visible = false;
        div1_alert.Visible = false;
        HRASofoDAL robj = new HRASofoDAL();

        if (Page.IsValid)
        {
            if (txtPrevYRMO1.Visible)
            {
                lbl_error1.Text = "Enter YRMO in format 'yyyymm'";
                return;
            }

            string strFilePath1 = "";

            if (FileUpload1.GotFile)
            {
                try
                {
                    string fn = System.IO.Path.GetFileName(FileUpload1.FilePost.FileName);
                    strFilePath1 = Server.MapPath("~/uploads/") + fn;

                    if (File.Exists(strFilePath1))
                    {
                        File.Delete(strFilePath1);
                    }
                    FileUpload1.FilePost.SaveAs(strFilePath1);
                    AutoReconcile(strFilePath1);
                    HRA_Results.SavePrintFiles(_category, yrmo);
                    viewresult1(yrmo);
                    Session["taskId"] = Convert.ToInt32(Session["taskId"]) + 1;
                    Audit.auditUserTaskR(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "HRA", "Reconciliation", "SOFO Reconciliation", yrmo);
                }
                catch (Exception ex)
                {
                    resultDiv1.Visible = false;
                    MultiView3.SetActiveView(view_main1);
                    robj.ReconDelete(yrmo);
                    div1_error.Visible = true;
                    lbl_error1.Text    = "Error - " + ex.Message;
                }
                finally
                {
                    if (File.Exists(strFilePath1))
                    {
                        File.Delete(strFilePath1);
                    }
                    FileUpload1.FilePost.InputStream.Flush();
                    FileUpload1.FilePost.InputStream.Close();
                    FileUpload1.FilePost.InputStream.Dispose();
                }
            }
        }
    }
コード例 #4
0
    protected void checkPastRecon2()
    {
        string     _yrmo = ddlYrmo2.SelectedValue;
        HRASofoDAL robj  = new HRASofoDAL();

        if (robj.pastReconcile(_yrmo))
        {
            MultiView1.SetActiveView(view_reconAgn2);
            lbl_reconAgn2.Text = "Reconciled already for year-month (YRMO): " + _yrmo + ".<br />Press 'View Results' to view results or Press 'Re-Reconcile' to reconcile again.";
        }
        else
        {
            MultiView1.SetActiveView(view_main2);
        }
    }
コード例 #5
0
    void alertMsg2()
    {
        string     _yrmo     = ddlYrmo2.SelectedValue;
        HRASofoDAL robj      = new HRASofoDAL();
        string     _alertmsg = robj.HRAReconBal(_yrmo);

        if (!_alertmsg.Equals(String.Empty))
        {
            div2_alert.Visible = true;
            lbl2_alert.Text    = _alertmsg;
        }
        else
        {
            div2_alert.Visible = false;
        }
    }
コード例 #6
0
    protected void bindResult2(string _src, string yrmo)
    {
        DataSet ds = new DataSet();

        ds.Clear();
        HRASofoDAL sobj = new HRASofoDAL();

        switch (_src)
        {
        case "summary":
            ds = sobj.getSOFOReconData(yrmo);
            grdvSum2.DataSource = ds;
            grdvSum2.DataBind();
            break;
        }
    }
コード例 #7
0
    protected void btn_autoImport_Click(object sender, EventArgs e)
    {
        HRASofoDAL    robj = new HRASofoDAL();
        Impersonation _imp = new Impersonation();
        string        yrmo = ddlYrmo1.SelectedItem.Text;
        string        clientfilename, clientfile, serverPath;
        string        serverfile = "";

        div1_error.Visible = false;
        div1_alert.Visible = false;

        if (Page.IsValid)
        {
            if (txtPrevYRMO1.Visible)
            {
                lbl_error1.Text = "Enter YRMO in format 'yyyymm'";
                return;
            }

            try
            {
                serverPath     = Server.MapPath("~/uploads/");
                clientfilename = HRA.GetInputFileName(yrmo, source);
                serverfile     = serverPath + clientfilename;

                if (_imp.impersonateValidUser(Session["uid"].ToString(), "CORP", EncryptDecrypt.Decrypt(Session["pwd"].ToString())))
                {
                    clientfile = HRAImportDAL.GetClientFilePath(_category, source) + "\\" + clientfilename;
                    File.Copy(clientfile, serverfile);
                    _imp.undoImpersonation();
                }
                else
                {
                    throw new Exception("Error in accessing network location");
                }

                if (!(File.Exists(serverfile)))
                {
                    throw new Exception("Unable to import file from specified location.<br/>Please check if file exists and you are logged in to the network.");
                }

                AutoReconcile(serverfile);
                HRA_Results.SavePrintFiles(_category, yrmo);
                viewresult1(yrmo);
                Session["taskId"] = Convert.ToInt32(Session["taskId"]) + 1;
                Audit.auditUserTaskR(Session.SessionID, Session["mid"].ToString(), Session["taskId"].ToString(), "HRA", "Reconciliation", "SOFO Reconciliation", yrmo);
            }
            catch (Exception ex)
            {
                MultiView3.SetActiveView(view_main1);
                robj.ReconDelete(yrmo);
                div1_error.Visible = true;
                lbl_error1.Text    = "Error - " + ex.Message;
            }
            finally
            {
                if (File.Exists(serverfile))
                {
                    File.Delete(serverfile);
                }
            }
        }
    }