Ejemplo n.º 1
0
 public void Remove(UnknownObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 2
0
 public int Add(UnknownObject value)
 {
     try
     {
         return(List.Add(value));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 3
0
 // Called by UnknownObject when it changes
 internal void UnknownObjectChanged(UnknownObject unknown)
 {
     try
     {
         int index = List.IndexOf(unknown);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 4
0
 protected override void OnRemoveComplete(int index, object value)
 {
     try
     {
         UnknownObject unknown = (UnknownObject)value;
         unknown.Parent = this;
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemDeleted, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 5
0
 public UnknownSearch()
 {
     try
     {
         InitializeComponent();
         _unknown = new UnknownObject();
         FindAll();
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 6
0
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         UnknownObject unknown = new UnknownObject();
         List.Add(unknown);
         return(unknown);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 7
0
 public UnknownSearch()
 {
     try
     {
         InitializeComponent();
         _unknown = new UnknownObject();
         FindAll();
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 8
0
 public void Remove(UnknownObject unknown)
 {
     try
     {
         CheckTransaction();
         new UnknownDataService(Transaction).Remove(unknown);
         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();
     }
 }
Ejemplo n.º 9
0
        protected override void OnSetComplete(int index, object oldValue, object newValue)
        {
            try
            {
                if (oldValue != newValue)
                {
                    UnknownObject oldUnknown = (UnknownObject)oldValue;
                    UnknownObject newUnknown = (UnknownObject)newValue;
                    oldUnknown.Parent = null;
                    newUnknown.Parent = this;

                    OnListChanged(new ListChangedEventArgs(ListChangedType.ItemAdded, index));
                }
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Ejemplo n.º 10
0
 public static UnknownObject UnknownRowToObject(DataRow unknown)
 {
     UnknownObject obj = new UnknownObject();
     try
     {
         if (unknown != null)
         {
             if (RowFunctions.GetValueFromRowToGuid(unknown, UnknownObject.UNK_ID, false, DataRowVersion.Current) != Guid.Empty)
             {
                 obj.UnkID = RowFunctions.GetValueFromRowToGuid(unknown, UnknownObject.UNK_ID, true, DataRowVersion.Current);
                 obj.Email = RowFunctions.GetValueFromRowToString(unknown, UnknownObject.EMAIL, true, DataRowVersion.Current);
             }
             return obj;
         }
         obj = null;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return obj;
 }
Ejemplo n.º 11
0
        public UnknownObject GetUnknownByEmail(string email)
        {
            UnknownObject unknown = new UnknownObject();
            QueryBuilder builder;
            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                builder.AppendWhereString(UnknownObject.EMAIL, email, QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST_LAST);

                DataSet result = this.ExecuteDataSet(builder.Query, false);
                if (result.Tables[0].Rows.Count > 0)
                    unknown = UnknownConvertor.UnknownRowToObject(result.Tables[0].Rows[0]);
                else
                    return null;

            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return unknown;
        }
Ejemplo n.º 12
0
        public static UnknownObject UnknownRowToObject(DataRow unknown)
        {
            UnknownObject obj = new UnknownObject();

            try
            {
                if (unknown != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(unknown, UnknownObject.UNK_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.UnkID = RowFunctions.GetValueFromRowToGuid(unknown, UnknownObject.UNK_ID, true, DataRowVersion.Current);
                        obj.Email = RowFunctions.GetValueFromRowToString(unknown, UnknownObject.EMAIL, true, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
Ejemplo n.º 13
0
 // Called by UnknownObject when it changes
 internal void UnknownObjectChanged(UnknownObject unknown)
 {
     try
     {
         int index = List.IndexOf(unknown);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 14
0
 public void Remove(UnknownObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 15
0
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         UnknownObject unknown = new UnknownObject();
         List.Add(unknown);
         return unknown;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 16
0
 public int Add(UnknownObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 17
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (inTxn)
         {
             _loadedTask = this.Task;
             _loadedEmployee = this.Employee;
             _loadedSupplier = this.Supplier;
             _loadedCustomer = this.Customer;
             _loadedUnknown = this.Unknown;
             _loadedAssignee = this.Assignee;
             _loadedReporter = this.Reporter;
             inTxn = false;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Ejemplo n.º 18
0
 public void Save(UnknownObject unknown)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Unknown_Save",
             CreateParameter("@unkID", SqlDbType.UniqueIdentifier, unknown.UnkID, ParameterDirection.InputOutput),
             CreateParameter("@email", SqlDbType.NVarChar, unknown.Email)
             );
         unknown.UnkID = (Guid)cmd.Parameters["@unkID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
Ejemplo n.º 19
0
        private void CreateEmailAddress(TaskObject task, string emailAddress)
        {
            TIS.BL.Internal.Employee blEmp = new TIS.BL.Internal.Employee();
            TIS.BL.Internal.Supplier blSup = new TIS.BL.Internal.Supplier();
            TIS.BL.Internal.Unknown blUnk = new TIS.BL.Internal.Unknown();
            TIS.DL.Internal.Employee.EmployeeObject employee;
            TIS.DL.Internal.Supplier.SupplierObject supplier;
            TIS.DL.Internal.Unknown.UnknownObject unknown;
            TIS.DL.Internal.TaskPeople.TaskPeopleObject taskPeople;

            try
            {
                if (PROF_IT.Common.Functions.Functions.IsEmailAddress(emailAddress))
                {
                    employee = blEmp.GetEmployeeByEmail(emailAddress);
                    if (employee != null)
                    {
                        taskPeople = ProcessEmployee(employee);
                        taskPeople.Task = task;
                        task.AssigneesEmployee.Add(taskPeople);
                    }

                    supplier = blSup.GetSupplierByEmail(emailAddress);
                    if (supplier != null)
                    {
                        taskPeople = ProcessSupplier(supplier);
                        taskPeople.Task = task;
                        task.AssigneesSupplier.Add(taskPeople);
                    }

                    if (supplier == null & employee == null)
                    {
                        unknown = blUnk.GetUnknownByEmail(emailAddress);
                        if (unknown != null)
                        {
                            taskPeople = ProcessUnknown(unknown);
                            taskPeople.Task = task;
                            task.AssigneesUnknown.Add(taskPeople);
                        }
                        else
                        {
                            //Create Unknown record
                            unknown = new UnknownObject();
                            unknown.Email = emailAddress;
                            unknown.State = PROF_IT.Common.Enumerations.ObjectState.Created;
                            blUnk.Save(unknown);
                            taskPeople = ProcessUnknown(unknown);
                            taskPeople.Task = task;
                            task.AssigneesUnknown.Add(taskPeople);
                        }
                    }
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Ejemplo n.º 20
0
 public bool Remove(UnknownObject unknown)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Unknown_DELETE",
             CreateParameter("@unkID", SqlDbType.UniqueIdentifier, unknown.UnkID, 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;
     }
 }
Ejemplo n.º 21
0
 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);
     }
 }
Ejemplo n.º 22
0
 private void btnOk_Click(object sender, EventArgs e)
 {
     try
     {
         if (gdvUnknown.FocusedRowHandle != DevExpress.XtraGrid.GridControl.AutoFilterRowHandle)
         {
             Unknown = (UnknownObject)gdvUnknown.GetRow(gdvUnknown.FocusedRowHandle);
             this.DialogResult = System.Windows.Forms.DialogResult.OK;
             this.Close();
         }
         else
         {
             DevExpress.XtraEditors.XtraMessageBox.Show("Please select first a unknown!", "Attention", MessageBoxButtons.OK);
             this.DialogResult = System.Windows.Forms.DialogResult.None;
         }
     }
     catch (System.Exception exception1)
     {
         System.Exception thisException = exception1;
         Management.ShowException(thisException);
     }
 }