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);

        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.º 3
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();
    }
Exemplo n.º 4
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));
    }
Exemplo n.º 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)
    {
        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));
            }
        }
    }