public void Remove(TaskPeopleObject taskPeople) { try { CheckTransaction(); new TaskPeopleDataService(Transaction).Remove(taskPeople); if (IsOwner) { Transaction.Commit(); } } catch (Exception exception1) { if (IsOwner) { Transaction.Rollback(); } Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (IsOwner) { Connection.Close(); } } }
public bool Remove(TaskPeopleObject taskPeople) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "TaskPeople_DELETE", CreateParameter("@tpeopID", SqlDbType.UniqueIdentifier, taskPeople.TpeopID, ParameterDirection.Input) ); return(true); } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
public void Save(TaskPeopleObject taskPeople) { SqlCommand cmd = null; try { ExecuteNonQuery(out cmd, false, "TaskPeople_SAVE", CreateParameter("@tpeopID", SqlDbType.UniqueIdentifier, taskPeople.TpeopID, ParameterDirection.InputOutput), CreateParameter("@taskID", SqlDbType.UniqueIdentifier, taskPeople.Task.TaskID), CreateParameter("@empID", SqlDbType.UniqueIdentifier, taskPeople.Employee == null ? Guid.Empty : taskPeople.Employee.EmpID), CreateParameter("@supID", SqlDbType.UniqueIdentifier, taskPeople.Supplier == null ? Guid.Empty : taskPeople.Supplier.SupID), CreateParameter("@cusID", SqlDbType.UniqueIdentifier, taskPeople.Customer == null ? Guid.Empty : taskPeople.Customer.CusID), CreateParameter("@unkID", SqlDbType.UniqueIdentifier, taskPeople.Unknown == null ? Guid.Empty : taskPeople.Unknown.UnkID), CreateParameter("@Assignee", SqlDbType.Bit, taskPeople.Assignee), CreateParameter("@Reporter", SqlDbType.Bit, taskPeople.Reporter) ); taskPeople.TpeopID = (Guid)cmd.Parameters["@tpeopID"].Value; } catch (Exception exception1) { Exception innerException = exception1; throw new Exception(MethodBase.GetCurrentMethod().Name, innerException); } finally { if (cmd != null) { cmd.Dispose(); } cmd = null; } }
private void btnAddAssigneeUnknown_Click(object sender, EventArgs e) { Unknown.UnknownSearch unkSearch = new Unknown.UnknownSearch(); if (unkSearch.ShowDialog() == DialogResult.OK) { TaskPeopleObject taskPeople = new TaskPeopleObject(); taskPeople.Assignee = true; taskPeople.Reporter = false; taskPeople.Unknown = unkSearch.Unknown; taskPeople.Task = TaskMember; taskPeople.State = PROF_IT.Common.Enumerations.ObjectState.Created; TaskMember.AssigneesUnknown.Add(taskPeople); this.gdcAssigneeUnknown.DataSource = TaskMember.AssigneesUnknown.GetActive(); } }
private TaskPeopleObject ProcessUnknown(UnknownObject unknown) { try { TaskPeopleObject taskPeople = new TaskPeopleObject(); taskPeople.Assignee = true; taskPeople.Reporter = false; taskPeople.Unknown = unknown; taskPeople.State = PROF_IT.Common.Enumerations.ObjectState.Created; return(taskPeople); } catch (System.Exception exception1) { System.Exception innerException = exception1; throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException); } }
private void btnAddAssigneeSupplier_Click(object sender, EventArgs e) { try { Supplier.SupplierSearch supSearch = new Supplier.SupplierSearch(); if (supSearch.ShowDialog() == DialogResult.OK) { TaskPeopleObject taskPeople = new TaskPeopleObject(); taskPeople.Assignee = true; taskPeople.Reporter = false; taskPeople.Supplier = supSearch.Supplier; taskPeople.Task = TaskMember; taskPeople.State = PROF_IT.Common.Enumerations.ObjectState.Created; TaskMember.AssigneesSupplier.Add(taskPeople); gdcAssigneeSupplier.DataSource = TaskMember.AssigneesSupplier.GetActive(); } } catch (System.Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }
private void btnSave_Click(object sender, EventArgs e) { try { Boolean error = false; if (glouReporter.EditValue == null) { DevExpress.XtraEditors.XtraMessageBox.Show("Please choose first a reporter!", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); error = true; } if (cmbEffort.EditValue == null) { DevExpress.XtraEditors.XtraMessageBox.Show("Please choose first an effort!", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); error = true; } if (cmbPriority.EditValue == null) { DevExpress.XtraEditors.XtraMessageBox.Show("Please choose first a priority!", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); error = true; } if (cmbStatus.EditValue == null) { DevExpress.XtraEditors.XtraMessageBox.Show("Please choose first a status!", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); error = true; } if (this.txtTaskID.Text == "") { DevExpress.XtraEditors.XtraMessageBox.Show("Please enter first a task ID!", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Warning); error = true; } if (error == false) { TIS.BL.Internal.Task taskBL = new TIS.BL.Internal.Task(); //Add Reporter foreach (TaskPeopleObject reporter in TaskMember.Reporters) { reporter.State = PROF_IT.Common.Enumerations.ObjectState.Deleted; } TaskPeopleObject _reporter = new TaskPeopleObject(); _reporter.Task = TaskMember; if (glouReporter.EditValue != null) { _reporter.Employee = new BL.Internal.Employee().GetEmployeeByID((Guid)glouReporter.EditValue); } _reporter.Assignee = false; _reporter.Reporter = true; _reporter.State = PROF_IT.Common.Enumerations.ObjectState.Created; TaskMember.Reporters.Add(_reporter); //Add others TaskMember.Tag = txtTaskID.Text; if (this.dateEditDueDate.Text == "") { TaskMember.DueDate = ""; } else { TaskMember.DueDate = PROF_IT.Common.Convert.DateFunctions.DateToLongStrDate(dateEditDueDate.DateTime); } if (TaskMember.CreationDate.Length == 0) { TaskMember.CreationDate = PROF_IT.Common.Convert.DateFunctions.DateToLongStrDate(System.DateTime.Now); } TaskMember.Description = richeditDescription.RtfText; TaskMember.Effort = (Enumeration.Task.Effort)cmbEffort.EditValue; TaskMember.Priority = (Enumeration.Task.Priority)cmbPriority.EditValue; TaskMember.Status = (Enumeration.Task.Status)cmbStatus.EditValue; TaskMember.State = PROF_IT.Common.Enumerations.ObjectState.Modified; taskBL.Save(TaskMember); this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } else { this.DialogResult = System.Windows.Forms.DialogResult.None; } } catch (System.Exception exception1) { System.Exception thisException = exception1; Management.ShowException(thisException); } }