protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LeadsUtil.BindProjects(dd_project, dd_buckets, LeadsUtil.GetProjectParentIDFromID(LeadsUtil.GetLastViewedProjectID()), null, false); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Util.SetRebindOnWindowClose(this, false); bool error = false; if (Request.QueryString["cpy_id"] != null && !String.IsNullOrEmpty(Request.QueryString["cpy_id"])) { hf_cpy_id.Value = Request.QueryString["cpy_id"]; } else if (Request.QueryString["ctc_id"] != null && !String.IsNullOrEmpty(Request.QueryString["ctc_id"])) { hf_ctc_id.Value = Request.QueryString["ctc_id"]; String qry = "SELECT CompanyID FROM db_contact WHERE ContactID=@ContactID"; hf_cpy_id.Value = SQL.SelectString(qry, "CompanyID", "@ContactID", hf_ctc_id.Value); } else { Util.PageMessageAlertify(this, LeadsUtil.LeadsGenericError, "Error"); error = true; } // Disable adding to Leads system/selecting contacts when add_leads=false bool InLeadsMode = true; if (Request.QueryString["add_leads"] != null && Request.QueryString["add_leads"].ToString() == "false") { div_add_leads.Visible = lbl_pad.Visible = false; InLeadsMode = false; ContactManager.SelectableContacts = false; } if (!error) { if (hf_ctc_id.Value != String.Empty) { ContactManager.FocusContactID = hf_ctc_id.Value; } String[] ForcedSelectedContactIDs = null; if (hf_ctc_id.Value != String.Empty) { ForcedSelectedContactIDs = new String[] { hf_ctc_id.Value } } ; CompanyManager.BindCompany(hf_cpy_id.Value); ContactManager.BindContacts(hf_cpy_id.Value, ForcedSelectedContactIDs); if (InLeadsMode) { // Allow adding Leads to projects if this user has projects (or has used Leads system) hf_project_id.Value = LeadsUtil.GetLastViewedProjectID(); if (hf_project_id.Value != String.Empty) { div_add_leads.Visible = true; hf_parent_project_id.Value = LeadsUtil.GetProjectParentIDFromID(hf_project_id.Value); // Bind destination projects LeadsUtil.BindProjects(dd_projects, dd_buckets, hf_parent_project_id.Value, hf_project_id.Value, true); } // Otherwise disable adding Leads and allow updates to CTC/CPY only else { ContactManager.SelectableContacts = false; } } } } Util.ResizeRadWindow(this); }