// GET: ViewPDF
        public ActionResult Index()
        {

            string document = this.Request.QueryString["document"];

            if (string.IsNullOrEmpty(document))
            {

                string documentID = this.Request.QueryString["id"];

                FaxData faxData = new FaxData();
                string faxPath = faxData.GetFaxPath(documentID);
                string faxName = GetFaxName(faxPath);
                ViewBag.FaxName = ConfigurationValues.PdfFolder + faxName;
                @ViewBag.FaxNameWithPath = ConfigurationValues.PdfFolder + faxName;
                System.IO.File.Copy(faxPath, ConfigurationValues.WhereToCopyPDfTo + faxName, true);
                return View();
            }
            else
            {
                FaxData faxData = new FaxData();
                //string faxPath = faxData.GetFaxPath(documentID);
                //string faxName = GetFaxName(faxPath);
                ViewBag.FaxName = ConfigurationValues.TemporaryFaxPath  + Utility.GetUserName()  + "\\" + document;
                @ViewBag.FaxNameWithPath = ConfigurationValues.PdfFolder + document;
                System.IO.File.Copy(ConfigurationValues.TemporaryFaxPath + Utility.GetUserName()  + "\\" + document, ConfigurationValues.WhereToCopyPDfTo + document, true);
                return View();
            }

            //string faxName = string.Empty;
            //using (SqlConnection cn = new SqlConnection(Database.WaldenFax))
            //{
            //    cn.Open();
            //    using (SqlCommand cm = cn.CreateCommand())
            //    {
            //        cm.CommandText = "select FaxPath"
            //            + " from FaxesSendServer "
            //            + " where SendID = " + id.ToString();

            //        SqlDataReader dr = cm.ExecuteReader();
            //        dr.Read();
            //        faxName = GetFaxName(dr.GetString(0));
            //        ViewBag.FaxName = Walden.CompleteFax.Library.Database.ApiPath + "pdf/" + faxName;
            //        System.IO.File.Copy(dr.GetString(0), Walden.CompleteFax.Library.Database.WhereToCopyPDFTo + faxName, true);
            //        return View();
            //    }
            //}



            //return View();
        }
        // GET: ResendFax
        public ActionResult Index()
        {
            string sendID = this.Request.QueryString["sendID"];
            string faxNumber = this.Request.QueryString["faxnumber"];
            string apiPath = this.Request.QueryString["apiPath"];
            string faxPath = string.Empty;

            FaxData faxData = new FaxData();
            ViewBag.sendID = sendID;
            ViewBag.faxNumber = faxNumber;

            string faxName = string.Empty;

            faxPath = faxData.GetFaxPath(sendID);
            faxName = GetFaxName(faxPath);
            @ViewBag.apiPath = apiPath;
            ViewBag.FaxName = ConfigurationValues.PdfFolder + faxName;
            System.IO.File.Copy(faxPath,ConfigurationValues.WhereToCopyPDfTo + faxName, true);
            return View();
        }