Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int leadID = 0;

            // set default button
            Page.Form.DefaultButton = btnSaveAndContinue1.UniqueID;
            Page.Form.DefaultFocus  = txtOriginalLeadDate.UniqueID;

            if (!IsPostBack)
            {
                bindProducer();

                bindState();

                bindDDL();

                if (this.Context.Items["selectedleadid"] != null && this.Context.Items["selectedleadid"].ToString().Length > 0 &&
                    Convert.ToInt32(this.Context.Items["selectedleadid"]) > 0 &&
                    this.Context.Items["view"] != null)
                {
                    //hfLeadId.Value = this.Context.Items["selectedleadid"].ToString();

                    Session["LeadIds"] = this.Context.Items["selectedleadid"].ToString();

                    ViewState["LeadIds"] = this.Context.Items["selectedleadid"].ToString();

                    hfAdminView.Value = this.Context.Items["view"].ToString();

                    // reset page for photos
                    Session["pageIndex"] = 0;

                    // update last activity date
                    LeadsManager.UpdateLastActivityDate(Convert.ToInt32(this.Context.Items["selectedleadid"]));

                    FillForm(ViewState["LeadIds"].ToString(), hfAdminView.Value);

                    bindTasks();
                }
                else
                {
                    // new lead/claim
                    pnlTasks.Visible = false;

                    txtOriginalLeadDate.Value = DateTime.Today;

                    //tr_taskPanel.Visible = false;

                    checkForTrialAccount();
                }
            }



            // 2013-07-27 tortega - refresh tasks
            if (ViewState["LeadIds"] != null && int.TryParse(ViewState["LeadIds"].ToString(), out leadID) && leadID > 0)
            {
                //bindTasks();

                pnlTasks.Visible = true;

                //buildLeadMenu();

                showControls(true);
            }
            else
            {
                showControls(false);
            }

            if (Request.Params["t"] != null)
            {
                tabContainer.ActiveTabIndex = Convert.ToInt16(Request.Params["t"]);
            }
        }