Esempio n. 1
0
        public AssignDriver(EmployeeObject employee)
        {
            InitializeComponent();

            this._employee = employee;

            txtDriver.Text = this._employee.DisplayName;

            FillCboDispatcher();
        }
Esempio n. 2
0
 public static EmployeeObject EmployeeRowToObject(DataRow employee, string alias)
 {
     EmployeeObject obj = new EmployeeObject();
     try
     {
         if (employee != null)
         {
             string aliasLanguage = "";
             if (alias != "")
             {
                 aliasLanguage = alias + "Language";
             }
             string test = EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMP_ID, alias);
             if (RowFunctions.GetValueFromRowToGuid(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMP_ID, alias), false, DataRowVersion.Current) != Guid.Empty)
             {
                 obj.EmpID = RowFunctions.GetValueFromRowToGuid(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMP_ID, alias), true, DataRowVersion.Current);
                 obj.TranscID = RowFunctions.GetValueFromRowToInteger(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.TRANSC_ID, alias), true, DataRowVersion.Current);
                 obj.TransiID = RowFunctions.GetValueFromRowToInteger(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.TRANSI_ID, alias), false, DataRowVersion.Current);
                 obj.Name = RowFunctions.GetValueFromRowToString(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.NAME, alias), false, DataRowVersion.Current);
                 obj.Surname = RowFunctions.GetValueFromRowToString(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.SURNAME, alias), false, DataRowVersion.Current);
                 obj.Email = RowFunctions.GetValueFromRowToString(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMAIL, alias), false, DataRowVersion.Current);
                 obj.Archive = RowFunctions.GetValueFromRowToBoolean(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.ARCHIVE, alias), false, DataRowVersion.Current);
                 obj.TranscLanguage = RowFunctions.GetValueFromRowToInteger(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.TRANSC_LANGUAGE, alias), false, DataRowVersion.Current);
                 obj.Language = LanguageConvertor.LanguageRowToObject(employee, aliasLanguage);
                 obj.RepeatMail = RowFunctions.GetValueFromRowToBoolean(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.REPEAT_MAIL, alias), false, DataRowVersion.Current);
             }
             return obj;
         }
         obj = null;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return obj;
 }
Esempio n. 3
0
 public Employee(PROF_IT.Common.Enumerations.TypeForm typeForm, EmployeeObject employee)
 {
     try
     {
         InitializeComponent();
         Uow = new UnitOfWork();
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             EmployeeMember = employee;
             InitializePropertyForm();
         }
         Initialize();
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 // Called by EmployeeObject when it changes
 internal void EmployeeObjectChanged(EmployeeObject employee)
 {
     try
     {
         int index = List.IndexOf(employee);
         OnListChanged(new ListChangedEventArgs(ListChangedType.ItemChanged, index));
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Esempio n. 5
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);
     }
 }
Esempio n. 6
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (_inTxn)
         {
             _loadedMaterialCategory = MaterialCategory;
             _loadedMaterialType = MaterialType;
             _loadedMaterialSubType = MaterialSubType;
             _loadedEmployeeCreator = EmployeeCreator;
             _loadedEmployeeResponsable = EmployeeResponsable;
             _loadedVehicle = Vehicle;
             _loadedSupplier = Supplier;
             _loadedName = Name;
             _loadedDescription = Description;
             _loadedType = Type;
             _loadedSerieNumber = SerieNumber;
             _loadedInternalNumber = InternalNumber;
             _loadedPurchasedOn = PurchasedOn;
             _loadedPrice = Price;
             _loadedNextMaintenance = NextMaintenance;
             _loadedMaintenanceFrequency = MaintenanceFrequency;
             _loadedActive = Active;
             _loadedBroken = Broken;
             //Child members
             _loadedMemos = Memos;
             _loadedMaintenances = Maintenances;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Esempio n. 7
0
        public static EmployeeObject EmployeeRowToObject(DataRow employee, string alias)
        {
            EmployeeObject obj = new EmployeeObject();

            try
            {
                if (employee != null)
                {
                    string aliasLanguage = "";
                    if (alias != "")
                    {
                        aliasLanguage = alias + "Language";
                    }
                    string test = EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMP_ID, alias);
                    if (RowFunctions.GetValueFromRowToGuid(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMP_ID, alias), false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.EmpID          = RowFunctions.GetValueFromRowToGuid(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMP_ID, alias), true, DataRowVersion.Current);
                        obj.TranscID       = RowFunctions.GetValueFromRowToInteger(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.TRANSC_ID, alias), true, DataRowVersion.Current);
                        obj.TransiID       = RowFunctions.GetValueFromRowToInteger(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.TRANSI_ID, alias), false, DataRowVersion.Current);
                        obj.Name           = RowFunctions.GetValueFromRowToString(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.NAME, alias), false, DataRowVersion.Current);
                        obj.Surname        = RowFunctions.GetValueFromRowToString(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.SURNAME, alias), false, DataRowVersion.Current);
                        obj.Email          = RowFunctions.GetValueFromRowToString(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMAIL, alias), false, DataRowVersion.Current);
                        obj.Archive        = RowFunctions.GetValueFromRowToBoolean(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.ARCHIVE, alias), false, DataRowVersion.Current);
                        obj.TranscLanguage = RowFunctions.GetValueFromRowToInteger(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.TRANSC_LANGUAGE, alias), false, DataRowVersion.Current);
                        obj.Language       = LanguageConvertor.LanguageRowToObject(employee, aliasLanguage);
                        obj.RepeatMail     = RowFunctions.GetValueFromRowToBoolean(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.REPEAT_MAIL, alias), false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
Esempio n. 8
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (_inTxn)
         {
             _loadedMaintenanceVehicle = MaintenanceVehicle;
             _loadedMaterial = Material;
             _loadedExecutor = Executor;
             _loadedRemark = Remark;
             _loadedStartMaintenance = StartMaintenance;
             _loadedMaterialRevisions = MaterialRevisions;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Esempio n. 9
0
 public void Save(EmployeeObject employee)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Employee_SAVE",
             CreateParameter("@empID", SqlDbType.UniqueIdentifier, employee.EmpID, ParameterDirection.InputOutput),
             CreateParameter("@TranscID", SqlDbType.Int, employee.TranscID),
             CreateParameter("@TransiID",SqlDbType.Int, employee.TransiID),
             CreateParameter("@Name",SqlDbType.NVarChar, employee.Name),
             CreateParameter("@Surname",SqlDbType.NVarChar, employee.Surname),
             CreateParameter("@Email",SqlDbType.NVarChar, employee.Email),
             CreateParameter("@Archive",SqlDbType.Bit, employee.Archive),
             CreateParameter("@transcLanguage",SqlDbType.Int, employee.TranscLanguage),
             CreateParameter("@lanID",SqlDbType.UniqueIdentifier, employee.Language.LanID),
             CreateParameter("@repeatMail", SqlDbType.Bit, employee.RepeatMail)
             );
         employee.EmpID = (Guid)cmd.Parameters["@empID"].Value;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     finally
     {
         if (cmd != null)
         {
             cmd.Dispose();
         }
         cmd = null;
     }
 }
Esempio n. 10
0
 void IEditableObject.EndEdit()
 {
     try
     {
         if (inTxn)
         {
             _loadedEmployee = this.Employee;
             _loadedActive = this.Active;
             _loadedhasPopups = this.HasPopups;
             _loadedLogin = this.Login;
             _loadedName = this.Name;
             _loadedPassword = this.Password;
             _loadedSurname = this.Surname;
             _loadedSecurity = this.Security;
             _initialValueSet = false;
             inTxn = false;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public void Remove(EmployeeObject value)
 {
     try
     {
         List.Remove(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Esempio n. 12
0
 public TaskPeopleObjectCollection GetByEmployee(EmployeeObject employee)
 {
     TaskPeopleObjectCollection taskPeoples;
     try
     {
         taskPeoples = new TaskPeopleDataService().GetByEmployee(employee);
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
     return taskPeoples;
 }
 // Methods.
 object IBindingList.AddNew()
 {
     try
     {
         EmployeeObject employee = new EmployeeObject();
         List.Add(employee);
         return employee;
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 public int Add(EmployeeObject value)
 {
     try
     {
         return List.Add(value);
     }
     catch (System.Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
 void IEditableObject.BeginEdit()
 {
     try
     {
         if (!_inTxn)
         {
             _loadedVehicle = Vehicle;
             _loadedExecutor = Executor;
             _loadedStartMaintenance= StartMaintenance;
             _loadedRemark= Remark;
             _inTxn = true;
         }
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Esempio n. 16
0
 public TaskPeopleObjectCollection GetByEmployee(EmployeeObject employee)
 {
     TaskPeopleObjectCollection taskPeoples = new TaskPeopleObjectCollection();
     QueryBuilder builder;
     try
     {
         builder = new QueryBuilder();
         builder.Append(this.BaseQuery(false, 0));
         builder.AppendWhereString(TaskPeopleObject.EMP_ID, employee.EmpID.ToString(), QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST);
         builder.Append("AND " + TaskPeopleObject.EMP_ID + " is not null ");
         builder.Append("AND " + TaskObject.TASK_ID + " is not null ");
         builder.AppendWhereBoolean(TaskPeopleObject.ASSIGNEE, true, QueryBuilder.ParameterLocation.LAST);
         taskPeoples = TaskPeopleConvertor.DataTableToCollection(this.ExecuteDataSet(builder.Query, false).Tables[0]);
     }
     catch (System.Exception exception1)
     {
         throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
     }
     return taskPeoples;
 }
Esempio n. 17
0
        public EmployeeObject GetEmployeeByEmail(string email)
        {
            EmployeeObject employee = new EmployeeObject();
            QueryBuilder builder;
            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                builder.AppendWhereString(EmployeeObject.EMAIL, email, QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST_LAST);

                DataSet result = this.ExecuteDataSet(builder.Query, false);
                if (result.Tables[0].Rows.Count > 0)
                    employee = EmployeeConvertor.EmployeeRowToObject(result.Tables[0].Rows[0], "");
                else
                    return null;
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return employee;
        }
Esempio n. 18
0
 private TaskPeopleObject ProcessEmployee(EmployeeObject employee)
 {
     try
     {
         TaskPeopleObject taskPeople = new TaskPeopleObject();
         taskPeople.Assignee = true;
         taskPeople.Reporter = false;
         taskPeople.Employee = employee;
         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);
     }
 }
Esempio n. 19
0
 public bool Remove(EmployeeObject employee)
 {
     SqlCommand cmd = null;
     try
     {
         ExecuteNonQuery(out cmd, false, "Employee_DELETE",
             CreateParameter("@empID", SqlDbType.UniqueIdentifier, employee.EmpID, 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;
     }
 }