Exemple #1
0
    private void FillContactList()
    {
        if (!string.IsNullOrEmpty(Request["ProspectID"]))
        {
            Int64         ProspectId  = Convert.ToInt64(Request["ProspectID"]);
            FranchisorDAL objDAL      = new FranchisorDAL();
            var           listContact = objDAL.GetContactByProspect(ProspectId, 0);
            EContact[]    objContacts = null;

            if (listContact != null)
            {
                objContacts = listContact.ToArray();
            }

            DataTable tbltemp = new DataTable();

            tbltemp.Columns.Add("ContactID");
            tbltemp.Columns.Add("FullName");
            tbltemp.Columns.Add("Title");
            tbltemp.Columns.Add("Notes");

            if (objContacts != null && objContacts.Length > 0)
            {
                string Notes = string.Empty;
                for (int i = 0; i < objContacts.Length; i++)
                {
                    Notes = objContacts[i].ContactNotes[0].Notes;
                    if (Notes == "")
                    {
                        Notes = "Not Available";
                    }
                    tbltemp.Rows.Add(objContacts[i].ContactID, objContacts[i].FirstName + " " + objContacts[i].LastName, objContacts[i].DesignationTitle, Notes);
                }
                divGridContacts.Style.Add(HtmlTextWriterStyle.Display, "block");
            }
            tbltemp.DefaultView.Sort = "FullName asc";
            grdContacts.DataSource   = tbltemp;
            grdContacts.DataBind();
        }
    }