public List <WCFEmployee> populateEmployee(string headcode) { int hcode = Convert.ToInt32(headcode); List <WCFEmployee> wcfelist = new List <WCFEmployee>(); List <Employee> elist = dhmanager.PopulateEmpList(hcode); foreach (Employee i in elist) { WCFEmployee e = WCFEmployee.Make(i.employeecode, i.employeename, i.employeeemail, i.deptcode, i.role, i.del); wcfelist.Add(e); } return(wcfelist); }
protected void Page_Load(object sender, EventArgs e) { IIdentity id = User.Identity; headcode = Convert.ToInt32(User.Identity.Name); e1 = d.getDepartmentRepresentative(headcode); if (!IsPostBack) { List <Employee> elist = d.PopulateEmpList(headcode); DropDownList1.DataSource = elist; DropDownList1.DataTextField = "employeename"; DropDownList1.DataValueField = "employeecode"; DropDownList1.DataBind(); Label1.Text = e1.employeename; } }