Esempio n. 1
0
        public void Equals_IsNotEqual_Fails()
        {
            EmployeeID employeeId1 = new EmployeeID(06, 12, 31);
            EmployeeID employeeId2 = new EmployeeID(06, 12, 12);

            Expect(employeeId1.Equals(employeeId2), Is.False);
        }
Esempio n. 2
0
        public void Parse_ProvidedWithValidInput_ReturnsEqualEmployeeId(string validInput, int yearPart, int monthPart, int serialPart)
        {
            EmployeeID employeeId = new EmployeeID(yearPart, monthPart, serialPart);

            Expect(() => EmployeeID.Parse(validInput)
                   , Is.EqualTo(employeeId));
        }
Esempio n. 3
0
 private void btnreset_Click(object sender, EventArgs e)
 {
     EmployeeID.Clear();
     firstname.Clear();
     middleinitial.Clear();
     lastname.Clear();
 }
Esempio n. 4
0
        public void Equals_IsEqual_Passes()
        {
            EmployeeID employeeId1 = new EmployeeID(06, 12, 31);
            EmployeeID employeeId2 = new EmployeeID(06, 12, 31);

            Expect(employeeId1.Equals(employeeId2), Is.True);
        }
Esempio n. 5
0
        public override int GetHashCode()
        {
            int code = 27;

            code = unchecked (
                code ^
                EmployeeID.GetHashCode() ^
                FirstName.GetHashCode() ^
                Title.GetHashCode() ^
                TitleOfCourtesy.GetHashCode() ^
                BirthDate.GetHashCode() ^
                HireDate.GetHashCode() ^
                Address.GetHashCode() ^
                City.GetHashCode() ^
                Region.GetHashCode() ^
                PostalCode.GetHashCode() ^
                Country.GetHashCode() ^
                HomePhone.GetHashCode() ^
                Extension.GetHashCode() ^
                Photo.GetHashCode() ^
                Notes.GetHashCode() ^
                ReportsTo.GetHashCode() ^
                PhotoPath.GetHashCode()
                );
            return(code);
        }
Esempio n. 6
0
        public void PaymentInsert()
        {
            using (SqlConnection Connection = new SqlConnection(ConfigurationManager.AppSettings["WebApplication"]))
            {
                using (SqlCommand command = new SqlCommand("BonusPlan.PaymentInsert", Connection))
                {
                    command.CommandType    = CommandType.StoredProcedure;
                    command.CommandTimeout = 600;

                    command.Parameters.Add("@EmployeeID", SqlDbType.Int);
                    command.Parameters["@EmployeeID"].Value = EmployeeID.NullIfEmpty();

                    command.Parameters.Add("@CommunityNumber", SqlDbType.VarChar);
                    command.Parameters["@CommunityNumber"].Value = CommunityNumber.NullIfEmpty();

                    command.Parameters.Add("@Amount", SqlDbType.VarChar);
                    command.Parameters["@Amount"].Value = Amount.NullIfEmpty();

                    command.Parameters.Add("@BonusPlanID", SqlDbType.Int);
                    command.Parameters["@BonusPlanID"].Value = BonusPlanID.NullIfEmpty();

                    command.Parameters.Add("@Note", SqlDbType.VarChar);
                    command.Parameters["@Note"].Value = Note.NullIfEmpty();

                    command.Parameters.Add("@CustomerID", SqlDbType.Int);
                    command.Parameters["@CustomerID"].Value = CustomerID;

                    command.Parameters.Add("@CreateBy", SqlDbType.VarChar);
                    command.Parameters["@CreateBy"].Value = Audit.CreateBy;

                    Connection.Open();
                    command.ExecuteNonQuery();
                }
            }
        }
Esempio n. 7
0
        public void IsValid_WithValidInput_Passes(string validEmployeeIdString, int year, int month, int day)
        {
            EmployeeID employeeId = EmployeeID.Parse(validEmployeeIdString);
            DateTime   dateTime   = new DateTime(year, month, day);

            Expect(EmployeeID.IsValid(employeeId, dateTime), Is.True);
        }
Esempio n. 8
0
        void QSS_Loaded(object sender, RoutedEventArgs e)
        {
            int i = 0;

            if (!vm.bLoggedIn)
            {
                Note.Visibility = Visibility.Hidden;
            }
            if (vm.GetShowPass() == 1)
            {
                ShowPass.Content = "Hide pass";
            }
            foreach (object but in buttonsContainer.Children)
            {
                Button button = but as Button;
                if (i < buttonLabels.Count)
                {
                    button.Visibility = Visibility.Visible;
                    button.Content    = buttonLabels[i];
                }
                i++;
            }
            if (vm.GetShowPass() == 1)
            {
                PassButton.Visibility = Visibility.Visible;
            }
            timer2          = new DispatcherTimer();
            timer2.Interval = TimeSpan.FromSeconds(1);
            timer2.Tick    += new EventHandler(timer2_Tick);
            EmployeeID.Focus();
            Barcode.TextChanged += new TextChangedEventHandler(Barcode_TextChanged);
        }
Esempio n. 9
0
        public void IsValid_WithInValidInput_Fails(string validEmployeeIdString, int year, int month, int day)
        {
            //TODO: needs more work
            EmployeeID employeeId = EmployeeID.Parse(validEmployeeIdString);
            DateTime   dateTime   = new DateTime(year, month, day);

            Expect(EmployeeID.IsValid(employeeId, dateTime), Is.False);
        }
        public override int GetHashCode()
        {
            int hashCode = 13;

            hashCode = (hashCode * 7) + EmployeeID.GetHashCode();
            hashCode = (hashCode * 7) + TerritoryID.GetHashCode();
            return(hashCode);
        }
        private void useManualAttendanceMethod(string input)
        {
            EmployeeID employeeId = EmployeeID.Empty;

            if (EmployeeID.TryParse(input, out employeeId))
            {
                EnteredEmployeeID = employeeId;
            }
        }
Esempio n. 12
0
        public virtual int CompareTo(EmployeeWeekTimeRecording week)
        {
            int i = EmployeeID.CompareTo(week.EmployeeID);

            if (i == 0)
            {
                i = week.WeekBegin.CompareTo(week.WeekBegin);
            }
            return(i);
        }
Esempio n. 13
0
        /// <summary>
        /// بازیابی کارمند با شماره کارمندی
        /// </summary>
        /// <param name="employeeId">شماره کارمندی</param>
        /// <returns>کارمند</returns>
        public Employee RetrieveEmployee(EmployeeID employeeId)
        {
            Employee employee = RetrieveEmployees().FirstOrDefault((emp) => emp.EmployeeID == employeeId);

            if (employee != null)
            {
                employee.ProfilePicture = m_profilePictureRepository.Read(employee.ID.ToString());
            }
            return(employee);
        }
Esempio n. 14
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //make sure we can open database
            vm.OpenBCSandStoreDB();
            vm.GetOurEntities();
            vm.OpenAssemblyDB();
            this.Title = "On the Spot QCS";
            int i = 0;

            //Note.Visibility = Visibility.Visible;
            //Totals.Visibility = Visibility.Visible;
            if (vm.GetShowPass() == 1)
            {
                ShowPass.Content = "Hide pass";
            }
            foreach (object but in buttonsContainer.Children)
            {
                Button button = but as Button;
                if (i < buttonLabels.Count)
                {
                    button.Visibility = Visibility.Visible;
                    button.Content    = buttonLabels[i];
                }
                i++;
            }
            if (vm.GetShowPass() == 1)
            {
                PassButton.Visibility = Visibility.Visible;
            }
            timer2          = new DispatcherTimer();
            timer2.Interval = TimeSpan.FromSeconds(1);
            timer2.Tick    += new EventHandler(timer2_Tick);
            timer1          = new DispatcherTimer();
            timer1.Interval = TimeSpan.FromSeconds(30);
            timer1.Tick    += new EventHandler(timer1_Tick);
            timer1.Start();
            EmployeeID.Focus();
            Barcode.TextChanged += new TextChangedEventHandler(Barcode_TextChanged);


            if (vm.DBerrormsg == string.Empty)
            {
                led1.ColorOn            = Colors.Green;
                led1.IsActive           = true;
                LoadedDone.Visibility   = Visibility.Visible;
                LoadingState.Visibility = Visibility.Collapsed;
            }
            else
            {
                DBErrorMsg.Text = vm.DBerrormsg;
                textBlock1.Text = "System Initialization Failed";
                led1.ColorOn    = Colors.Red;
                led1.IsActive   = true;
            }
        }
 /// <summary>
 /// تبدیل رشته به EmployeeID متناظر
 /// </summary>
 /// <param name="value">یک string</param>
 /// <param name="targetType">یک EmployeeID</param>
 /// <param name="parameter">این پارامتر در EmployeeIDToStringConverter استفاده نمی شود</param>
 /// <param name="culture">این پارامتر در EmployeeIDToStringConverter استفاده نمی شود</param>
 /// <returns>نمونه متناظر EmployeeID</returns>
 public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
     if (targetType == typeof(EmployeeID) && value != null)
     {
         return(EmployeeID.Parse((string)value));
     }
     else
     {
         return(null);
     }
 }
Esempio n. 16
0
        public int CompareTo(EmployeeAllIn entity)
        {
            Debug.Assert(entity != null);
            int i = EmployeeID.CompareTo(entity.EmployeeID);

            if (i == 0)
            {
                i = DateTime.Compare(BeginTime, entity.BeginTime);
            }

            return(i);
        }
        //override hashcode
        public override int GetHashCode()
        {
            int hashCode = 1858374551;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FirstName);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(LastName);

            hashCode = hashCode * -1521134295 + EmployeeID.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Department);

            return(hashCode);
        }
Esempio n. 18
0
 //Adds all IDs to ID list
 public void AddID()
 {
     EmployeeID.Add(223445);
     EmployeeID.Add(223476);
     EmployeeID.Add(223487);
     EmployeeID.Add(223504);
     EmployeeID.Add(223512);
     EmployeeID.Add(223519);
     EmployeeID.Add(223525);
     EmployeeID.Add(223536);
     EmployeeID.Add(223542);
     EmployeeID.Add(223558);
 }
Esempio n. 19
0
        public virtual int CompareTo(EmployeeContract entity)
        {
            if (entity == null)
            {
                return(-1);
            }

            int i = EmployeeID.CompareTo(entity.EmployeeID);

            if (i == 0)
            {
                i = ContractBegin.CompareTo(entity.ContractBegin);
            }

            return(i);
        }
Esempio n. 20
0
        public virtual int CompareTo(EmployeeRelation entity)
        {
            if (entity == null)
            {
                return(-1);
            }

            int i = EmployeeID.CompareTo(entity.EmployeeID);

            if (i == 0)
            {
                i = BeginTime.CompareTo(entity.BeginTime);
            }

            return(i);
        }
Esempio n. 21
0
        public override int GetHashCode()
        {
            var hashCode = 84649274;

            hashCode = hashCode * -1521134295 + OrderID.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CustomerID);

            hashCode = hashCode * -1521134295 + EmployeeID.GetHashCode();
            hashCode = hashCode * -1521134295 + OrderDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(RequiredDate);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ShippedDate);

            hashCode = hashCode * -1521134295 + ShipVia.GetHashCode();
            hashCode = hashCode * -1521134295 + Freight.GetHashCode();
            return(hashCode);
        }
Esempio n. 22
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            EmployeeID = Convert.ToInt32(Session["UName"]);
            clsBLReportIssue objClsBLReportIssue = new clsBLReportIssue();
            DataSet          dsEmail             = objClsBLReportIssue.GetEmailID(EmployeeID);

            if (dsEmail.Tables[0].Rows.Count > 0)
            {
                txtEmailID.Text = dsEmail.Tables[0].Rows[0][0].ToString();
                txtName.Text    = dsEmail.Tables[0].Rows[0]["UserName"].ToString();
            }
            if (EmployeeID.ToString() == "" || EmployeeID == 0)
            {
                //Response.Redirect("http://192.168.30.15/intranet/");
                Response.Redirect("http://myv2.v2solutions.com/");
            }
            else
            {
                if (!Page.IsPostBack)
                {
                    try
                    {
                        BindType();
                        BindSeverity();
                        BindSubCategory();
                    }

                    catch (V2Exceptions ex)
                    {
                        throw;
                    }
                    catch (System.Exception ex)
                    {
                        FileLog objFileLog = FileLog.GetLogger();
                        objFileLog.WriteLine(LogType.Error, ex.Message, "ReportIssue.aspx", "Page_Load", ex.StackTrace);
                        throw new V2Exceptions();
                    }
                    ////	BindPriority();
                }
            }
            btnSubmit.Attributes.Add("onClick", "return validateAndCheck();");
            //lblMessage.Visible = false;
            //btnSubmit.Attributes.Add("onClick","return checkSubCategorySelection();");
        }
 /// <summary>
 ///  database connection for Delete data
 /// </summary>
 /// <param name="ID">Delete data</param>
 /// <returns></returns>
 public EmployeeID DeleteEmployee(int ID)
 {
     try
     {
         EmployeeID    employee   = new EmployeeID();
         SqlConnection connection = DatabaseConnection();
         //for store procedure and connection to database
         SqlCommand command = StoreProcedureConnection("spDeleteEmployeeRcord", connection);
         command.Parameters.Add("@ID", SqlDbType.Int).Value = ID;
         connection.Open();
         SqlDataReader Response = command.ExecuteReader();
         connection.Close();
         return(employee);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Esempio n. 24
0
        public int CompareTo(EmployeeTimeRange entity)
        {
            int i = EmployeeID.CompareTo(entity.EmployeeID);

            if (i == 0)
            {
                if ((i = Date.CompareTo(entity.Date)) == 0)
                {
                    return(Begin - entity.Begin);
                }
                else
                {
                    return(i);
                }
            }
            else
            {
                return(i);
            }
        }
Esempio n. 25
0
        protected void bindEmployeeList()//binding the employee dropdown
        {
            DataTableConversion lsttodt = new DataTableConversion();

            IEmployeeInterface service = new EmployeeRepository();
            var       lst = service.GetEmployeeDataFunc().Select(x => new { x.Name, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                EmployeeID.DataSource     = dt;
                EmployeeID.DataTextField  = "Name";
                EmployeeID.DataValueField = "ID";
                EmployeeID.DataBind();
            }
            else
            {
                EmployeeID.DataBind();
            }
        }
Esempio n. 26
0
        public void BonusPlanToUserCommunityInsert()
        {
            using (SqlConnection Connection = new SqlConnection(ConfigurationManager.AppSettings["WebApplication"]))
            {
                using (SqlCommand Command = new SqlCommand("BonusPlan.BonusPlanToUserCommunityInsert", Connection))
                {
                    Command.CommandType    = CommandType.StoredProcedure;
                    Command.CommandTimeout = 600;

                    Command.Parameters.Add("@BonusPlanID", SqlDbType.Int);
                    Command.Parameters["@BonusPlanID"].Value = BonusPlanID.NullIfEmpty();

                    Command.Parameters.Add("@EmployeeID", SqlDbType.Int);
                    Command.Parameters["@EmployeeID"].Value = EmployeeID.NullIfEmpty();

                    Command.Parameters.Add("@CommunityNumber", SqlDbType.VarChar);
                    Command.Parameters["@CommunityNumber"].Value = CommunityNumber.NullIfEmpty();

                    Command.Parameters.Add("@Percentage", SqlDbType.VarChar);
                    Command.Parameters["@Percentage"].Value = Percentage.NullIfEmpty();

                    Command.Parameters.Add("@FlatRate", SqlDbType.VarChar);
                    Command.Parameters["@FlatRate"].Value = FlatRate.NullIfEmpty();

                    Command.Parameters.Add("@BeginDt", SqlDbType.VarChar);
                    Command.Parameters["@BeginDt"].Value = BeginDt.NullIfEmpty();

                    Command.Parameters.Add("@EndDt", SqlDbType.VarChar);
                    Command.Parameters["@EndDt"].Value = EndDt.NullIfEmpty();

                    Command.Parameters.Add("@RollforwardFlg", SqlDbType.Int);
                    Command.Parameters["@RollforwardFlg"].Value = RollforwardFlg.NullIfEmpty("0");

                    Command.Parameters.Add("@CreateBy", SqlDbType.VarChar);
                    Command.Parameters["@CreateBy"].Value = Audit.CreateBy.NullIfEmpty();

                    Connection.Open();
                    Command.ExecuteNonQuery();
                }
            }
        }
        /// <summary>
        /// برسی وجود کد کارمندی وارد شده، و بر گرداندن شناسه داخلی
        /// </summary>
        /// <returns>شناسه داخلی یا مقدار Guid.Empty</returns>
        public object Run()
        {
            ///[Checking for EmployeeID]
            EmployeeID employeeId = (EmployeeID)Input;

            if (employeeId == null || employeeId == EmployeeID.Empty)
            {
                return(Guid.Empty);
            }

            var e = AutomatedAttendanceSystem.RetrieveEmployee(employeeId);

            if (e != null && e.ID != Guid.Empty)
            {
                return(e.ID);
            }
            else
            {
                return(Guid.Empty);
            }
            ///[Checking for EmployeeID]
        }
Esempio n. 28
0
        public void NewEmployeeID_WhenCalledInTheDifferentYearButSameMonth_StartsFromZeroAndSerialPartAndGeneratesAndReturnsANewEmployeeID()
        {
            int             l_yearPart  = 01;
            int             l_monthPart = DateTime.Now.Month;
            List <Employee> employees   = new List <Employee>()
            {
                new Employee()
                {
                    DateOfBirth       = new DateTime(DateTime.Now.AddYears(-20).Year, 01, 01),
                    DateOfEmployement = new DateTime(2001, l_monthPart, 01),
                    EmployeeID        = new EmployeeID(l_yearPart, l_monthPart, 01)
                },
                new Employee()
                {
                    DateOfBirth       = new DateTime(DateTime.Now.AddYears(-20).Year, 01, 01),
                    DateOfEmployement = new DateTime(2001, l_monthPart, 01),
                    EmployeeID        = new EmployeeID(l_yearPart, l_monthPart, 02)
                }
            };
            EmployeeID newEmployeeID = new EmployeeID(int.Parse(DateTime.Now.ToString("yy")), l_monthPart, 01);

            Expect(() => EmployeeID.NewEmployeeID(employees), Is.EqualTo(newEmployeeID));
        }
Esempio n. 29
0
        public void NewEmployeeID_WhenCalledInTheSameYearAndMonth_IcrementsSerialPartAndGeneratesAndReturnsANewEmployeeID()
        {
            int             l_yearPart  = int.Parse(DateTime.Now.ToString("yy"));
            int             l_monthPart = DateTime.Now.Month;
            List <Employee> employees   = new List <Employee>()
            {
                new Employee()
                {
                    DateOfBirth       = new DateTime(DateTime.Now.AddYears(-20).Year, 01, 01),
                    DateOfEmployement = new DateTime(DateTime.Now.Year, l_monthPart, 01),
                    EmployeeID        = new EmployeeID(l_yearPart, l_monthPart, 01)
                },
                new Employee()
                {
                    DateOfBirth       = new DateTime(DateTime.Now.AddYears(-20).Year, 01, 01),
                    DateOfEmployement = new DateTime(DateTime.Now.Year, l_monthPart, 01),
                    EmployeeID        = new EmployeeID(l_yearPart, l_monthPart, 02)
                }
            };
            EmployeeID newEmployeeID = new EmployeeID(l_yearPart, l_monthPart, 03);

            Expect(() => EmployeeID.NewEmployeeID(employees), Is.EqualTo(newEmployeeID));
        }
Esempio n. 30
0
        public bool HasChange(Employee newEmp)
        {
            if (EmployeeID.TrimStart(new char[] { '0' }) != newEmp.EmployeeID.TrimStart(new char[] { '0' }))
            {
                return(true);
            }
            if (TitleName != newEmp.TitleName)
            {
                return(true);
            }
            if (FirstName != newEmp.FirstName)
            {
                return(true);
            }
            if (LastName != newEmp.LastName)
            {
                return(true);
            }
            if (JobTitle != newEmp.JobTitle)
            {
                return(true);
            }
            if (JobLevel != newEmp.JobLevel)
            {
                return(true);
            }
            if (CostCenterID != newEmp.CostCenterID)
            {
                return(true);
            }
            if (Status != newEmp.Status)
            {
                return(true);
            }

            if (PositionCode != newEmp.PositionCode)
            {
                return(true);
            }
            if (LevelCode != newEmp.LevelCode)
            {
                return(true);
            }
            if (Email != newEmp.Email)
            {
                return(true);
            }
            if (DepartmentSap != newEmp.DepartmentSap)
            {
                return(true);
            }
            if (StaffDate != newEmp.StaffDate)
            {
                return(true);
            }
            if (EntryDate != newEmp.EntryDate)
            {
                return(true);
            }
            if (RetiredDate != newEmp.RetiredDate)
            {
                return(true);
            }
            if (BaCode != newEmp.BaCode)
            {
                return(true);
            }
            if (PeaCode != newEmp.PeaCode)
            {
                return(true);
            }
            if (StatusCode != newEmp.StatusCode)
            {
                return(true);
            }
            if (StatusName != newEmp.StatusName)
            {
                return(true);
            }
            if (Group != newEmp.Group)
            {
                return(true);
            }

            return(false);
        }