Esempio n. 1
0
        public static string GetRecursiveTeam(string username)
        {
            List <string> teamList = new List <string>();

            List <StaffData> staffList = StaffBiz.GetStaffList();
            var logInStaffId           = staffList.Where(p => p.UserName.Trim().ToUpper() == username.Trim().ToUpper()).Select(p => p.StaffId).FirstOrDefault();
            var logInCocTeam           = staffList.Where(p => p.UserName.Trim().ToUpper() == username.Trim().ToUpper()).Select(p => p.CocTeam).FirstOrDefault();

            if (logInStaffId != null)
            {
                if (!string.IsNullOrEmpty(logInCocTeam) && logInCocTeam.Trim().ToUpper().StartsWith("COC"))
                {
                    teamList.Add(logInCocTeam);
                }

                FindTeamRecusive(logInStaffId, teamList, staffList);
            }

            string tmpList = "";

            foreach (string team in teamList)
            {
                tmpList += (tmpList == "" ? "" : ",") + "'" + team + "'";
            }

            return(tmpList);
        }
Esempio n. 2
0
        public static string GetRecursiveStaff(string username)
        {
            string    userList = "";
            ArrayList arrlist  = new ArrayList();

            List <StaffData> staffList = StaffBiz.GetStaffList();
            var logInStaffId           = staffList.Where(p => p.UserName.Trim().ToUpper() == username.Trim().ToUpper()).Select(p => p.StaffId).FirstOrDefault();
            var logInEmpCode           = staffList.Where(p => p.UserName.Trim().ToUpper() == username.Trim().ToUpper()).Select(p => p.EmpCode).FirstOrDefault();

            if (logInStaffId != null)
            {
                if (!string.IsNullOrEmpty(logInEmpCode))
                {
                    arrlist.Add("'" + logInEmpCode + "'");
                }

                FindStaffRecusive(logInStaffId, arrlist, staffList);
            }

            foreach (string empCode in arrlist)
            {
                userList += (userList == "" ? "" : ",") + empCode;
            }

            return(userList);
        }
Esempio n. 3
0
 private void BindCreateByLead()
 {
     cmbCreatebySearch.DataSource     = StaffBiz.GetStaffList(cmbCreatebyBranchSearch.SelectedItem.Value); //SlmScr003Biz.GetStaffAllData(cmbCreatebyBranchSearch.SelectedItem.Value);
     cmbCreatebySearch.DataTextField  = "TextField";
     cmbCreatebySearch.DataValueField = "ValueField";
     cmbCreatebySearch.DataBind();
     cmbCreatebySearch.Items.Insert(0, new ListItem("", ""));
 }
Esempio n. 4
0
 private void BindOwnerLead()
 {
     cmbOwner.DataSource     = StaffBiz.GetStaffList(cmbOwnerBranch.SelectedItem.Value);
     cmbOwner.DataTextField  = "TextField";
     cmbOwner.DataValueField = "ValueField";
     cmbOwner.DataBind();
     cmbOwner.Items.Insert(0, new ListItem("", ""));
 }