Example #1
0
    //protected ListBox lstPDF;
    //protected UserControl_ErrorMessageControl MessageControl1;
    //protected ModalPopupExtender ModalPopupExtenderMerge;
    //protected Label Msglbl;
    //protected HtmlGenericControl myiframe;
    //protected PanelContent PanelContent1;
    //protected PanelContent PanelContent2;
    //protected PanelContent PanelContent3;
    //protected Panel pnlMerge;
    //protected FileUpload ReportUpload;
    //protected ScriptManager ScriptManager1;
    //protected TextBox txtcaseid;
    //protected TextBox txtCompanyID;
    //protected TextBox txtmergerfilename;
    //protected Button UploadButton;
    //protected UserControl_ErrorMessageControl usrMessage;

    protected void btndelete_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        Bill_Sys_Document_Manager manager = new Bill_Sys_Document_Manager();

        try
        {
            string str = "";
            for (int i = 0; i < this.grddocumnetmanager.VisibleRowCount; i++)
            {
                GridViewDataColumn gridViewDataColumn = (GridViewDataColumn)this.grddocumnetmanager.Columns[0];
                CheckBox           box = (CheckBox)this.grddocumnetmanager.FindRowCellTemplateControl(i, gridViewDataColumn, "chkall");
                if (box != null)
                {
                    str = this.grddocumnetmanager.GetRowValues(i, new string[] { "ImageId" }).ToString();
                    if (box.Checked)
                    {
                        manager.deletenode(str);
                        string path = this._bill_Sys_NF3_Template.getPhysicalPath() + this.grddocumnetmanager.GetRowValues(i, new string[] { "File_Path" }).ToString() + this.grddocumnetmanager.GetRowValues(i, new string[] { "File_Name" }).ToString();
                        if (File.Exists(path))
                        {
                            string sourceFileName = path.Replace(@"\", "/");
                            File.Move(sourceFileName, sourceFileName + ".deleted");
                        }
                    }
                }
            }
            this.MessageControl1.PutMessage("PDF Delete Successfully ...!");
            this.MessageControl1.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
            this.MessageControl1.Show();
            DataSet documentmanagerInfo = new DataSet();
            documentmanagerInfo = manager.GetDocumentmanagerInfo(this.txtcaseid.Text, this.txtCompanyID.Text);
            this.grddocumnetmanager.DataSource = documentmanagerInfo;
            this.grddocumnetmanager.DataBind();
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
    public void BindListBox()
    {
        Bill_Sys_Document_Manager _Bill_Sys_Document_Manager = new Bill_Sys_Document_Manager();
        DataSet dsmergedoc = new DataSet();

        dsmergedoc            = _Bill_Sys_Document_Manager.GetDocumentmanagerMerge();
        lstPDF.DataSource     = dsmergedoc;
        lstPDF.DataTextField  = "SZ_FILENAME";
        lstPDF.DataValueField = "SZ_IMAGEID";
        lstPDF.DataBind();
    }
Example #3
0
    protected void UploadButton_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        if (this.ReportUpload.HasFile)
        {
            for (int i = 0; i < this.grddocumnetmanager.VisibleRowCount; i++)
            {
                GridViewDataColumn gridViewDataColumn = (GridViewDataColumn)this.grddocumnetmanager.Columns[0];
                CheckBox           box = (CheckBox)this.grddocumnetmanager.FindRowCellTemplateControl(i, gridViewDataColumn, "chkall");
                if (box.Checked)
                {
                    string str = this.grddocumnetmanager.GetRowValues(i, new string[] { "NodeID" }).ToString();
                    Bill_Sys_Document_Manager manager = new Bill_Sys_Document_Manager();
                    string pathFromNodeId             = manager.GetPathFromNodeId(str);
                    if (((pathFromNodeId == "0") || (pathFromNodeId == "")) || ((pathFromNodeId.ToUpper() == "NULL") || (pathFromNodeId == null)))
                    {
                        this.MessageControl1.PutMessage("Folder NodeType not Found Contact to admin");
                        this.MessageControl1.SetMessageType(0);
                        this.MessageControl1.Show();
                        log.Debug(" NodeType not Found ");
                        return;
                    }
                    log.Debug("szPath " + pathFromNodeId);
                    string str3 = ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + @"\" + pathFromNodeId + @"\";
                    log.Debug("szPath " + pathFromNodeId);
                    string str4 = ApplicationSettings.GetParameterValue("PhysicalBasePath");
                    log.Debug("szBasePath " + str4);
                    string fileName = this.ReportUpload.FileName;
                    log.Debug("szFileName " + fileName);
                    if (!Directory.Exists(str4 + str3))
                    {
                        log.Debug("File not Exists ");
                        Directory.CreateDirectory(str4 + str3);
                    }
                    if (File.Exists(str4 + str3 + fileName))
                    {
                        this.MessageControl1.PutMessage("File already Exists");
                        this.MessageControl1.SetMessageType(0);
                        this.MessageControl1.Show();
                        log.Debug("File already Exists");
                        return;
                    }
                    try
                    {
                        this.ReportUpload.SaveAs(str4 + str3 + fileName);
                        log.Debug("File Saved ");
                        string str6 = manager.SaveFileInDOc(str, fileName, str3, ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_NAME);
                        if (((str6 != "0") && (str6 != "")) && ((str6.ToUpper() != "NULL") && (str6 != null)))
                        {
                            DataSet documentmanagerInfo = new DataSet();
                            documentmanagerInfo = new Bill_Sys_Document_Manager().GetDocumentmanagerInfo(this.txtcaseid.Text, this.txtCompanyID.Text);
                            this.grddocumnetmanager.DataSource = documentmanagerInfo;
                            this.grddocumnetmanager.DataBind();
                            this.MessageControl1.PutMessage("File uploaded Successfully..! ");
                            this.MessageControl1.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
                            this.MessageControl1.Show();
                            log.Debug("File uploaded Successfully");
                        }
                        else
                        {
                            this.MessageControl1.PutMessage(" DB error to add File ");
                            this.MessageControl1.SetMessageType(0);
                            this.MessageControl1.Show();
                            log.Debug("DB error to ADD File");
                        }
                    }
                    catch (Exception ex)
                    {
                        Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
                        using (Utils utility = new Utils())
                        {
                            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
                        }
                        string str2 = "Error Request=" + id + ".Please share with Technical support.";
                        base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
                    }
                    return;
                }
            }
        }
        else
        {
            this.MessageControl1.PutMessage("File was not selected for upload");
            this.MessageControl1.SetMessageType(0);
            this.MessageControl1.Show();
        }

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
Example #4
0
    protected void BtnMergeDoc_OnClick(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        ArrayList list = new ArrayList();

        log.Debug(" INside BtnMergeDoc_OnClick");
        try
        {
            if (this.txtmergerfilename.Text == "")
            {
                log.Debug("File name is emplty");
                ScriptManager.RegisterClientScriptBlock((Page)this, base.GetType(), "mmSelect", "alert('Please Enter the File Name without Extension');", true);
                this.ModalPopupExtenderMerge.Show();
            }
            else
            {
                for (int i = 0; i < this.lstPDF.Items.Count; i++)
                {
                    Bill_Sys_Document_Manager.Bill_Sys_Document_ManagerDAO rdao = new Bill_Sys_Document_Manager.Bill_Sys_Document_ManagerDAO();
                    rdao._FILE_NAME = this.lstPDF.Items[i].Text;
                    rdao.FILE_PATH  = this.lstPDF.Items[i].Value.ToString();
                    list.Add(rdao);
                }
                string str = this._bill_Sys_NF3_Template.getPhysicalPath() + ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + this.txtcaseid.Text + "/Packeted Doc/" + this.txtmergerfilename.Text + ".pdf";
                if (!Directory.Exists(this._bill_Sys_NF3_Template.getPhysicalPath() + ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + this.txtcaseid.Text + "/Packeted Doc/"))
                {
                    Directory.CreateDirectory(this._bill_Sys_NF3_Template.getPhysicalPath() + ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + this.txtcaseid.Text + "/Packeted Doc/");
                }
                if (this.CreatePDF(str, list) == 1)
                {
                    Bill_Sys_Document_Manager manager = new Bill_Sys_Document_Manager();
                    manager.getlogical(this.txtcaseid.Text, this.txtmergerfilename.Text + ".pdf", this.txtCompanyID.Text);
                    this.txtmergerfilename.Text = "";
                    DataSet documentmanagerInfo = new DataSet();
                    documentmanagerInfo = manager.GetDocumentmanagerInfo(this.txtcaseid.Text, this.txtCompanyID.Text);
                    this.grddocumnetmanager.DataSource = documentmanagerInfo;
                    this.grddocumnetmanager.DataBind();
                    for (int j = 0; j < this.grddocumnetmanager.VisibleRowCount; j++)
                    {
                        string str2 = "";
                        if (j == 0)
                        {
                            GridViewDataColumn gridViewDataColumn = (GridViewDataColumn)this.grddocumnetmanager.Columns[0];
                            CheckBox           box = (CheckBox)this.grddocumnetmanager.FindRowCellTemplateControl(j, gridViewDataColumn, "chkall");
                            str2        = this.grddocumnetmanager.GetRowValues(j, new string[] { "File_Name" }).ToString();
                            box.Visible = false;
                        }
                        else if (str2 == this.grddocumnetmanager.GetRowValues(j, new string[] { "File_Name" }).ToString())
                        {
                            GridViewDataColumn column2 = (GridViewDataColumn)this.grddocumnetmanager.Columns[0];
                            CheckBox           box2    = (CheckBox)this.grddocumnetmanager.FindRowCellTemplateControl(j, column2, "chkall");
                            box2.Visible = false;
                        }
                        else
                        {
                            str2 = this.grddocumnetmanager.GetRowValues(j, new string[] { "File_Name" }).ToString();
                        }
                    }
                    this.usrMessage.PutMessage("Merge Successfully ...!");
                    this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
                    this.usrMessage.Show();
                    this.ModalPopupExtenderMerge.Show();
                }
            }
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
Example #5
0
    protected void btnDone_Click(object sender, EventArgs e)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        string    str  = ((Bill_Sys_UserObject)this.Session["USER_OBJECT"]).SZ_USER_ID;
        string    str2 = this.hidnOrderFiles.Value;
        ArrayList list = new ArrayList();

        log.Debug(" INside BtnMergeDoc_OnClick");
        try
        {
            if (this.hidnFile.Value == "")
            {
                log.Debug("File name is emplty");
                ScriptManager.RegisterClientScriptBlock((Page)this, base.GetType(), "mmSelect", "alert('Please Enter the File Name without Extension');", true);
                this.ModalPopupExtenderMerge.Show();
            }
            else
            {
                string[]  strArray = str2.Split(new char[] { ',' });
                ArrayList list2    = new ArrayList();
                for (int i = 0; i <= (strArray.Length - 1); i++)
                {
                    log.Debug(" INside CreatePDF ");
                    string path = ApplicationSettings.GetParameterValue("MergePth");
                    log.Debug(" szPath = " + path);
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                        log.Debug(" Directory Created = " + path);
                    }
                    string str4 = null;
                    str4 = DateTime.Now.ToString("MMddyyHmmssff");
                    str4 = path + str + "_" + this.txtcaseid.Text + "_Blank_" + str4 + ".pdf";
                    int num2 = 0;
                    log.Debug(" Call to merge = ");
                    string str5 = ApplicationSettings.GetParameterValue("BlankMergePth");
                    num2 = this.CreatePDFBlank(strArray[i].ToString(), str5, str4);
                    if (File.Exists(str4))
                    {
                        list2.Add(strArray[i].ToString());
                    }
                    log.Debug(" VAlue of p" + num2);
                }
                for (int j = 0; j < list2.Count; j++)
                {
                    string[] strArray2 = list2[j].ToString().Replace(@"\", "/").Split(new char[] { '/' });
                    string   str6      = "";
                    foreach (string str7 in strArray2)
                    {
                        str6 = str7;
                    }
                    Bill_Sys_Document_Manager.Bill_Sys_Document_ManagerDAO rdao = new Bill_Sys_Document_Manager.Bill_Sys_Document_ManagerDAO();
                    rdao._FILE_NAME = str6;
                    rdao.FILE_PATH  = list2[j].ToString();
                    list.Add(rdao);
                }
                string str8 = this._bill_Sys_NF3_Template.getPhysicalPath() + ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + this.txtcaseid.Text + "/Packeted Doc/" + this.hidnFile.Value + ".pdf";
                if (!Directory.Exists(this._bill_Sys_NF3_Template.getPhysicalPath() + ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + this.txtcaseid.Text + "/Packeted Doc/"))
                {
                    Directory.CreateDirectory(this._bill_Sys_NF3_Template.getPhysicalPath() + ((Bill_Sys_BillingCompanyObject)this.Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_NAME + "/" + this.txtcaseid.Text + "/Packeted Doc/");
                }
                if (this.CreatePDF(str8, list) == 1)
                {
                    Bill_Sys_Document_Manager manager = new Bill_Sys_Document_Manager();
                    manager.getlogical(this.txtcaseid.Text, this.hidnFile.Value + ".pdf", this.txtCompanyID.Text);
                    this.txtmergerfilename.Text = "";
                    DataSet documentmanagerInfo = new DataSet();
                    documentmanagerInfo = manager.GetDocumentmanagerInfo(this.txtcaseid.Text, this.txtCompanyID.Text);
                    this.grddocumnetmanager.DataSource = documentmanagerInfo;
                    this.grddocumnetmanager.DataBind();
                    for (int k = 0; k < this.grddocumnetmanager.VisibleRowCount; k++)
                    {
                        string str9 = "";
                        if (k == 0)
                        {
                            GridViewDataColumn gridViewDataColumn = (GridViewDataColumn)this.grddocumnetmanager.Columns[0];
                            CheckBox           box = (CheckBox)this.grddocumnetmanager.FindRowCellTemplateControl(k, gridViewDataColumn, "chkall");
                            str9        = this.grddocumnetmanager.GetRowValues(k, new string[] { "File_Name" }).ToString();
                            box.Visible = false;
                        }
                        else if (str9 == this.grddocumnetmanager.GetRowValues(k, new string[] { "File_Name" }).ToString())
                        {
                            GridViewDataColumn column2 = (GridViewDataColumn)this.grddocumnetmanager.Columns[0];
                            CheckBox           box2    = (CheckBox)this.grddocumnetmanager.FindRowCellTemplateControl(k, column2, "chkall");
                            box2.Visible = false;
                        }
                        else
                        {
                            str9 = this.grddocumnetmanager.GetRowValues(k, new string[] { "File_Name" }).ToString();
                        }
                    }
                    this.usrMessage.PutMessage("Merge Successfully ...!");
                    this.usrMessage.SetMessageType(UserControl_ErrorMessageControl.DisplayType.Type_UserMessage);
                    this.usrMessage.Show();
                    this.ModalPopupExtenderMerge.Show();
                }
            }
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string errorMessage = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + errorMessage);
        }

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }