Exemplo n.º 1
0
    override protected void PageBase_Init(object sender, System.EventArgs e)
    {
        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);

        string filename = NoNull.GetString(Request["filename"], "");
        string message  = NoNull.GetString(Request["message"], "");

        if (!filename.Equals(""))
        {
            bool success = !message.Equals("fail");

            Affinity.Attachments        atts = new Affinity.Attachments(this.phreezer);
            Affinity.AttachmentCriteria attc = new Affinity.AttachmentCriteria();
            attc.Filepath = filename;
            atts.Query(attc);

            bool emailsent = false;

            foreach (Affinity.Attachment att in atts)
            {
                if (emailsent)
                {
                    continue;
                }
                MailMessage mm = new MailMessage("*****@*****.**", att.Request.Account.Email, "Agent Examination Form Fax", ((success) ? "Your recent Agent Examination Form has been faxed successfully." : "Your recent Agent Examination Form fax transmission failed."));
                mm.IsBodyHtml = true;
                mm.Priority   = MailPriority.Normal;

                SmtpClient sc = new SmtpClient("10.9.8.250");
                sc.Send(mm);
                emailsent = true;
            }
        }
    }
Exemplo n.º 2
0
    override protected void PageBase_Init(object sender, System.EventArgs e)
    {
        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);

        int id = NoNull.GetInt(Request["id"], 0);

        this.account = new Affinity.Account(this.phreezer);
        this.RequirePermission(Affinity.RolePermission.AffinityManager);

        if (!id.Equals(0))
        {
            this.account.Load(id);
        }
        else
        {
            this.account.RoleCode  = Affinity.Role.DefaultCode;
            this.account.CompanyId = Affinity.Company.DefaultId;
        }

        rtype = new Affinity.RequestType(this.phreezer);
        rtype.Load(Affinity.RequestType.UserPreferences);

        xmlForm = new XmlForm(this.account);

        LoadForm();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        this.RequirePermission(Affinity.RolePermission.AdminSystem);
        this.RequirePermission(Affinity.RolePermission.AffinityManager);
        this.RequirePermission(Affinity.RolePermission.AffinityStaff);
        this.Master.SetLayout("Administration", MasterPage.LayoutStyle.ContentOnly);

        string code = NoNull.GetString(Request.QueryString["code"], "");

        // load the specified request type
        rt = new Affinity.RequestType(this.phreezer);
        rt.Load(code);
        codeHdn.Value = code;

        RequestTypepnl.InnerHtml = rt.Description;

        // load the checkboxes if this is not postback
        if (!Page.IsPostBack)
        {
            IEnumerator i             = ExportFormatboxes.Items.GetEnumerator();
            string      exportformats = "," + rt.ExportFormats + ",";

            // loop through the checkboxes and check the ones that are in the database
            while (i.MoveNext())
            {
                ListItem li = (ListItem)i.Current;
                li.Selected = (exportformats.IndexOf("," + li.Value + ",") > -1);
            }
        }
    }
Exemplo n.º 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.RequirePermission(Affinity.RolePermission.SubmitOrders);

        this.btnCancel.Attributes.Add("onclick", "return confirm('If you cancel your changes will not be saved.  Are you sure?');");

        // custom validations
        this.txtPIN.Attributes.Add("onchange", "verifyPIN(this);");
        this.txtAdditionalPins.Attributes.Add("onchange", "verifyAdditionalPINs(this);");

        // disable browser based autocomplete
        this.txtPropertyCounty.Attributes.Add("autocomplete", "off");
        this.txtPropertyCity.Attributes.Add("autocomplete", "off");
        this.txtPropertyZip.Attributes.Add("autocomplete", "off");

        // create the request type
        this.rtype = new Affinity.RequestType(this.phreezer);
        string requestCode = (!radioRefinance.Checked)? NoNull.GetString(Request["code"], Affinity.RequestType.DefaultCode) : "Refinance";

        this.rtype = new Affinity.RequestType(this.phreezer);
        this.rtype.Load(requestCode);

        this.header.InnerText = "Step 1 of 2: New " + this.rtype.Description;
        this.Master.SetLayout(this.header.InnerText, MasterPage.LayoutStyle.ContentOnly);
    }
Exemplo n.º 5
0
    override protected void PageBase_Init(object sender, System.EventArgs e)
    {
        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);

        int id = NoNull.GetInt(Request["id"], 0);

        this.order = new Affinity.Order(this.phreezer);
        this.order.Load(id);
    }
Exemplo n.º 6
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        this.btnCancelSubmit.Attributes.Add("onclick", "return confirm('If you cancel your changes will not be saved.  Are you sure?');");
        this.btnCancelChange.Attributes.Add("onclick", "return confirm('If you cancel your changes will not be saved.  Are you sure?');");

        this.RequirePermission(Affinity.RolePermission.SubmitOrders);

        this.header.InnerText = NoNull.GetString(Request["new"]) == "" ? (this.isChange || this.rtype.Code == Affinity.RequestType.DefaultChangeCode ? "Edit:" : "Add")
                                + " " + this.rtype.Description + "" : "Step 2 of 2: New " + this.rtype.Description;

        this.Master.SetLayout(this.header.InnerText, MasterPage.LayoutStyle.ContentOnly);

        ContentFooterSpan.InnerHtml = "&copy; Copyright " + DateTime.Now.Year.ToString() + ", Affinity Title Services, LLC";
    }
Exemplo n.º 7
0
    override protected void PageBase_Init(object sender, System.EventArgs e)
    {
        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);

        int id = NoNull.GetInt(Request["id"], 0);

        request = new Affinity.Request(this.phreezer);
        this.request.Load(id);

        // add the form for the request details
        XmlForm xf = new XmlForm(this.request.Account);

        pnlDetails.Controls.Add(xf.GetFormFieldControl(request.RequestType.Definition, request.Xml));
    }
Exemplo n.º 8
0
    /// <summary>
    /// The form controls are created at this point.  if we create them at page load
    /// then their viewstate will not be persisted.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    override protected void PageBase_Init(object sender, System.EventArgs e)
    {
        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);

        int id = NoNull.GetInt(Request["id"], 0);

        request = new Affinity.Request(this.phreezer);
        Affinity.Order order = new Affinity.Order(this.phreezer);
        order.Load(id);
        Affinity.RequestCriteria criteria = new Affinity.RequestCriteria();
        Affinity.Requests        reqs     = order.GetOrderRequests(criteria);
        Affinity.Request         req      = (Affinity.Request)reqs[0];
        this.request.Load(req.Id);
    }
    override protected void PageBase_Init(object sender, System.EventArgs e)
    {
        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);

        string code = NoNull.GetString(Request["code"], "");

        this.attachmentPurpose = new Affinity.AttachmentPurpose(this.phreezer);

        this.isUpdate = (!code.Equals(""));

        if (this.isUpdate)
        {
            this.attachmentPurpose.Load(code);
        }
    }
Exemplo n.º 10
0
    override protected void PageBase_Init(object sender, System.EventArgs e)
    {
        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);

        int id = NoNull.GetInt(Request["id"], 0);

        this.company = new Affinity.Company(this.phreezer);

        this.isUpdate = (!id.Equals(0));

        if (this.isUpdate)
        {
            this.company.Load(id);
        }
    }
Exemplo n.º 11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        /*
         * // get stack trace
         * System.Diagnostics.StackFrame fr = new System.Diagnostics.StackFrame(1, true);
         * System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(fr);
         * Response.Write( "method = " + fr.GetMethod().Name + " trace = " + st.ToString() );
         */
        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);
        PageBase pb = (PageBase)this.Page;

        Affinity.Account acc      = pb.GetAccount();
        string           contents = "";

        int id = NoNull.GetInt(Request["id"], 0);

        //Response.Write(Request["file"]);
        //Response.End();

        if (id > 0)
        {
            Affinity.Order order = new Affinity.Order(this.phreezer);
            order.Load(id);

            int filecount = 0;
            this.Master.SetLayout("PropertyProfile", MasterPage.LayoutStyle.ContentOnly);
            if (Request["file"] != null)
            {
                string [] file = Request["file"].Split(',');

                for (int i = 0; i < file.Length; i++)
                {
                    if ((file[i].Equals("WD") || file[i].Equals("WD_S") || file[i].Equals("WD_JT") || file[i].Equals("WD_TE")) && Request["warrantyfile"] == null)
                    {
                        continue;
                    }
                    string path = HttpContext.Current.Server.MapPath(".") + "\\downloads\\" + file[i] + ".xml";
                    if (File.Exists(path))
                    {
                        filecount++;
                    }
                }

                //Response.Write(path);

                /*
                 * string fileNameXML = HttpContext.Current.Server.MapPath(".") + "\\downloads\\Disclosure_Agent.doc";
                 *    string FileName = HttpContext.Current.Server.MapPath(".") + "\\downloads\\tested.xml";
                 *
                 *                 Document dc = new Document();
                 *            dc.LoadFromFile(fileNameXML, FileFormat.Doc);
                 *            dc.SaveToFile(FileName, FileFormat.Xml);
                 *            //dc.SaveToStream(HttpContext.Current.Response.OutputStream, FileFormat.Xml);
                 */

                /*
                 * if(false)
                 * {
                 *      int len = contents.Length+50;
                 *      HttpContext.Current.Response.ContentType = "application/ms-excel";
                 *      HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=PropertyProfile.xls");
                 *      HttpContext.Current.Response.AppendHeader("Content-Length", len.ToString());
                 *
                 * HttpContext.Current.Response.Write(contents + "                                                  ");
                 *      HttpContext.Current.Response.Flush();
                 * }
                 */
            }
        }
    }
Exemplo n.º 12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // System.IO.Path.GetExtension();

        Affinity.Attachment att = new Affinity.Attachment(this.phreezer);
        att.Load(NoNull.GetInt(Request["id"], 0));

        if (!att.Request.Order.CanRead(this.GetAccount()))
        {
            Crash(302, "You do not have permission to view this attachment");
        }

        string fileName  = att.Filepath;
        string viewStyle = this.GetAccount().GetPreference("AttachmentBehavior", "attachment");         // inline || attachment
        string filePath  = Server.MapPath("./") + "attachments/" + fileName.Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "").Replace("", "");

        FileInfo fi = new FileInfo(filePath);

        string contentType;

        // the viewstyle itself being inline/attachment would seem to be what we want
        // however it seems to be generally ignored by the browser.  So, in addition
        // to setting that header, we will force the content type as well
        if (viewStyle.Equals("attachment"))
        {
            contentType = "application/octet-stream";
        }
        else
        {
            switch (fi.Extension.Replace(".", "").ToLower())
            {
            case "pdf":
                contentType = "application/pdf";
                break;

            case "doc":
                contentType = "application/msword";
                break;

            case "xls":
                contentType = "application/vnd.ms-excel";
                break;

            case "tif":
            case "tiff":
                contentType = "image/tiff";
                break;

            default:
                contentType = "application/octet-stream";
                break;
            }
        }

        Response.Clear();
        Response.ContentType = contentType;
        Response.AddHeader("content-length", fi.Length.ToString());
        Response.AddHeader("Content-Disposition", "" + viewStyle + ";filename=\"" + fileName + "\"");

        Response.Buffer = true;
        Response.WriteFile(filePath);
        Response.End();

        /*
         * // alternate way to write binary to the browser
         * byte[] data = pdf.GetData();
         * Response.Clear();
         * Response.ContentType = "application/pdf";
         * Response.AddHeader("content-disposition", "inline;filename=FileName.pdf");
         * Response.AddHeader("content-length", data.Length.ToString());
         * Response.Buffer = true;
         * Response.BinaryWrite(data);
         * Response.End();  // this is required or else the pdf will open in a new window
         */
    }
Exemplo n.º 13
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.RequirePermission(Affinity.RolePermission.SubmitOrders);
        this.Master.SetLayout("Order Details", MasterPage.LayoutStyle.ContentOnly);

        string id = NoNull.GetString(Request["id"]);

        // this is used to track if a property changes was submitted
        int changeId = 0;

        Affinity.Order order = new Affinity.Order(this.phreezer);
        order.Load(id);

        // make sure this user has permission to make updates to this order
        if (!order.CanRead(this.GetAccount()))
        {
            this.Crash(300, "Permission denied.");
        }

        //order.CustomerStatusCode
        //order.InternalStatusCode

        lblWorkingId.Text = order.WorkingId;

        txtCustomerId.Text = order.CustomerId;

        txtClientName.Text       = order.ClientName;
        txtPIN.Text              = order.Pin;
        txtAdditionalPins.Text   = order.AdditionalPins;
        txtPropertyAddress.Text  = order.PropertyAddress;
        txtPropertyAddress2.Text = order.PropertyAddress2;
        txtPropertyCity.Text     = order.PropertyCity;
        txtPropertyState.Text    = order.PropertyState;
        txtPropertyZip.Text      = order.PropertyZip;
        txtCustomerId.Text       = order.CustomerId;
        txtPropertyCounty.Text   = order.PropertyCounty;
        txtClosingDate.Text      = order.ClosingDate.ToShortDateString();

        // show any attachments that go with this order
        Affinity.Attachments        atts = new Affinity.Attachments(this.phreezer);
        Affinity.AttachmentCriteria attc = new Affinity.AttachmentCriteria();
        attc.OrderId = order.Id;
        atts.Query(attc);

        // see if the user has access to the attachment
        Affinity.AttachmentRole          ardao  = new Affinity.AttachmentRole(this.phreezer);
        Affinity.AttachmentRolesCriteria arcrit = new Affinity.AttachmentRolesCriteria();
        arcrit.RoleCode = this.GetAccount().RoleCode;

        foreach (Affinity.Attachment att in atts)
        {
            arcrit.AttachmentPurposeCode = att.AttachmentPurpose.Code;
            Affinity.AttachmentRoles aroles = ardao.GetAttachmentRoles(arcrit);

            // if the user has permission to view this attachment
            if (aroles.Count > 0 || this.GetAccount().Id == order.OriginatorId)
            {
                pnlAttachments.Controls.Add(new LiteralControl("<div><a class=\"attachment\" href=\"MyAttachment.aspx?id=" + att.Id + "\">" + att.Name + "</a> (" + att.Created.ToString("M/dd/yyyy hh:mm tt") + ")</div>"));
            }
        }

        // show the entire order history
        Affinity.RequestCriteria rc = new Affinity.RequestCriteria();
        rc.AppendToOrderBy("Created", true);
        rGrid.DataSource = order.GetOrderRequests(rc);
        rGrid.DataBind();

        // show the available actions that can be done with this order
        Affinity.RequestTypes rts = order.GetAvailableRequestTypes();
        pnlActions.Controls.Add(new LiteralControl("<div class=\"actions\">"));
        foreach (Affinity.RequestType rt in rts)
        {
            pnlActions.Controls.Add(new LiteralControl("<div><a class=\"add\" href=\"MyRequestSubmit.aspx?id=" + order.Id + "&code=" + rt.Code + "\">Add a " + rt.Description + " to this Order</a></div>"));
        }
        pnlActions.Controls.Add(new LiteralControl("<div><a class=\"add\" href=\"documents.aspx?id=" + order.Id + "\">Closing Document Manager – Forms</a></div>"));
        pnlActions.Controls.Add(new LiteralControl("</div>"));

        // show the details for the active requests
        Affinity.Requests rs = order.GetCurrentRequests();

        foreach (Affinity.Request r in rs)
        {
            // we don't want to show changes to the property information
            if (r.RequestType.Code != Affinity.RequestType.DefaultChangeCode)
            {
                XmlForm xf = new XmlForm(this.GetAccount());

                //Hashtable labels = xf.GetLabelHashtable(r.RequestType.Definition);
                Hashtable responses = XmlForm.GetResponseHashtable(r.Xml);

                pnlRequests.Controls.Add(new LiteralControl("<div class=\"groupheader\">" + r.RequestType.Description
                                                            + " [<a href=\"MyRequestSubmit.aspx?change=" + r.Id + "&id=" + order.Id + "&code=" + r.RequestType.Code + "\">Edit</a>]"
                                                            + "</div>"));
                pnlRequests.Controls.Add(new LiteralControl("<fieldset class=\"history\">"));

                // add the basic info
                pnlRequests.Controls.Add(NewLine("Request Status", r.RequestStatus.Description));
                pnlRequests.Controls.Add(NewLine("Notes", r.Note));
                pnlRequests.Controls.Add(NewLine("Submitted", r.Created.ToString("MM/dd/yyyy hh:mm tt")));

                ArrayList keys = new ArrayList(responses.Keys);
                keys.Sort();

                foreach (string key in keys)
                {
                    // we check for fields ending with "_validator" due to a bug with order prior to 03/13/07
                    // if (responses[key].ToString().Equals("") == false)
                    if (responses[key].ToString().Equals("") == false && key.EndsWith("_validator") == false)
                    {
                        //pnlRequests.Controls.Add(new LiteralControl("<div>" + labels[key].ToString() + ": " + responses[key].ToString() + "</div>"));
                        pnlRequests.Controls.Add(NewLine(key, responses[key]));
                    }
                }

                pnlRequests.Controls.Add(new LiteralControl("</fieldset>"));
            }
            else
            {
                changeId = r.Id;
            }
        }

        lnkChange.NavigateUrl = "MyRequestSubmit.aspx?id=" + order.Id + "&change=" + changeId + "&code=" + Affinity.RequestType.DefaultChangeCode;
    }
Exemplo n.º 14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        /*
         * // get stack trace
         * System.Diagnostics.StackFrame fr = new System.Diagnostics.StackFrame(1, true);
         * System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(fr);
         * Response.Write( "method = " + fr.GetMethod().Name + " trace = " + st.ToString() );
         */
        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);
        PageBase pb = (PageBase)this.Page;

        Affinity.Account acc      = pb.GetAccount();
        string           contents = "";

        int id = NoNull.GetInt(Request["id"], 0);

        //Response.Write(Request["file"]);
        //Response.End();

        if (id > 0)
        {
            Affinity.Order order = new Affinity.Order(this.phreezer);
            order.Load(id);

            int filecount = 0;
            this.Master.SetLayout("Documents", MasterPage.LayoutStyle.ContentOnly);
            if (Request["file"] != null)
            {
                string [] file        = Request["file"].Split(',');
                string [] MailAddress = "".Split(',');

                if (Request["MailAddress"] != null)
                {
                    MailAddress = Request["MailAddress"].Split(',');
                }

                for (int i = 0; i < file.Length; i++)
                {
                    if ((file[i].Equals("WD") || file[i].Equals("WD_S") || file[i].Equals("WD_JT") || file[i].Equals("WD_TE")) && Request["warrantyfile"] == null)
                    {
                        continue;
                    }
                    string path = HttpContext.Current.Server.MapPath(".") + "\\downloads\\" + file[i] + ".xml";
                    if (File.Exists(path))
                    {
                        filecount++;
                    }
                }

                //Response.Write(path);

                string header = "";
                string footer = "";

                using (FileStream fs = new FileStream(HttpContext.Current.Server.MapPath(".") + "\\downloads\\header.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite))
                {
                    using (StreamReader sr = new StreamReader(fs))
                    {
                        header = sr.ReadToEnd() + "\n";
                    }
                }

                using (FileStream fs = new FileStream(HttpContext.Current.Server.MapPath(".") + "\\downloads\\footer.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite))
                {
                    using (StreamReader sr = new StreamReader(fs))
                    {
                        footer = sr.ReadToEnd() + "\n";
                    }
                }

                contents = header;

                for (int i = 0; i < file.Length; i++)
                {
                    if ((file[i].Equals("WD") || file[i].Equals("WD_S") || file[i].Equals("WD_JT") || file[i].Equals("WD_TE")) && Request["warrantyfile"] == null)
                    {
                        continue;
                    }
                    string path = HttpContext.Current.Server.MapPath(".") + "\\downloads\\" + file[i] + ".xml";
                    if (File.Exists(path))
                    {
                        using (FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite))
                        {
                            using (StreamReader sr = new StreamReader(fs))
                            {
                                contents += sr.ReadToEnd();
                                if ((i + 1) < filecount)
                                {
                                    contents += "\n\n\n<w:p w:rsidR=\"00F4055C\" w:rsidRDefault=\"00F4055C\"/><w:p w:rsidR=\"005D7E36\" w:rsidRDefault=\"005D7E36\"><w:r><w:br w:type=\"page\"/></w:r></w:p><w:p w:rsidR=\"005D7E36\" w:rsidRDefault=\"005D7E36\"><w:bookmarkStart w:id=\"0\" w:name=\"_GoBack\"/><w:bookmarkEnd w:id=\"0\"/></w:p>";
                                }
                            }
                        }
                    }
                }


                contents += footer;

                //Response.Write(contents);

                //Response.End();
                string   County              = "";
                string   CommittmentDate     = "";
                string   Grantee             = "";
                string   Grantor             = "";
                string   Grantee2            = "";
                string   Grantor2            = "";
                DateTime DeedDate            = order.ClosingDate;
                string   ContractDate        = "";
                string   BuyersName          = "";
                string   SellersName         = "";
                string   SellersAddress      = "";
                string   BuyersAddress       = "";
                string   GrantorAddressLine1 = "";
                string   GrantorAddressLine2 = "";
                string   GrantorCity         = "";
                string   GrantorState        = "";
                string   GrantorZip          = "";
                string   GrantorCounty       = "";
                DateTime now                    = DateTime.Now;
                string   DateDay                = Ordinal(now.Day).ToString();
                string   DateMonth              = now.ToString("MMMM");
                string   DateYear               = now.ToString("yyyy");
                string   PIN                    = "";
                string   SellersAttorney        = "";
                string   SellersAttorneyAddress = "";

                int    day             = DeedDate.Day;
                string DeedDateOrdinal = day.ToString();

                if (day == 11 || day == 12 || day == 13)
                {
                    DeedDateOrdinal += "th";
                }
                else
                {
                    switch (day % 10)
                    {
                    case 1: DeedDateOrdinal += "st"; break;

                    case 2: DeedDateOrdinal += "nd"; break;

                    case 3: DeedDateOrdinal += "rd"; break;

                    default: DeedDateOrdinal += "th"; break;
                    }
                }

                //Response.Write(request.Xml);
                //Response.End();

                try {
                    XmlDocument doc = new XmlDocument();
                    // show the details for the active requests
                    Affinity.Requests rs = order.GetCurrentRequests();

                    foreach (Affinity.Request r in rs)
                    {
                        if (r.IsCurrent)
                        {
                            doc.LoadXml(r.Xml);
                            //Response.Write(r.Xml);
                            //Response.End();

                            XmlNode node = doc.SelectSingleNode("//response/field[@name = 'CommittmentDeadline']");
                            if (node != null)
                            {
                                CommittmentDate = XMLEscape(node.InnerText.Replace("T:00:00:00", ""));
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Seller']");
                            if (node != null)
                            {
                                SellersName = XMLEscape(node.InnerText);
                            }
                            Grantor = SellersName;

                            node = doc.SelectSingleNode("//response/field[@name = 'Seller1Name2']");
                            if (node != null)
                            {
                                Grantor2 = " and " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer']");
                            if (node != null)
                            {
                                BuyersName = XMLEscape(node.InnerText);
                            }
                            Grantee = BuyersName;

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer1Name2']");
                            if (node != null)
                            {
                                Grantee2    = " and " + XMLEscape(node.InnerText);
                                BuyersName += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer2Name1']");
                            if (node != null)
                            {
                                BuyersName += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer2Name2']");
                            if (node != null)
                            {
                                BuyersName += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer3Name1']");
                            if (node != null)
                            {
                                BuyersName += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer3Name2']");
                            if (node != null)
                            {
                                BuyersName += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer4Name1']");
                            if (node != null)
                            {
                                BuyersName += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer4Name2']");
                            if (node != null)
                            {
                                BuyersName += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer5Name1']");
                            if (node != null)
                            {
                                BuyersName += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'Buyer5Name2']");
                            if (node != null)
                            {
                                BuyersName += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'ApplicantAddress']");
                            if (node != null)
                            {
                                BuyersAddress = XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'ApplicantAddress2']");
                            if (node != null)
                            {
                                BuyersAddress += " " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'ApplicantCity']");
                            if (node != null)
                            {
                                BuyersAddress += " " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'ApplicantState']");
                            if (node != null)
                            {
                                BuyersAddress += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'ApplicantZip']");
                            if (node != null)
                            {
                                BuyersAddress += " " + XMLEscape(node.InnerText);
                            }
                            BuyersAddress = BuyersAddress.Trim();

                            node = doc.SelectSingleNode("//response/field[@name = 'SellersAttorneyName']");
                            if (node != null)
                            {
                                SellersAttorney = XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'SellersAttorneyAddress']");
                            if (node != null)
                            {
                                SellersAttorneyAddress = XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'SellersAttorneyAddress2']");
                            if (node != null)
                            {
                                SellersAttorneyAddress += " " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'SellersAttorneyCity']");
                            if (node != null)
                            {
                                SellersAttorneyAddress += " " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'SellersAttorneyState']");
                            if (node != null)
                            {
                                SellersAttorneyAddress += ", " + XMLEscape(node.InnerText);
                            }

                            node = doc.SelectSingleNode("//response/field[@name = 'SellersAttorneyZip']");
                            if (node != null)
                            {
                                SellersAttorneyAddress += " " + XMLEscape(node.InnerText);
                            }

                            GrantorAddressLine1 = XMLEscape(order.PropertyAddress);
                            GrantorAddressLine2 = XMLEscape(order.PropertyAddress2);
                            GrantorCity         = XMLEscape(order.PropertyCity);
                            GrantorState        = XMLEscape(order.PropertyState);
                            GrantorZip          = XMLEscape(order.PropertyZip);
                            GrantorCounty       = XMLEscape(order.PropertyCounty);

                            SellersAddress = GrantorAddressLine1 + " " + GrantorAddressLine2 + " " + GrantorCity + ", " + GrantorState + " " + GrantorZip;

                            ContractDate = XMLEscape(order.ClosingDate.ToString()).Replace(" 12:00:00 AM", "");

                            County = order.PropertyCounty;
                            PIN    = order.Pin;
                        }
                    }
                } catch (Exception err) {}

                contents = contents.Replace("[COUNTY]", County).Replace("[GRANTOR]", Grantor).Replace("[GRANTOR2]", Grantor2).Replace("[GRANTORCITY]", GrantorCity).Replace("[GRANTORCOUNTY]", GrantorCounty).Replace("[GRANTORADDRESSLINE1]", GrantorAddressLine1).Replace("[GRANTORADDRESSLINE2]", GrantorAddressLine2).Replace("[GRANTEE]", Grantee).Replace("[GRANTEE2]", Grantee2).Replace("[DEEDDATE]", DeedDate.ToString("MM/dd/yyyy")).Replace("[DEEDMONTH]", DeedDate.ToString("MMMM")).Replace("[DEEDYEAR]", DeedDate.ToString("yyyy")).Replace("[DEEDDAY]", DeedDateOrdinal).Replace("[CONTRACTDATE]", ContractDate).Replace("[BUYERSNAME]", BuyersName).Replace("[BUYERSADDRESS]", BuyersAddress).Replace("[SELLERSNAME]", SellersName).Replace("[SELLERSADDRESS]", SellersAddress).Replace("[COMMITMENTDATE]", CommittmentDate).Replace("[DATEDAY]", DateDay).Replace("[DATEMONTH]", DateMonth).Replace("[DATEYEAR]", DateYear).Replace("[PIN]", PIN).Replace("[SELLERSATTORNEY]", SellersAttorney).Replace("[SELLERSATTORNEYADDRESS]", SellersAttorneyAddress);

                contents = contents.Replace("[MAILTONAME]", "");
                contents = contents.Replace("[MAILTOADDRESS1]", "");
                contents = contents.Replace("[MAILTOADDRESS2]", "");

                contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type month]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type year]\" </w:instrText>", "");

                if (!County.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type in county]\" </w:instrText>", "");
                }

                if (!CommittmentDate.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type in commitment date]\" </w:instrText>", "");
                }

                if (!Grantee.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantee's name]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantees' names]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantee's name]\" </w:instrText>", "");
                }

                if (!Grantor.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantor's name]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantors' names]\" </w:instrText>", "");
                }

                if (!GrantorAddressLine1.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantor's address line 1]\" </w:instrText>", "");
                }

                if (!GrantorAddressLine1.Equals("") || !GrantorAddressLine2.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantor's address line 2]\" </w:instrText>", "");
                }

                if (!GrantorCity.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantors' town]\" </w:instrText>", "");
                }

                if (!GrantorCounty.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantors’s County]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type county]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type in County}\" </w:instrText>", "");
                }

                if (!DeedDate.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type in date of deed]\" </w:instrText>", "");
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type month of deed]\" </w:instrText>", "");
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type date of deed]\" </w:instrText>", "");
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type month of deed]\" </w:instrText>", "");
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type year of deed]\" </w:instrText>", "");
                }

                if (!ContractDate.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type contract date]\" </w:instrText>", "");
                }

                if (!SellersName.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type sellers' names]\" </w:instrText>", "");
                }

                if (!BuyersName.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type buyers' name]\" </w:instrText>", "");
                }

                if (!BuyersAddress.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type buyers' address]\" </w:instrText>", "");
                }

                if (!SellersAddress.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type sellers' address]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesInDoc \"[Click and type property address]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantee's address]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type property address]\" </w:instrText>", "").Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type grantees' address]\" </w:instrText>", "");
                }

                if (!PIN.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type PIN]\" </w:instrText>", "");
                }

                if (!SellersAttorney.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type Attorney's Name]\" </w:instrText>", "");
                }

                if (!SellersAttorneyAddress.Equals(""))
                {
                    contents = contents.Replace("<w:instrText xml:space=\"preserve\"> MACROBUTTON  AcceptAllChangesShown \"[Click here and type Attorney's Address]\" </w:instrText>", "");
                }

                /*
                 * string fileNameXML = HttpContext.Current.Server.MapPath(".") + "\\downloads\\Disclosure_Agent.doc";
                 *    string FileName = HttpContext.Current.Server.MapPath(".") + "\\downloads\\tested.xml";
                 *
                 *                 Document dc = new Document();
                 *            dc.LoadFromFile(fileNameXML, FileFormat.Doc);
                 *            dc.SaveToFile(FileName, FileFormat.Xml);
                 *            //dc.SaveToStream(HttpContext.Current.Response.OutputStream, FileFormat.Xml);
                 */

                int len = contents.Length + 50;
                HttpContext.Current.Response.ContentType = "application/ms-word";
                HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=ATS.doc");
                HttpContext.Current.Response.AppendHeader("Content-Length", len.ToString());

                HttpContext.Current.Response.Write(contents + "                                                  ");
                HttpContext.Current.Response.Flush();
            }
        }
    }
Exemplo n.º 15
0
    /// <summary>
    /// The form controls are created at this point.  if we create them at page load
    /// then their viewstate will not be persisted.
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    override protected void PageBase_Init(object sender, System.EventArgs e)
    {
        bool isRefinance = (Request["Refinance"] != null && Request["Refinance"].Equals("True"));

        // we have to call the base first so phreezer is instantiated
        base.PageBase_Init(sender, e);

        int orderId = NoNull.GetInt(Request["id"], 0);

        string requestCode = NoNull.GetString(Request["code"], Affinity.RequestType.DefaultCode);


        this.order = new Affinity.Order(this.phreezer);
        order.Load(orderId);

        // make sure this user has permission to make updates to this order
        if (!order.CanUpdate(this.GetAccount()))
        {
            this.Crash(300, "Permission denied.");
        }

        this.rtype = new Affinity.RequestType(this.phreezer);
        rtype.Load(requestCode);

        this.xmlForm = new XmlForm(this.order.Account);

        this.changeId = NoNull.GetInt(Request["change"], 0);
        this.isChange = (!changeId.Equals(0));

        if (this.rtype.Code.Equals("ClerkingRequest"))
        {
            ContentFooterSpan.InnerHtml = "&copy; Copyright <%=DateTime.Now.Year.ToString() %>, Advocate Title Services, LLC";
        }

        string busindxml = "<field name=\"BusinessLicenseID\">" + this.GetAccount().BusinessLicenseID + "</field>" + "<field name=\"IndividualLicenseID\">" + this.GetAccount().IndividualLicenseID + "</field>";

        if (this.isChange)
        {
            // create a form for a change request
            Affinity.Request req = new Affinity.Request(this.phreezer);
            req.Load(changeId);
            pnlForm.Controls.Add(this.xmlForm.GetFormFieldControl(rtype.Definition, req.Xml.Replace("</response>", "") + busindxml + "</response>"));

            this.btnCancelChange.Visible = true;
            this.btnChange.Visible       = true;
            this.btnCancelSubmit.Visible = false;
            this.btnSubmit.Visible       = false;
        }
        else if (rtype.Code == Affinity.RequestType.DefaultChangeCode)
        {
            // this is a change to the main order, we store this as a request as well
            // but we treat it a little bit differently
            string resXml = XmlForm.XmlToString(order.GetResponse());
            pnlForm.Controls.Add(this.xmlForm.GetFormFieldControl(rtype.Definition, resXml.Replace("</response>", "") + busindxml + "</response>"));

            this.btnCancelChange.Visible = true;
            this.btnChange.Visible       = true;
            this.btnCancelSubmit.Visible = false;
            this.btnSubmit.Visible       = false;
        }
        else
        {
            // create a form for a new request
            //string reqXml = XmlForm.XmlToString(order.GetResponse());
            string reqXml = this.GetAccount().PreferencesXml;

            if (this.rtype.Code.Equals("ClerkingRequest"))
            {
                Affinity.RequestCriteria rc = new Affinity.RequestCriteria();
                rc.RequestTypeCode = "Order";
                Affinity.Requests reqs = order.GetOrderRequests(rc);

                if (reqs.Count > 0)
                {
                    Affinity.Request r = (Affinity.Request)reqs[reqs.Count - 1];


                    //log.Debug(r.Xml);
                    reqXml = reqXml.Replace("</response>", "") + busindxml +
                             XmlForm.XmlToString(order.GetResponse()).Replace("<response>", "").Replace("</response>", "") +
                             r.Xml.Replace("<response>", "");
                    pnlForm.Controls.Add(this.xmlForm.GetFormFieldControl(rtype.Definition, reqXml));
                }
                else
                {
                    reqXml = reqXml.Replace("</response>", "") + busindxml +
                             XmlForm.XmlToString(order.GetResponse()).Replace("<response>", "").Replace("</response>", "");
                    pnlForm.Controls.Add(this.xmlForm.GetFormFieldControl(rtype.Definition, XmlForm.XmlToString(order.GetResponse())));
                }
            }
            else
            {
                pnlForm.Controls.Add(this.xmlForm.GetFormFieldControl(rtype.Definition, reqXml));
            }
        }
    }
Exemplo n.º 16
0
    /// <summary>
    /// This processed the order re-assign
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnDoReAssign_Click(object sender, EventArgs e)
    {
        this.RequirePermission(Affinity.RolePermission.AffinityManager);
        Affinity.Account acct = new Affinity.Account(this.phreezer);
        acct.Load(ddNewOriginator.SelectedValue);
        txtOriginator.Text = acct.FullName;

        Affinity.Request request;

        int id = NoNull.GetInt(Request["id"], 0);

        Affinity.Requests requests = new Affinity.Requests(this.phreezer);

        Affinity.RequestCriteria rc = new Affinity.RequestCriteria();
        rc.OrderId = id;
        requests.Query(rc);

        XmlDocument prefDoc = new XmlDocument();

        prefDoc.LoadXml(acct.PreferencesXml);

        foreach (Affinity.Request req in requests)
        {
            req.OriginatorId = acct.Id;

            if (req.RequestTypeCode.Equals("Order"))
            {
                XmlDocument reqDoc = new XmlDocument();
                reqDoc.LoadXml(req.Xml);

                // ApplicantName
                XmlNode reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantName']");
                XmlNode prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantName']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantAttorneyName
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantAttorneyName']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantAttorneyName']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantAddress
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantAddress']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantAddress']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantAddress2
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantAddress2']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantAddress2']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantCity
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantCity']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantCity']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantState
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantState']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantState']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantZip
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantZip']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantZip']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantPhone
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantPhone']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantPhone']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantFax
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantFax']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantFax']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantEmail
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantEmail']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantEmail']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }

                // ApplicantAttentionTo
                reqNode  = reqDoc.SelectSingleNode("//field[@name='ApplicantAttentionTo']");
                prefNode = prefDoc.SelectSingleNode("//field[@name='ApplicantAttentionTo']");

                if (prefNode != null && reqNode != null)
                {
                    reqNode.InnerText = prefNode.InnerText;
                }
                req.Xml = reqDoc.OuterXml;
                req.Update();
            }
        }

        this.order.OriginatorId = acct.Id;
        this.order.Update();

        txtOriginator.Visible = true;
        //txtOriginator.Text = request.Id.ToString() + " - " + request.OrderId.ToString();
        btnReAssign.Visible     = true;
        ddNewOriginator.Visible = false;
        btnDoReAssign.Visible   = false;
    }
Exemplo n.º 17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        this.RequirePermission(Affinity.RolePermission.SubmitOrders);
        string id           = NoNull.GetString(Request["id"]);
        string keyAttribute = NoNull.GetString(Request["key"], "sp_id");
        string format       = NoNull.GetString(Request["format"], "hash");
        string exportformat = "PFT";

        if (!format.Equals("entire"))
        {
            Affinity.Request r = new Affinity.Request(this.phreezer);
            r.Load(id);

            // make sure this user has permission to make updates to this order
            if (!r.Order.CanRead(this.GetAccount()))
            {
                this.Crash(300, "Permission denied.");
            }

            IBaseRenderer renderer = null;

            // depending on the format requested, get the correct renderer object
            switch (format)
            {
            case "entire":
                break;

            case "xml":
                exportformat = "Generic XML";
                renderer     = new XmlRenderer(r, this.GetSystemSettings());
                break;

            case "rei":
                exportformat = "REI XML";
                renderer     = new XmlREIRenderer(r, this.GetSystemSettings());
                break;

            case "change":
                exportformat = "PFT (Changes Only)";
                renderer     = new PFTChangeRenderer(r, this.GetSystemSettings());
                break;

            case "TPS":
                exportformat = "TPS";
                renderer     = new TPSServicePFTRenderer(r, this.GetSystemSettings());
                break;

            //case "special":
            //	renderer = new XmlSpecialRenderer(r, this.GetSystemSettings());
            //	break;
            default:
                renderer = new PFTRenderer(r, this.GetSystemSettings());
                break;
            }

            Affinity.ExportLog exportlog = new Affinity.ExportLog(this.phreezer);
            Affinity.Account   account   = this.GetAccount();
            exportlog.AccountID    = account.Id;
            exportlog.OrderID      = r.OrderId;
            exportlog.RequestID    = r.Id;
            exportlog.ExportFormat = exportformat;
            exportlog.Insert();

            // output the results of the renderer
            OutputRenderer(renderer, keyAttribute);
        }
        else
        {
            Affinity.RequestTypes        rts = new Affinity.RequestTypes(this.phreezer);
            Affinity.RequestTypeCriteria rtc = new Affinity.RequestTypeCriteria();
            rtc.IsActive = 1;
            rts.Query(rtc);
            Object [] renderers = new Object[rts.Count];

            IEnumerator      i = rts.GetEnumerator();
            int              j = 0;
            bool             isClerkingServices = false;
            Affinity.Account account            = this.GetAccount();
            exportformat = "Entire Order";

            while (i.MoveNext())
            {
                Affinity.RequestType rt    = (Affinity.RequestType)i.Current;
                Affinity.Order       order = new Affinity.Order(this.phreezer);
                order.Load(id);

                Affinity.RequestCriteria rc = new Affinity.RequestCriteria();
                rc.RequestTypeCode = rt.Code;
                order.GetOrderRequests(rc);

                Affinity.Requests reqs = order.GetOrderRequests(rc);
                Affinity.Request  r    = null;

                if (reqs.Count > 0)
                {
                    r = (Affinity.Request)reqs[0];

                    if (rt.Code.Equals("ClerkingRequest"))
                    {
                        isClerkingServices = true;
                    }
                    IBaseRenderer renderer = new PFTRenderer(r, this.GetSystemSettings());

                    renderers[j] = renderer;

                    j++;
                }

                if (r != null)
                {
                    Affinity.ExportLog exportlog = new Affinity.ExportLog(this.phreezer);
                    exportlog.AccountID    = account.Id;
                    exportlog.OrderID      = r.OrderId;
                    exportlog.RequestID    = r.Id;
                    exportlog.ExportFormat = exportformat;
                    exportlog.Insert();
                }
            }

            OutputMultiRenderer(renderers, keyAttribute, isClerkingServices);
        }
    }