Ejemplo n.º 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());
        }
    }
Ejemplo n.º 2
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());
        }
    }
Ejemplo n.º 3
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());
        }
    }