protected void btnDownloadAll_Click(object sender, EventArgs e)
    {
        Bill_Sys_CollectDocAndZip zip = new Bill_Sys_CollectDocAndZip();
        ArrayList list = new ArrayList();
        DataSet   set  = new DataSet();

        XMLData.XMLData data  = new XMLData.XMLData();
        XMLData.XMLData data2 = new XMLData.XMLData();
        string          str   = ConfigurationManager.AppSettings["LFBillSearch"].ToString();

        data2 = data.ReadXml(str);
        set   = data.XGridBind(this.Page, data2, 1, this.grdBillSearch.RecordCount, "", this.txtSearchBox.Text);
        if (this.chkCaseDoc.Checked)
        {
            list = zip.CollectAndZipBillDoc(set, "1");
        }
        else
        {
            list = zip.CollectAndZipBillDoc(set, "0");
        }
        if (list.Count < 1)
        {
            ScriptManager.RegisterClientScriptBlock((Page)this, base.GetType(), "Done", "alert('There are no files available on the server to download.');", true);
        }
        else
        {
            for (int i = 0; i < list.Count; i++)
            {
                ScriptManager.RegisterStartupScript((Page)this, typeof(string), "popup" + i.ToString(), "window.open('" + ConfigurationSettings.AppSettings["LFIRMDOCURL"].ToString() + list[i].ToString().Replace(ConfigurationSettings.AppSettings["BASEPATH_OF_DOWNLOAD"].ToString(), "").Trim() + "'); ", true);
            }
        }
    }
    protected void btnBatchXls_Click(object sender, EventArgs e)
    {
        try
        {
            DataSet         dsAll         = new DataSet();
            XMLData.XMLData obj           = new XMLData.XMLData();
            XMLData.XMLData xd            = new XMLData.XMLData();
            string          szxmlfilename = ConfigurationManager.AppSettings["LFDESKOFFICEINFO"].ToString();
            xd    = obj.ReadXml(szxmlfilename);
            dsAll = obj.XGridBind(this.Page, xd, 1, grdBillSearch.RecordCount, "", txtSearchBox.Text);
            string sz_Bill_No = "";
            for (int i = 0; i < dsAll.Tables[0].Rows.Count; i++)
            {
                if (sz_Bill_No == "")
                {
                    sz_Bill_No = "'" + dsAll.Tables[0].Rows[i]["SZ_BILL_NUMBER"].ToString() + "'";
                }
                else
                {
                    sz_Bill_No = sz_Bill_No = sz_Bill_No + "," + "'" + dsAll.Tables[0].Rows[i]["SZ_BILL_NUMBER"].ToString() + "'";
                }
            }
            Bill_Sys_CollectDocAndZip _objBatch = new Bill_Sys_CollectDocAndZip();
            DataSet dsInfo = new DataSet();

            dsInfo = _objBatch.GetPateintInfo(sz_Bill_No);
            if (dsInfo.Tables[0].Rows.Count > 0)
            {
                string xmlName   = _objBatch.getFileName();
                string exlName   = xmlName.Replace(".xml", ".xls");
                string file_path = ConfigurationSettings.AppSettings["XLPATH"].ToString();
                string Folder    = ConfigurationSettings.AppSettings["REPORTFOLDER"].ToString();

                File.Copy(file_path, getPhysicalPath() + "Reports/" + exlName);
                _objBatch.GenerateXL(dsInfo.Tables[0], getPhysicalPath() + "Reports/" + exlName);
                if (File.Exists(getPhysicalPath() + Folder + exlName))
                {
                    ScriptManager.RegisterClientScriptBlock(this, GetType(), "Msg", "window.open('" + ConfigurationManager.AppSettings["FETCHEXCEL_SHEET"].ToString() + exlName + "'); ", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, GetType(), "Done", "alert('Batch is Empty');", true);
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
예제 #3
0
    protected void Page_Load(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());
        }

        lblCompanyName.Text    = VersionInfo.CompanyName;
        lblVersion.Text        = VersionInfo.Version;
        lblDatabaseServer.Text = VersionInfo.DatabaseServer;
        lblDomainError.Visible = false;
        lblDomainError.Text    = "";
        if (Request.QueryString["dt"] != null)
        {
            hdUrlIntegration.Value    = Request.QueryString["dt"].ToString();
            Session["urlintegration"] = hdUrlIntegration.Value;
        }
        else
        {
        }
        if (Session["DomainErro"] != null)
        {
            if (Session["DomainErro"].ToString().ToLower().Trim() == "true")
            {
                lblDomainError.Text      = "The username or password you entered is incorrect.";
                lblDomainError.Visible   = true;
                lblDomainError.ForeColor = System.Drawing.Color.Red;
                Session["DomainErro"]    = null;
                return;
            }
            else
            {
                lblDomainError.Visible = false;
                lblDomainError.Text    = "";
            }
        }
        else
        {
            lblDomainError.Visible = false;
            lblDomainError.Text    = "";
        }

        if (!Page.IsPostBack)
        {
            log4net.Config.XmlConfigurator.Configure();
            log.Debug("Apllication Strat");
            if (Application["XmlStatus"] == null)
            {
                try
                {
                    XMLData.XMLData xd   = new XMLData.XMLData();                                                 // object of the XMLData class.
                    string          path = AppDomain.CurrentDomain.BaseDirectory.ToString() + "XML\\";            //get path of the "XML" folder
                    log.Debug("path " + path);
                    string[] fileEntries = System.IO.Directory.GetFiles(path);                                    // get files in "XML" folder of the application
                    foreach (string szFilePath in fileEntries)                                                    // read each file name in the directory "XML"
                    {
                        string szFileName = szFilePath.Substring(szFilePath.LastIndexOf("\\")).Replace("\\", ""); // Get file name with extension
                        log.Debug("szFileName " + szFileName);
                        string szExtension = szFileName.Substring(szFileName.LastIndexOf("."));                   // get extension of the file.
                        if (szExtension.Equals(".xml") || szExtension.Equals(".XML"))                             // check extension of the file in directory "XML".
                        {
                            if (szFileName != "Location.xml")
                            {
                                xd = xd.ReadXml(szFilePath);                        // read xml and add the values in XMLData object.
                                string szKey = szFileName.Replace(szExtension, ""); // name of the file is key of the variable.
                                Application.Add(szKey, xd);                         // add key in the application.
                                Application["XmlStatus"] = true;
                            }
                        }
                    }
                }
                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);
                }
            }

            if (Session["BILLING_COMPANY_OBJECT"] == null)
            {
                if (Request.Cookies["UserID"] != null)
                {
                    Response.Cookies["UserID"].Expires = DateTime.Now.AddDays(-1);
                }

                if (Request.Cookies["UserName"] != null)
                {
                    Response.Cookies["UserName"].Expires = DateTime.Now.AddDays(-1);
                }
                if (Request.Cookies["DefaultURL"] != null)
                {
                    Response.Cookies["DefaultURL"].Expires = DateTime.Now.AddDays(-1);
                }
                Session["USER_OBJECT"]            = null;
                Session["BILLING_COMPANY_OBJECT"] = null;
                Session["UserID"]     = null;
                Session["UserName"]   = null;
                Session["DefaultURL"] = null;
                Session.Abandon();
            }
            else
            {
                log.Debug("Before ReDirecting TO  Bill_Sys_Default.aspx ");
                Response.Redirect("Bill_Sys_Default.aspx", false);
            }
        }
        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }
예제 #4
0
 static void Main(string[] args)
 {
     var data = new XMLData("");
 }