// Get Channel Name public void GetChannelByType() { ddlchannel.Items.Clear(); iCompanySetupClient Channel = new iCompanySetupClient(); CustomProfile profile = CustomProfile.GetProfile(); ddlchannel.DataSource = Channel.GetChannelName("Channel", profile.DBConnection._constr); ddlchannel.DataTextField = "Value"; ddlchannel.DataValueField = "Id"; ddlchannel.DataBind(); ListItem lst = new ListItem { Text = "-Select-", Value = "0" }; ddlchannel.Items.Insert(0, lst); Channel.Close(); }
public static List <contact> GetChannel(object objReq) { iCompanySetupClient Channel = new iCompanySetupClient(); CustomProfile profile = CustomProfile.GetProfile(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); List <contact> LocList = new List <contact>(); try { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary = (Dictionary <string, object>)objReq; //long ddlcompanyId = long.Parse(dictionary["ddlcompanyId"].ToString()); string ChannelType = "Channel"; ds = Channel.GetChannelName(ChannelType, profile.DBConnection._constr); dt = ds.Tables[0]; contact Loc = new contact(); Loc.Name = "--Select--"; Loc.Id = "0"; LocList.Add(Loc); Loc = new contact(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { Loc.Id = dt.Rows[i]["Id"].ToString(); Loc.Name = dt.Rows[i]["Value"].ToString(); LocList.Add(Loc); Loc = new contact(); } } } catch { } finally { Channel.Close(); } return(LocList); }