Example #1
0
        private void InitControls()
        {
            DateTime date = DateTime.Now.AddMonths(-1);

            ProjectApplication projApp = new ProjectApplication();

            List <ProjectDetailDTO> list = projApp.GetAllProjects();

            list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");

            CompanyApplication    commpanyApp = new CompanyApplication();
            List <CompanysEntity> companyList = companyApp.GetAllCompanies();

            companyList.BindDropdown <CompanysEntity>(ddlCompanies, "CompanyName", "ID", "All", "0");
            ddlCompanies.Items.Add(new ListItem("ALL", "0"));

            ddlTickets.Items.Add(new ListItem("All", "0"));

            UserApplication    userApp     = new UserApplication();
            SearchUsersRequest requestUser = new SearchUsersRequest(
                SearchUsersType.All, false, " FirstName ", " ASC ");

            requestUser.IsSunnet = true;
            SearchUserResponse responseuser = userApp.SearchUsers(requestUser);

            ddlUsers.Items.Add(new ListItem("All", "0"));
            foreach (UsersEntity user in responseuser.ResultList)
            {
                ddlUsers.Items.Add(new ListItem(string.Format("{0} {1}", user.FirstName, user.LastName)
                                                , user.ID.ToString()));
            }
        }
Example #2
0
        /// <summary>
        /// 初始化搜索 条件
        /// </summary>
        private void InitSearchControls()
        {
            DateTime                date    = DateTime.Now.AddMonths(-1);
            ProjectApplication      projApp = new ProjectApplication();
            List <ProjectDetailDTO> listAll = projApp.GetAllProjects().Where(c => c.Title == "0_PTO").ToList();

            listAll.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");

            SearchUsersRequest requestUser = new SearchUsersRequest(
                SearchUsersType.All, false, " FirstName ", " ASC ");

            requestUser.IsSunnet = true;
            var selfid = Convert.ToInt32(ConfigurationManager.AppSettings["PTOVIEWSELF"]);

            if (list.Where(t => t.ModuleID == allid).Count() > 0)
            {
                SearchUserResponse responseuser = userApp.SearchUsers(requestUser);
                ddlUsers.Items.Add(new ListItem("All", "0"));
                foreach (UsersEntity user in responseuser.ResultList)
                {
                    ddlUsers.Items.Add(new ListItem(string.Format("{0} {1}", user.FirstName, user.LastName)
                                                    , user.ID.ToString()));
                }
            }
            else
            {
                ddlUsers.Items.Add(new ListItem(string.Format("{0} {1}", UserInfo.FirstName, UserInfo.LastName)
                                                , UserInfo.ID.ToString()));
            }
        }
Example #3
0
        private void InitControls()
        {
            DateTime date = DateTime.Now.AddMonths(-1);
            //txtStartDate.Text = new DateTime(date.Year, date.Month, 1).ToString("MM/dd/yyyy");
            //txtEndDate.Text = new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month)).ToString("MM/dd/yyyy");

            ProjectApplication      projApp = new ProjectApplication();
            List <ProjectDetailDTO> list    = projApp.GetAllProjects();

            list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");

            ddlTickets.Items.Add(new ListItem("All", "0"));

            UserApplication    userApp     = new UserApplication();
            SearchUsersRequest requestUser = new SearchUsersRequest(
                SearchUsersType.All, false, " FirstName ", " ASC ");

            requestUser.IsSunnet = true;
            SearchUserResponse responseuser = userApp.SearchUsers(requestUser);

            ddlUsers.Items.Add(new ListItem("All", "0"));
            foreach (UsersEntity user in responseuser.ResultList)
            {
                ddlUsers.Items.Add(new ListItem(string.Format("{0} {1}", user.FirstName, user.LastName)
                                                , user.ID.ToString()));
            }
        }
Example #4
0
        private void InitControls()
        {
            ProjectApplication      projApp = new ProjectApplication();
            List <ProjectDetailDTO> list    = projApp.GetAllProjects();

            list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");
            ddlTickets.Items.Add(new ListItem("All", "0"));
        }
Example #5
0
        private void InitControls()
        {
            DateTime                date    = DateTime.Now.AddMonths(-1);
            ProjectApplication      projApp = new ProjectApplication();
            List <ProjectDetailDTO> list    = projApp.GetAllProjects();

            list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");
            RolesEnum.DEV.ToSelectList().ToList().BindDropdown(ddlSource, "Text", "Value", DefaulAllText, "0", QS("source"));
        }
        private void BindProject()
        {
            CompanysRepositorySqlDataProvider crsp = new CompanysRepositorySqlDataProvider();
            int cid = crsp.GetCompanyId("Sunnet");
            IList <ProjectDetailDTO> listProject = proApp.GetAllProjects();

            listProject = listProject.Where(c => c.CompanyID != cid).ToList();

            this.ddlProject.DataSource = listProject;
            this.ddlProject.DataBind((ProjectDetailDTO project, string status) => project.Status.ToString() == status);
            this.ddlProject.SelectItem("0");
        }
Example #7
0
        private bool CurrentPTOHoursNotEnough()
        {
            var StartDate      = new DateTime(DateTime.Now.Year, 1, 1);
            var EndDate        = StartDate.AddYears(1).AddDays(-1);
            var ptopro         = projApp.GetAllProjects().Where(c => c.Title == "0_PTO").FirstOrDefault();
            var CurrentUserpto = PtosHelper.ReGeneratePtos(ptopro.ID, StartDate, EndDate, UserInfo.UserID).FirstOrDefault();

            if (CurrentUserpto != null && CurrentUserpto.Remaining <= 0)
            {
                return(true);
            }
            return(false);
        }
Example #8
0
        private void BindProject()
        {
            ProjectApplication proApp = new ProjectApplication();

            if (ddlCompanies.SelectedValue == "0")
            {
                List <ProjectDetailDTO> list = proApp.GetAllProjects();
                list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");
            }
            else
            {
                SearchProjectsRequest request = new SearchProjectsRequest(SearchProjectsType.List, false, "Title", "ASC");
                request.CompanyID = int.Parse(ddlCompanies.SelectedValue);
                SearchProjectsResponse response = proApp.SearchProjects(request);
                response.ResultList.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");
            }
        }
Example #9
0
        private void InitDdlBind()
        {
            CompanysRepositorySqlDataProvider crsp = new CompanysRepositorySqlDataProvider();
            int cid = crsp.GetCompanyId("Sunnet");
            IList <ProjectDetailDTO> listProject = proApp.GetAllProjects();

            listProject = listProject.Where(c => c.CompanyID != cid).ToList();

            this.ddlProject.DataSource = listProject;
            this.ddlProject.DataBind((ProjectDetailDTO project, string status) => project.Status.ToString() == status);
            this.ddlProject.SelectItem("0");

            this.tm_ddlProject.DataSource = listProject;
            this.tm_ddlProject.DataBind((ProjectDetailDTO project, string status) => project.Status.ToString() == status);
            this.tm_ddlProject.SelectItem("0");

            List <CompanysEntity> list = companyApp.GetCompaniesHasProject();

            list.BindDropdown(tm_ddlCompany, "CompanyName", "ComID", "All", "0", QS("company"));
        }