public string[] GetFranchiseeEmployee(string prefixText, int count, string contextKey) { List <string> items = new List <string>(); FranchiseeDAL franchiseeDAL = new FranchiseeDAL(); List <Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser> objFFUser = franchiseeDAL.GetFranchiseeEmployeeByName(prefixText, Convert.ToInt32(contextKey), 3); try { string struser = string.Empty; string strshell = string.Empty; string strrole = string.Empty; foreach (Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser objUser in objFFUser) { struser = objUser.FranchiseeUser.User.FirstName + " " + objUser.FranchiseeUser.User.LastName + "[" + objUser.FranchiseeUser.User.UserID + "]"; strrole = objUser.RoleType + "[" + objUser.RoleID + "]"; strshell = objUser.Franchisee.Name + "[" + objUser.Franchisee.FranchiseeID + "]"; items.Add(struser + " as " + strrole + " in " + strshell); } } catch (Exception ex) { items.Add(ex.Message); } return(items.ToArray()); }
/// <summary> /// Fills all the drop down with values from db /// </summary> private void GetAllDropDownInfo() { //FranchiseeFranchiseeUserService objservice = new FranchiseeFranchiseeUserService(); List <Falcon.Entity.Franchisee.EFranchiseeFranchiseeUser> arrfranchiseeuser; var franchiseeDal = new FranchiseeDAL(); arrfranchiseeuser = franchiseeDal.GetFranchiseeEmployeeByName("", 0, 6); for (int icount = 0; icount < arrfranchiseeuser.Count; icount++) { string techname = arrfranchiseeuser[icount].FranchiseeUser.User.FirstName; techname += arrfranchiseeuser[icount].FranchiseeUser.User.MiddleName.Length > 0 ? " " + arrfranchiseeuser[icount].FranchiseeUser.User.MiddleName : ""; techname += arrfranchiseeuser[icount].FranchiseeUser.User.LastName.Length > 0 ? " " + arrfranchiseeuser[icount].FranchiseeUser.User.LastName : ""; ddluploadedby.Items.Add(new ListItem(techname, arrfranchiseeuser[icount].FranchiseeFranchiseeUserID.ToString())); } ddluploadedby.Items.Insert(0, new ListItem("Select Technician", "0")); }