private void miDeleteProject_Click(object sender, EventArgs e)
        {
            if (dgvProject.SelectedRows.Count > 0)
            {
                int    projectId   = (int)dgvProject.SelectedRows[0].Cells["ID"].Value;
                string projectName = (string)dgvProject.SelectedRows[0].Cells["Name"].Value;

                DialogResult result = MessageBox.Show(string.Format("{0} isimli projeyi silmek istediğinize emin misiniz?", projectName), "Dikkat!", MessageBoxButtons.YesNo);

                bool removeResult = false;
                if (result == DialogResult.Yes)
                {
                    ProjectBusiness projectBuss = new ProjectBusiness(_user);
                    try
                    {
                        removeResult = projectBuss.Remove(projectBuss.Get(projectId));
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message);
                    }
                    MessageBox.Show(removeResult ? "Silme işlemi başarıyla gerçekleşti." : "Silme işlemi başarısız!");
                }
            }
        }
        // POST: api/Project
        public HttpResponseMessage Post([FromBody] Project proj)
        {
            IEnumerable <Project> key = null;
            string msg = "";

            try
            {
                if (proj == null)
                {
                    throw new Exception("User cannot be null");
                }
                else
                {
                    key = new ProjectBusiness(projcontext).Post(proj);
                }
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                var response = new HttpResponseMessage(HttpStatusCode.Conflict)
                {
                    Content      = new StringContent(string.Format(msg)),
                    ReasonPhrase = "Error"
                };
                return(response);
            }
            return(Request.CreateResponse(HttpStatusCode.Created, key));
        }
示例#3
0
        private void FormControlsLoad()
        {
            _pBuss = new ProjectBusiness(_user);
            if (_projectId > 0)
            {
                try
                {
                    _project = _pBuss.Get(_projectId);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }

                txtName.Text       = _project.Name;
                dtpEndDate.Value   = _project.EndDate;
                dtpStartDate.Value = _project.StartDate;
            }

            CustomerBusiness custBuss = new CustomerBusiness(_user);

            cmbCustomer.DataSource    = null;
            cmbCustomer.DataSource    = custBuss.GetAll();
            cmbCustomer.DisplayMember = "CompanyName";
            cmbCustomer.ValueMember   = "ID";
            if (_projectId > 0)
            {
                cmbCustomer.SelectedValue = _project.Customer.ID;
            }
        }
        // DELETE: api/Project/5
        public HttpResponseMessage Delete(int id)
        {
            string msg = "";
            int    key = 0;
            HttpResponseMessage response;

            try
            {
                if (id <= 0)
                {
                    throw new Exception("Parameter cannot be null");
                }
                else
                {
                    key = new ProjectBusiness(projcontext).Delete(id);
                }
            }
            catch (Exception ex)
            {
                msg      = ex.Message;
                response = new HttpResponseMessage(HttpStatusCode.Conflict)
                {
                    Content      = new StringContent(string.Format(msg)),
                    ReasonPhrase = "Error"
                };
                return(response);
            }
            return(Request.CreateResponse(HttpStatusCode.OK, key));
        }
示例#5
0
        public IHttpActionResult DeleteProject(string id)
        {
            ProjectBusiness tb        = new ProjectBusiness();
            var             isDeleted = tb.DeleteProject(id);

            return(Ok(isDeleted));
        }
示例#6
0
        protected void lnkStopUse_Click(object sender, EventArgs e)
        {
            if (hidProjectId.Value.Trim().Length > 0 && hidStatus.Value.Trim().Length > 0)
            {
                #region 日志记录
                USER_SHARE_LOGMODEL log = new USER_SHARE_LOGMODEL();
                log.LOGID           = CommonBusiness.GetSeqID("S_USER_SHARE_LOG");
                log.OPERATECONTENT  = "更改项目状态为:" + EnumPlus.GetEnumDescription(typeof(ShareEnum.ProjectStatus), hidStatus.Value);
                log.OPERATECONTENT += ",项目Id:" + hidProjectId.Value;
                log.OPERATEDATE     = DateTime.Now;
                log.OPERATETYPE     = int.Parse(ShareEnum.LogType.ChangeStatus.ToString("d"));
                log.OPERATORID      = AccountId;
                log.PROJECTID       = ProjectId;
                #endregion

                #region 保存
                if (ProjectBusiness.UpdateProjectStatus(hidProjectId.Value, hidStatus.Value, log))
                {
                    Alert("操作成功!");
                    BindData(0);
                }
                else
                {
                    Alert("操作失败,请重试!");
                }
                #endregion
            }
        }
示例#7
0
        public List <ProjectModel> GetAll()
        {
            projectBusiness = new ProjectBusiness();
            var result = projectBusiness.GetAll();

            return(result);
        }
示例#8
0
        public int UpdaterojectModel(ProjectModel prjModel)
        {
            projectBusiness = new ProjectBusiness();
            int result = projectBusiness.UpdateProjectDetails(prjModel);

            return(result);
        }
示例#9
0
        public int InserProjectModel(ProjectModel prjModel)
        {
            projectBusiness = new ProjectBusiness();
            int result = projectBusiness.InsertProjectDetails(prjModel);

            return(result);
        }
示例#10
0
        public List <ProjectModel> GetAllProjectDetails()
        {
            projectBusiness = new ProjectBusiness();
            List <ProjectModel> result = projectBusiness.GetProjectList();

            return(result);
        }
示例#11
0
        public IHttpActionResult UpdateProject([FromBody] ProjectDetails projectToUpdate)
        {
            ProjectBusiness tb = new ProjectBusiness();

            tb.UpdateProject(tb.GetProjectFromDetails(projectToUpdate));
            return(Ok(projectToUpdate));
        }
示例#12
0
        public IHttpActionResult GetProjectByID(string id)
        {
            ProjectBusiness tb = new ProjectBusiness();
            Project         selectedProject = tb.GetProjectByID(id);

            return(Ok(selectedProject));
        }
示例#13
0
        private void button1_Click(object sender, EventArgs e)
        {
            _projectBusiness = new ProjectBusiness();
            try
            {
                if (projectId < 1)
                {
                    _project                   = new Project();
                    _project.EndDate           = DtpEndDate.Value;
                    _project.StartDate         = DtpPlanStartDate.Value;
                    _project.PlanningEndDate   = dtpPlanEndDate.Value;
                    _project.PlanningStartDate = DtpPlanStartDate.Value;
                    _project.CustomerID        = (int)cmbCustomer.SelectedValue;
                    _project.Name              = txtProjectName.Text;
                    _projectBusiness.Add(_project);
                }

                else
                {
                    _project.ID                = projectId;
                    _project.EndDate           = DtpEndDate.Value;
                    _project.StartDate         = DtpPlanStartDate.Value;
                    _project.PlanningEndDate   = dtpPlanEndDate.Value;
                    _project.PlanningStartDate = DtpPlanStartDate.Value;
                    _project.CustomerID        = (int)cmbCustomer.SelectedValue;
                    _project.Name              = txtProjectName.Text;
                    _projectBusiness.Update(_project);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#14
0
 public void Create_a_project()
 {
     ProjectBusiness appBusiness = new ProjectBusiness(_projectData, _userData);
     var             result      = appBusiness.CreateProject(new ProjectDTO {
         ProjectName = "FName", Start_Date = DateTime.Now, End_Date = DateTime.Now
     });
 }
示例#15
0
 public void Update_the_project()
 {
     ProjectBusiness appBusiness = new ProjectBusiness(_projectData, _userData);
     var             result      = appBusiness.UpdateProject(new ProjectDTO {
         Project_Id = project.Project_Id, ProjectName = "FName", Start_Date = DateTime.Now, End_Date = DateTime.Now
     }, 1);
 }
        public void BenchMarkSaveTask()
        {
            TaskViewModel task = new TaskViewModel
            {
                TaskName       = "Add Task from nbench",
                StartDate      = Convert.ToDateTime("01/01/2018"),
                ProjectId      = 1,
                ProjectName    = "Project-1",
                ParentTaskId   = 1,
                ParentTaskName = "P1-Task",
                Priority       = 15,
                EndDate        = Convert.ToDateTime("12/12/2018"),
                TaskId         = 0
            };

            IRepository <ProjectTask> taskRepository       = new Repository <ProjectTask>();
            IRepository <ParentTask>  parenttaskRepository = new Repository <ParentTask>();
            IParentTaskBusiness       taskbusiness         = new ParentTaskBusiness(parenttaskRepository);

            IRepository <Project> projectRepository = new Repository <Project>();
            IRepository <User>    userRepository    = new Repository <User>();
            IProjectBusiness      projectBusiness   = new ProjectBusiness(projectRepository, userRepository, taskRepository);

            TaskBusiness taskBusiness = new TaskBusiness(taskRepository, taskbusiness, projectBusiness, userRepository);

            taskBusiness.Save(task);
        }
        // GET: api/Project/5
        public HttpResponseMessage Get(int id)
        {
            IEnumerable <Project> dt = null;

            try
            {
                if (id <= 0)
                {
                    throw new Exception("User ID cannot be null");
                }
                else
                {
                    dt = new ProjectBusiness(projcontext).GetProjects(id);
                }
            }
            catch (Exception ex)
            {
                var response = new HttpResponseMessage(HttpStatusCode.NotFound)
                {
                    Content      = new StringContent(string.Format(ex.Message)),
                    ReasonPhrase = "Error"
                };
                return(response);
            }
            return(Request.CreateResponse(HttpStatusCode.OK, dt));
        }
示例#18
0
        public IHttpActionResult GetAllProjects()
        {
            ProjectBusiness tb          = new ProjectBusiness();
            List <Project>  allProjects = tb.GetAllProjects();

            return(Ok(allProjects));
        }
示例#19
0
 protected override void OnResume()
 {
     base.OnResume();
     progressDialog.Show();
     developersBusiness = new DevelopersBusiness(this, this);
     projectBusiness    = new ProjectBusiness(this, this);
     developersBusiness.GetListDevelopers();
 }
示例#20
0
        public string AddOrUpdateProject(object project)
        {
            string result = string.Empty;

            projectBusiness = new ProjectBusiness();
            result          = projectBusiness.AddOrUpdateProject(project);
            return(result);
        }
        private void ProjectListForm_Load(object sender, EventArgs e)
        {
            _projectBusiness = new ProjectBusiness();
            List <Project> projectList = _projectBusiness.GetAll();

            dgvList.DataSource = null;
            dgvList.DataSource = projectList;
        }
示例#22
0
 public TeamLeaderForm1()
 {
     InitializeComponent();
     _tasksBusiness   = new TasksBusiness();
     _tasks           = new Tasks();
     _projectBusiness = new ProjectBusiness();
     _stateBusiness   = new StateBusiness();
 }
        public void GetProjectThroughput_ThroughputMode(BenchmarkContext context)
        {
            ProjectBusiness projectBusiness = new ProjectBusiness();

            List <Project> project = projectBusiness.GetProjects().ToList();

            addCounter.Increment();
        }
示例#24
0
        public IHttpActionResult PostProject([FromBody] ProjectDetails projectToAdd)
        {
            ProjectBusiness tb = new ProjectBusiness();

            projectToAdd.Project_ID = Guid.NewGuid().ToString();
            tb.AddProject(tb.GetProjectFromDetails(projectToAdd));
            return(Ok(projectToAdd));
        }
示例#25
0
        public string ManageProject(object project)
        {
            string result = string.Empty;

            projectBusiness = new ProjectBusiness();
            result          = projectBusiness.ManageProject(project);
            return(result);
        }
        public void Deleteprojectfromrepo()
        {
            mock.Setup(a => a.DeleteProject(1)).Returns(true);
            ProjectBusiness appBusiness = new ProjectBusiness(mock.Object, mockuser.Object);

            var result = appBusiness.DeleteProject(1);

            Assert.AreEqual(true, result);
        }
        public void CreatProjectfromrepo()
        {
            mock.Setup(a => a.CreateProject(It.IsAny <Project>())).Returns(1);
            mockuser.Setup(a => a.UpdateUserProjectIdTaskId(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <int>())).Returns(true);
            ProjectBusiness appBusiness = new ProjectBusiness(mock.Object, mockuser.Object);

            var result = appBusiness.CreateProject(new ProjectDTO());

            Assert.AreEqual(true, result);
        }
示例#28
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            bool isEdit = Request.QueryString["id"] != null;

            //项目信息
            USER_SHARE_PROJECTMODEL projectModel = null;

            //日志记录
            USER_SHARE_LOGMODEL logModel = new USER_SHARE_LOGMODEL();

            logModel.LOGID       = CommonBusiness.GetSeqID("S_USER_SHARE_LOG");
            logModel.OPERATEDATE = DateTime.Now;
            logModel.OPERATORID  = AccountId;
            logModel.PROJECTID   = ProjectId;
            logModel.COMPANYID   = CompanyId;
            if (!isEdit)
            {
                projectModel               = new USER_SHARE_PROJECTMODEL();
                projectModel.PROJECTID     = CommonBusiness.GetSeqID("S_USER_SHARE_PROJECT");
                projectModel.PROJECTNAME   = txtProjectName.Text.Trim();
                projectModel.APISERVICEKEY = lblProjectKey.Text.Trim();
                projectModel.PROJECTREMARK = txtProjectDesc.Text.Trim();
                projectModel.STATUS        = int.Parse(ShareEnum.ProjectStatus.Normal.ToString("d"));
                projectModel.CREATEDATE    = DateTime.Now;

                logModel.OPERATETYPE    = int.Parse(ShareEnum.LogType.AddProject.ToString("d"));
                logModel.OPERATECONTENT = "注册新项目,Id:" + projectModel.PROJECTID + ",名称:" + projectModel.PROJECTNAME;
                if (ProjectBusiness.AddProject(projectModel, logModel))
                {
                    Alert("项目注册成功!");
                }
                else
                {
                    Alert("项目注册失败,请重试!");
                }
            }
            else
            {
                projectModel               = ProjectBusiness.GetProjectModel(ValidatorHelper.ToInt(Enc.Decrypt(Request.QueryString["id"], UrlEncKey), 0));
                projectModel.PROJECTNAME   = txtProjectName.Text.Trim();
                projectModel.PROJECTREMARK = txtProjectDesc.Text.Trim();
                logModel.OPERATETYPE       = int.Parse(ShareEnum.LogType.EditProject.ToString("d"));
                logModel.OPERATECONTENT    = "修改项目信息,项目Id:" + projectModel.PROJECTID + ",修改后的名称:" + projectModel.PROJECTNAME;
                if (ProjectBusiness.UpdateProject(projectModel, logModel))
                {
                    Alert("项目信息修改成功!");
                }
                else
                {
                    Alert("项目信息修改失败,请重试!");
                }
            }

            ExecScript("parent.__doPostBack('ctl00$MainContent$btnSearch','');");
        }
 public ProjectManagerForm1()
 {
     InitializeComponent();
     _project              = new Project();
     _projectBusiness      = new ProjectBusiness();
     _customerBusiness     = new CustomerBusiness();
     _customer             = new Customer();
     _employeeBusiness     = new EmployeeBusiness();
     _employee             = new Employee();
     _employeeRoleBusiness = new EmployeeRoleBusiness();
 }
示例#30
0
        private void LoadProjectInfo(string strId)
        {
            USER_SHARE_PROJECTMODEL projectModel = ProjectBusiness.GetProjectModel(ValidatorHelper.ToInt(strId, 0));

            if (projectModel != null)
            {
                txtProjectName.Text = projectModel.PROJECTNAME;
                lblProjectKey.Text  = projectModel.APISERVICEKEY;
                txtProjectDesc.Text = projectModel.PROJECTREMARK;
            }
        }
示例#31
0
 public int GetProjectLastInsertedId()
 {
     IReaderLimit<Project> business = new ProjectBusiness();
     return business.GetLastInsertedId();
 }
示例#32
0
 public IEnumerable<Project> GetProjects()
 {
     IReader<Project> business = new ProjectBusiness();
     return business.Get();
 }
示例#33
0
 public IEnumerable<Project> GetProjects(int indexFirstElement, int numberOfResults)
 {
     IReaderLimit<Project> business = new ProjectBusiness();
     return business.Get(indexFirstElement, numberOfResults);
 }
示例#34
0
 public IEnumerable<Project> GetProjectsByCampus(Campus campus)
 {
     IReader1Filter<Project, Campus> business = new ProjectBusiness();
     return business.Get(campus);
 }
示例#35
0
 public Project GetProject(int code)
 {
     IReader<Project> business = new ProjectBusiness();
     return business.Get(code);
 }
示例#36
0
 public void EditProject(Project element, string username, string password)
 {
     IManager<Project> business = new ProjectBusiness();
     business.Edit(element, username, password);
 }
示例#37
0
 public void DeleteProject(int code, string username, string password)
 {
     IManager<Project> business = new ProjectBusiness();
     business.Delete(code, username, password);
 }
示例#38
0
 public int AddProject(Project element, string username, string password)
 {
     IManager<Project> business = new ProjectBusiness();
     return business.Add(element, username, password);
 }
示例#39
0
 public IEnumerable<Project> GetProjectsByCampusLimited(Campus campus, int indexFirstElement, int numberOfResults)
 {
     IReader1Filter<Project, Campus> business = new ProjectBusiness();
     return business.Get(campus, indexFirstElement, numberOfResults);
 }