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)); }
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)); }
public IHttpActionResult DeleteProject(string id) { ProjectBusiness tb = new ProjectBusiness(); var isDeleted = tb.DeleteProject(id); return(Ok(isDeleted)); }
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 } }
public List <ProjectModel> GetAll() { projectBusiness = new ProjectBusiness(); var result = projectBusiness.GetAll(); return(result); }
public int UpdaterojectModel(ProjectModel prjModel) { projectBusiness = new ProjectBusiness(); int result = projectBusiness.UpdateProjectDetails(prjModel); return(result); }
public int InserProjectModel(ProjectModel prjModel) { projectBusiness = new ProjectBusiness(); int result = projectBusiness.InsertProjectDetails(prjModel); return(result); }
public List <ProjectModel> GetAllProjectDetails() { projectBusiness = new ProjectBusiness(); List <ProjectModel> result = projectBusiness.GetProjectList(); return(result); }
public IHttpActionResult UpdateProject([FromBody] ProjectDetails projectToUpdate) { ProjectBusiness tb = new ProjectBusiness(); tb.UpdateProject(tb.GetProjectFromDetails(projectToUpdate)); return(Ok(projectToUpdate)); }
public IHttpActionResult GetProjectByID(string id) { ProjectBusiness tb = new ProjectBusiness(); Project selectedProject = tb.GetProjectByID(id); return(Ok(selectedProject)); }
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); } }
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 }); }
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)); }
public IHttpActionResult GetAllProjects() { ProjectBusiness tb = new ProjectBusiness(); List <Project> allProjects = tb.GetAllProjects(); return(Ok(allProjects)); }
protected override void OnResume() { base.OnResume(); progressDialog.Show(); developersBusiness = new DevelopersBusiness(this, this); projectBusiness = new ProjectBusiness(this, this); developersBusiness.GetListDevelopers(); }
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; }
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(); }
public IHttpActionResult PostProject([FromBody] ProjectDetails projectToAdd) { ProjectBusiness tb = new ProjectBusiness(); projectToAdd.Project_ID = Guid.NewGuid().ToString(); tb.AddProject(tb.GetProjectFromDetails(projectToAdd)); return(Ok(projectToAdd)); }
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); }
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(); }
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; } }
public int GetProjectLastInsertedId() { IReaderLimit<Project> business = new ProjectBusiness(); return business.GetLastInsertedId(); }
public IEnumerable<Project> GetProjects() { IReader<Project> business = new ProjectBusiness(); return business.Get(); }
public IEnumerable<Project> GetProjects(int indexFirstElement, int numberOfResults) { IReaderLimit<Project> business = new ProjectBusiness(); return business.Get(indexFirstElement, numberOfResults); }
public IEnumerable<Project> GetProjectsByCampus(Campus campus) { IReader1Filter<Project, Campus> business = new ProjectBusiness(); return business.Get(campus); }
public Project GetProject(int code) { IReader<Project> business = new ProjectBusiness(); return business.Get(code); }
public void EditProject(Project element, string username, string password) { IManager<Project> business = new ProjectBusiness(); business.Edit(element, username, password); }
public void DeleteProject(int code, string username, string password) { IManager<Project> business = new ProjectBusiness(); business.Delete(code, username, password); }
public int AddProject(Project element, string username, string password) { IManager<Project> business = new ProjectBusiness(); return business.Add(element, username, password); }
public IEnumerable<Project> GetProjectsByCampusLimited(Campus campus, int indexFirstElement, int numberOfResults) { IReader1Filter<Project, Campus> business = new ProjectBusiness(); return business.Get(campus, indexFirstElement, numberOfResults); }