public void RetrieveContact() { try { objUserContacts = new UserContacts(); objBL_UserContacts = new BL_UserContacts(); lstUserContacts = objBL_UserContacts.SelectUserContactsListforgrid(Convert.ToInt16(HttpUtility.UrlDecode(Request.QueryString["CntId"]).ToString())); if (lstUserContacts.Count > 0) { txtCampaignName.Value = lstUserContacts[0].ContactName; EmailID.Value = lstUserContacts[0].Email_id; if (lstUserContacts[0].DateofBirth != null) { DateTime dt = Convert.ToDateTime(lstUserContacts[0].DateofBirth.ToString()); ; dtScheduledatetime.Value = String.Format("{0:dd/MM/yyyy}", dt); } if (lstUserContacts[0].Email_id != null) EmailID.Value = lstUserContacts[0].Email_id; if (lstUserContacts[0].City1 != null) City.Value = lstUserContacts[0].City1; if (lstUserContacts[0].Country1 != null) Country.Value = lstUserContacts[0].City1; if (lstUserContacts[0].Designation != null) Designation.Value = lstUserContacts[0].Designation; if (lstUserContacts[0].ContactNo != null) ContactNo.Value = lstUserContacts[0].ContactNo; if (lstUserContacts[0].Addressline1 != null) Address.Value = lstUserContacts[0].Addressline1; if (lstUserContacts[0].State1 != null) State.Value = lstUserContacts[0].State1; } } catch (Exception ex) { New_EmailCampaign.App_Code.GlobalFunction.StoreLog("ContactsAdd.aspx:RetrieveContact() - " + ex.Message); } }
private void gridcontactsbind() { try { objUserContacts = new UserContacts(); lstUserContacts = new List<UserContacts>(); objBL_UserContacts = new BL_UserContacts(); lstUserContacts = objBL_UserContacts.SelectContactsonSelectedID(Convert.ToInt32(Session["CompanyID"].ToString()), Session["SelectContactID"].ToString()); gvAddContacts.DataSource = lstUserContacts; gvAddContacts.DataBind(); } catch (Exception ex) { New_EmailCampaign.App_Code.GlobalFunction.StoreLog("CreateCampign.aspx:gridcontactsbind() - " + ex.Message); } }