예제 #1
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);
    }
    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);
            }
        }
    }
예제 #3
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();
    }
    /// <summary>
    /// When the Reload button is clicked, the request types are reloaded from xml
    /// </summary>
    protected void btnReload_Click(object sender, EventArgs e)
    {
        string path = Server.MapPath("./RequestTypes/");

        Affinity.RequestType rt = new Affinity.RequestType(this.phreezer);
        rt.ReloadAllDefinitions(path);
        this.Master.ShowFeedback("Request Types have been reloaded", MasterPage.FeedbackType.Information);
    }
예제 #5
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);

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

        xmlForm = new XmlForm(this.GetAccount());

        LoadForm();
    }
예제 #6
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);

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

        xmlForm = new XmlForm(this.GetAccount());

        LoadForm();
        //Affinity.SystemSetting ss = new Affinity.SystemSetting(this.phreezer);
        //ss.Load("SYSTEM");

        //pnlForm.Controls.Add(xmlForm.GetFormFieldControl(rtype.Definition, ss.Data));
    }
예제 #7
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));
            }
        }
    }
예제 #8
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);
        }
    }