Esempio n. 1
0
        private void BindDepartments()
        {
            if (DepartmentId.Equals(Guid.Empty))
            {
                rptDepartment.Visible    = true;
                ucDepartmentEdit.Visible = false;

                var groups = new List <GroupInfo>();
                foreach (var g in CoreContext.GroupManager.GetGroups())
                {
                    AppendGroupsWithChild(groups, g);
                }

                groups.Sort((x, y) => string.Compare(x.Name, y.Name));

                rptDepartment.DataSource = groups;
                rptDepartment.DataBind();
            }
            else
            {
                rptDepartment.Visible    = false;
                ucDepartmentEdit.Visible = true;
                ucDepartmentEdit.DepId   = DepartmentId;
            }
        }
        public override int GetHashCode()
        {
            int hashCode = 13;

            hashCode = (hashCode * 7) + DepartmentId.GetHashCode();
            return(hashCode);
        }
Esempio n. 3
0
        public async Task <IEnumerable <Department> > SearchInfo()
        {
            List <Department> list   = null;
            DepartmentsResult result = null;
            await ServiceProxyFactory.LifeTime(async factory =>
            {
                var service = factory.Create <DepartmentMasterClient>();
                switch (Key)
                {
                case SearchDepartment.WithSection:
                    result = await service.DepartmentWithSectionAsync(Application.Login.SessionKey, Application.Login.CompanyId,
                                                                      SectionId, DepartmentId?.Distinct().ToArray());
                    break;

                default:
                    result = await service.GetItemsAsync(Application.Login.SessionKey, Application.Login.CompanyId);
                    break;
                }

                if (result.ProcessResult.Result)
                {
                    list = result.Departments;
                }
            });

            return(list);
        }
        public JsonResult ReturnPositions(DepartmentId dept)
        {
            var statId = Lists4CV.DeptStatusMap.Where(x => x.DepartmentId == dept.Id).Select(x => x.StatusId);
            var y      = statId.Join(Lists4CV.Status, s => s, q => q.Id, (s, status) => new { status });

            return(Json(y, JsonRequestBehavior.AllowGet));
        }
Esempio n. 5
0
        public async Task <IEnumerable <Department> > SearchByKey(params string[] keys)
        {
            List <Department> list   = null;
            DepartmentsResult result = null;
            await ServiceProxyFactory.LifeTime(async factory =>
            {
                var service = factory.Create <DepartmentMasterClient>();
                switch (Key)
                {
                case SearchDepartment.WithSection:
                    result = await service.DepartmentWithSectionAsync(Application.Login.SessionKey, Application.Login.CompanyId,
                                                                      SectionId, DepartmentId?.Distinct().ToArray());
                    break;

                default:
                    result = await service.GetItemsAsync(Application.Login.SessionKey, Application.Login.CompanyId);
                    break;
                }

                if (result.ProcessResult.Result)
                {
                    list = result.Departments;
                }
            });

            if (list != null)
            {
                list = list.FindAll(
                    f => (!string.IsNullOrEmpty(f.Name) && f.Name.RoughlyContains(keys[0]))
                    );
            }
            return(list);
        }
Esempio n. 6
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(((OrganizationBoxId != null ? OrganizationBoxId.GetHashCode() : 0) * 397) ^
                (DepartmentId != null ? DepartmentId.GetHashCode() : 0));
     }
 }
Esempio n. 7
0
 public override string ToString()
 {
     return(new StringBuilder()
            .Append("Dept ID: ")
            .AppendLine(DepartmentId.ToString())
            .Append("Dept Name: ")
            .AppendLine(DepartmentName)
            .ToString());
 }
Esempio n. 8
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = DepartmentId.GetHashCode();
         hashCode = (hashCode * 397) ^ BearerId.GetHashCode();
         hashCode = (hashCode * 397) ^ PurposeId.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 9
0
        public Task AddToRoleAsync(Employee user, string roleName, CancellationToken cancellationToken)
        {
            DepartmentId departmentId = (DepartmentId)Enum.Parse(typeof(DepartmentId), roleName, true);

            user.Department = departmentId;
            _context.Employees.Update(user);
            _context.SaveChanges();

            return(Task.FromResult(IdentityResult.Success));
        }
Esempio n. 10
0
        public void Add(Program type)
        {
            lock (type)
            {
                if (Count == ProgramId.Length)
                {
                    var newLength  = ProgramId.Length + 4;
                    var _ProgramId = new string[newLength];
                    ProgramId.CopyTo(_ProgramId);
                    ProgramId = _ProgramId;
                    var _Name = new string[newLength];
                    Name.CopyTo(_Name);
                    Name = _Name;
                    var _Duration = new string[newLength];
                    Duration.CopyTo(_Duration);
                    Duration = _Duration;
                    var _Limit = new int[newLength];
                    Limit.CopyTo(_Limit);
                    Limit = _Limit;
                    var _DepartmentId = new string[newLength];
                    DepartmentId.CopyTo(_DepartmentId);
                    DepartmentId = _DepartmentId;
                    var _Specializations = new SpecializationDM[newLength];
                    Specializations.CopyTo(_Specializations);
                    Specializations = _Specializations;
                    var _mountedCourseDM = new MountedCourseDM[newLength];
                    MountedCourses.CopyTo(_mountedCourseDM);
                    MountedCourses = _mountedCourseDM;
                }
                ProgramId.Span[Count]    = type.ProgramId;
                Name.Span[Count]         = type.Name;
                Duration.Span[Count]     = type.Duration;
                Limit.Span[Count]        = type.Limit;
                DepartmentId.Span[Count] = type.DepartmentId;

                Specializations.Span[Count] = new SpecializationDM(length);
                if (type.Specializations?.Count > 0)
                {
                    foreach (var t in type.Specializations)
                    {
                        Specializations.Span[Count].Add(t);
                    }
                }

                MountedCourses.Span[Count] = new MountedCourseDM(length);
                if (type.MountedCourses?.Count > 0)
                {
                    foreach (var t in type.MountedCourses)
                    {
                        MountedCourses.Span[Count].Add(t);
                    }
                }
                Count++;
            }
        }
Esempio n. 11
0
        public int CompareTo(Person other)
        {
            var result = DepartmentId.CompareTo(other.DepartmentId);

            if (result == 0)
            {
                result = other.IsManager.CompareTo(IsManager); // sort true before false
            }
            if (result == 0)
            {
                result = string.Compare(LastName, other.LastName, StringComparison.InvariantCultureIgnoreCase);
            }
            return(result);
        }
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (BusinessEntityId == default(int) ? 0 : BusinessEntityId.GetHashCode());
         hash = hash * 23 + (DepartmentId == default(short) ? 0 : DepartmentId.GetHashCode());
         hash = hash * 23 + (EndDate == null ? 0 : EndDate.GetHashCode());
         hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode());
         hash = hash * 23 + (ShiftId == default(byte) ? 0 : ShiftId.GetHashCode());
         hash = hash * 23 + (StartDate == default(DateTime) ? 0 : StartDate.GetHashCode());
         return(hash);
     }
 }
Esempio n. 13
0
 public bool Equals(Employee other)
 {
     if (other == null)
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Id.Equals(other.Id) && Name.Equals(other.Name) &&
            Surname.Equals(other.Surname) && Patronymic.Equals(other.Patronymic) &&
            DepartmentId.Equals(other.DepartmentId) && IsFired.Equals(other.IsFired) &&
            Salary.Equals(other.Salary) && DateHired.Equals(other.DateHired) &&
            DateFired.Equals(other.DateFired));
 }
Esempio n. 14
0
        /// <summary>
        /// 创建实体
        /// </summary>
        /// <param name="saveType"></param>
        /// <param name="account"></param>
        /// <returns></returns>
        public virtual StaffEntity CreateEntity(SaveType saveType, AccountEntity account)
        {
            var entity = new StaffEntity
            {
                Name       = Name,
                Department = new DepartmentEntity {
                    Id = DepartmentId.Convert <long>()
                },
                Account = new AccountEntity {
                    Id = account == null?0:account.Id
                },
                SaveType = saveType
            };

            if (ReadCustomerType != null)
            {
                entity.SetSetting("ReadCustomerType", (int)ReadCustomerType);
            }
            if (saveType == SaveType.Modify)
            {
                entity.Id = Id.Convert <long>();
                if (Name != null)
                {
                    entity.SetProperty(it => it.Name);
                }
                if (DepartmentId != null)
                {
                    entity.SetProperty(it => it.Department.Id);
                }
                if (ReadCustomerType != null)
                {
                    entity.SetProperty(it => it.Setting);
                }
                if (account != null)
                {
                    entity.SetProperty(it => it.Account.Id);
                }
            }
            entity.SerializeSetting();
            return(entity);
        }
Esempio n. 15
0
        public void SendMessage()
        {
            TextCorpMessage message = new TextCorpMessage(MessageText);

            switch (Target)
            {
            case CorpSendTarget.All:
                message.SetAllUser();
                break;

            case CorpSendTarget.Tag:
                message.SetTag(TagId.Value <int>());
                break;

            case CorpSendTarget.Department:
                message.SetParty(DepartmentId.Value <int>());
                break;

            case CorpSendTarget.User:
                message.SetUser(UserId);
                break;
            }
            message.Send(AppId);
        }
Esempio n. 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string currentDateString = DateTime.Now.ToString("MM/dd/yyyy");

            CreatedDate.Value = currentDateString;
            UpdatedDate.Value = currentDateString;

            List <Branch>   branches     = IBranchService.GetData(0, 0, false);
            List <ListItem> branchesList = new List <ListItem>();

            branches.ForEach(obj => {
                branchesList.Add(new ListItem()
                {
                    Text  = obj.Code + " - " + obj.Name,
                    Value = obj.Id.ToString()
                });
            });

            BranchId.DataSource     = branchesList;
            BranchId.DataTextField  = "Text";
            BranchId.DataValueField = "Value";
            BranchId.DataBind();

            List <Department> departments     = IDepartmentService.GetData(0, 0, false);
            List <ListItem>   departmentsList = new List <ListItem>();

            departments.ForEach(obj => {
                departmentsList.Add(new ListItem()
                {
                    Text  = obj.Code + " - " + obj.Name,
                    Value = obj.Id.ToString()
                });
            });

            DepartmentId.DataSource     = departmentsList;
            DepartmentId.DataTextField  = "Text";
            DepartmentId.DataValueField = "Value";
            DepartmentId.DataBind();

            List <Stage>    stages     = IStageService.GetData(0, 0, false);
            List <ListItem> stagesList = new List <ListItem>();

            stages.ForEach(obj => {
                stagesList.Add(new ListItem()
                {
                    Text  = obj.Code + " - " + obj.Name,
                    Value = obj.Id.ToString()
                });
            });

            StageId.DataSource     = stagesList;
            StageId.DataTextField  = "Text";
            StageId.DataValueField = "Value";
            StageId.DataBind();
            Status.Value = "1";
            string idString = Request.QueryString["id"];

            if (idString != null && idString != "")
            {
                int   id  = Convert.ToInt32(idString);
                Batch obj = IBatchService.GetSingle(id);
                Id.Value          = obj.Id.ToString();
                BranchId.Value    = obj.BranchId.ToString();
                StageId.Value     = obj.StageId.ToString();
                BatchKey.Value    = obj.BatchKey;
                BatchNo.Value     = obj.BatchNo;
                BatchCount.Value  = obj.BatchCount.Value.ToString();
                BatchStatus.Value = obj.BatchStatus.ToString();
                Status.Value      = obj.Status.ToString();
            }
        }
Esempio n. 17
0
        /// <summary>
        /// Gets the hash code
        /// </summary>
        /// <returns>Hash code</returns>
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                var hashCode = 41;
                // Suitable nullity checks etc, of course :)
                if (EmployeeId != null)
                {
                    hashCode = hashCode * 59 + EmployeeId.GetHashCode();
                }
                if (EmployeeCode != null)
                {
                    hashCode = hashCode * 59 + EmployeeCode.GetHashCode();
                }
                if (EmployeeName != null)
                {
                    hashCode = hashCode * 59 + EmployeeName.GetHashCode();
                }

                hashCode = hashCode * 59 + Gender.GetHashCode();
                if (DateOfBirth != null)
                {
                    hashCode = hashCode * 59 + DateOfBirth.GetHashCode();
                }
                if (PhoneNumber != null)
                {
                    hashCode = hashCode * 59 + PhoneNumber.GetHashCode();
                }
                if (DepartmentId != null)
                {
                    hashCode = hashCode * 59 + DepartmentId.GetHashCode();
                }
                if (DepartmentName != null)
                {
                    hashCode = hashCode * 59 + DepartmentName.GetHashCode();
                }
                if (Email != null)
                {
                    hashCode = hashCode * 59 + Email.GetHashCode();
                }

                hashCode = hashCode * 59 + Salary.GetHashCode();

                hashCode = hashCode * 59 + WorkStatus.GetHashCode();
                if (PositionId != null)
                {
                    hashCode = hashCode * 59 + PositionId.GetHashCode();
                }
                if (PositionName != null)
                {
                    hashCode = hashCode * 59 + PositionName.GetHashCode();
                }
                if (TaxCode != null)
                {
                    hashCode = hashCode * 59 + TaxCode.GetHashCode();
                }
                if (JoinDate != null)
                {
                    hashCode = hashCode * 59 + JoinDate.GetHashCode();
                }
                if (IdentityNumber != null)
                {
                    hashCode = hashCode * 59 + IdentityNumber.GetHashCode();
                }
                if (IdentityDate != null)
                {
                    hashCode = hashCode * 59 + IdentityDate.GetHashCode();
                }
                if (IdentityPlace != null)
                {
                    hashCode = hashCode * 59 + IdentityPlace.GetHashCode();
                }
                return(hashCode);
            }
        }
Esempio n. 18
0
 public override int GetHashCode()
 {
     return(DepartmentId.GetHashCode());
 }
Esempio n. 19
0
 public override string ToString()
 {
     return(CourseId + ": " + (Department is null ? DepartmentId.ToString() : Department.DepartmentCode) + " " + CourseNumber);
 }
Esempio n. 20
0
 public JwtUser(string email, DepartmentId department)
 {
     Email  = email;
     RoleId = department;
 }
Esempio n. 21
0
        public void Add(Student student)
        {
            lock (student)
            {
                if (Count == StudentId.Length)
                {
                    var newLength  = StudentId.Length + 1000;
                    var _StudentId = new string[newLength];
                    StudentId.CopyTo(_StudentId);
                    StudentId = _StudentId;
                    var _IndexNumber = new string[newLength];
                    IndexNumber.CopyTo(_IndexNumber);
                    IndexNumber = _IndexNumber;
                    var _ReferenceNumber = new string[newLength];
                    ReferenceNumber.CopyTo(_ReferenceNumber);
                    ReferenceNumber = _ReferenceNumber;
                    var _Surname = new string[newLength];
                    Surname.CopyTo(_Surname);
                    Surname = _Surname;
                    var _Othernames = new string[newLength];
                    Othernames.CopyTo(_Othernames);
                    Othernames = _Othernames;
                    var _Title = new string[newLength];
                    Title.CopyTo(_Title);
                    Title = _Title;
                    var _Gender = new string[newLength];
                    Gender.CopyTo(_Gender);
                    Gender = _Gender;
                    var _MaritalStatus = new string[newLength];
                    MaritalStatus.CopyTo(_MaritalStatus);
                    MaritalStatus = _MaritalStatus;
                    var _DateofBirth = new string[newLength];
                    DateofBirth.CopyTo(_DateofBirth);
                    DateofBirth = _DateofBirth;
                    var _Disability = new bool[newLength];
                    Disability.CopyTo(_Disability);
                    Disability = _Disability;
                    var _Country = new string[newLength];
                    Country.CopyTo(_Country);
                    Country = _Country;
                    var _Region = new string[newLength];
                    Region.CopyTo(_Region);
                    Region = _Region;
                    var _HomeTown = new string[newLength];
                    HomeTown.CopyTo(_HomeTown);
                    HomeTown = _HomeTown;
                    var _Address1 = new string[newLength];
                    Address1.CopyTo(_Address1);
                    Address1 = _Address1;
                    var _Address2 = new string[newLength];
                    Address2.CopyTo(_Address2);
                    Address2 = _Address2;
                    var _Contact1 = new string[newLength];
                    Contact1.CopyTo(_Contact1);
                    Contact1 = _Contact1;
                    var _Contact2 = new string[newLength];
                    Contact2.CopyTo(_Contact2);
                    Contact2 = _Contact2;
                    var _PersonalEmail = new string[newLength];
                    PersonalEmail.CopyTo(_PersonalEmail);
                    PersonalEmail = _PersonalEmail;
                    var _UniversityEmail = new string[newLength];
                    UniversityEmail.CopyTo(_UniversityEmail);
                    UniversityEmail = _UniversityEmail;
                    var _ResidentialStatus = new string[newLength];
                    ResidentialStatus.CopyTo(_ResidentialStatus);
                    ResidentialStatus = _ResidentialStatus;
                    var _ProgramOfStudy = new string[newLength];
                    ProgramOfStudy.CopyTo(_ProgramOfStudy);
                    ProgramOfStudy = _ProgramOfStudy;
                    var _Specialization = new string[newLength];
                    Specialization.CopyTo(_Specialization);
                    Specialization = _Specialization;
                    var _ProgramStatus = new string[newLength];
                    ProgramStatus.CopyTo(_ProgramStatus);
                    ProgramStatus = _ProgramStatus;
                    var _Level = new string[newLength];
                    Level.CopyTo(_Level);
                    Level = _Level;
                    var _StudentType = new string[newLength];
                    StudentType.CopyTo(_StudentType);
                    StudentType = _StudentType;
                    var _EnrollmentOption = new string[newLength];
                    EnrollmentOption.CopyTo(_EnrollmentOption);
                    EnrollmentOption = _EnrollmentOption;
                    var _RegistrationStatus = new string[newLength];
                    RegistrationStatus.CopyTo(_RegistrationStatus);
                    RegistrationStatus = _RegistrationStatus;
                    var _DateOfEntry = new System.DateTime[newLength];
                    DateOfEntry.CopyTo(_DateOfEntry);
                    DateOfEntry = _DateOfEntry;
                    var _DateOfCompletion = new System.DateTime[newLength];
                    DateOfCompletion.CopyTo(_DateOfCompletion);
                    DateOfCompletion = _DateOfCompletion;
                    var _Results = new StudentResultDM[newLength];;
                    Results.CopyTo(_Results);
                    Results = _Results;
                    var _RegisteredCourses = new RegisteredCourseDM[newLength];
                    RegisteredCourses.CopyTo(_RegisteredCourses);
                    RegisteredCourses = _RegisteredCourses;
                    var _EmergencyContact = new EmergencyContactDM[newLength];
                    EmergencyContact.CopyTo(_EmergencyContact);
                    EmergencyContact = _EmergencyContact;
                    var _Owning = new bool[newLength];
                    //Owning.CopyTo(_Owning);
                    //Owning = _Owning;
                    //var _FeesBalance = new string[newLength];
                    //FeesBalance.CopyTo(_FeesBalance);
                    //FeesBalance = _FeesBalance;
                    var _PamentOption = new string[newLength];
                    PamentOption.CopyTo(_PamentOption);
                    PamentOption = _PamentOption;
                    var _DepartmentId = new string[newLength];
                    DepartmentId.CopyTo(_DepartmentId);
                    DepartmentId = _DepartmentId;
                    var _State = new int[newLength];
                    State.CopyTo(_State);
                    State = _State;
                }
                StudentId.Span[Count]          = student.StudentId;
                IndexNumber.Span[Count]        = student.IndexNumber;
                ReferenceNumber.Span[Count]    = student.ReferenceNumber;
                Surname.Span[Count]            = student.Surname;
                Othernames.Span[Count]         = student.Othernames;
                Title.Span[Count]              = student.Title;
                Gender.Span[Count]             = student.Gender;
                MaritalStatus.Span[Count]      = student.MaritalStatus;
                DateofBirth.Span[Count]        = student.DateofBirth;
                Disability.Span[Count]         = student.Disability;
                Country.Span[Count]            = student.Country;
                Region.Span[Count]             = student.Region;
                HomeTown.Span[Count]           = student.HomeTown;
                Address1.Span[Count]           = student.Address1;
                Address2.Span[Count]           = student.Address2;
                Contact1.Span[Count]           = student.Contact1;
                Contact2.Span[Count]           = student.Contact2;
                PersonalEmail.Span[Count]      = student.PersonalEmail;
                UniversityEmail.Span[Count]    = student.UniversityEmail;
                ResidentialStatus.Span[Count]  = student.ResidentialStatus;
                ProgramOfStudy.Span[Count]     = student.ProgramOfStudy;
                Specialization.Span[Count]     = student.Specialization;
                ProgramStatus.Span[Count]      = student.ProgramStatus;
                Level.Span[Count]              = student.Level;
                StudentType.Span[Count]        = student.StudentType;
                EnrollmentOption.Span[Count]   = student.EnrollmentOption;
                RegistrationStatus.Span[Count] = student.RegistrationStatus;
                DateOfEntry.Span[Count]        = student.DateOfEntry;
                DateOfCompletion.Span[Count]   = student.DateOfCompletion;

                //Owning.Span[Count] = student.Owning;
                //FeesBalance.Span[Count] = student.FeesBalance;
                PamentOption.Span[Count] = student.PamentOption;
                DepartmentId.Span[Count] = student.DepartmentId;
                State.Span[Count]++;
                Count++;

                Results.Span[Count] = new StudentResultDM(length);
                if (student.Results?.Count > 0)
                {
                    foreach (var t in student.Results)
                    {
                        Results.Span[Count].Add(t);
                    }
                }

                EmergencyContact.Span[Count] = new EmergencyContactDM(length);
                if (student.EmergencyContact?.Count > 0)
                {
                    foreach (var t in student.EmergencyContact)
                    {
                        EmergencyContact.Span[Count].Add(t);
                    }
                }

                RegisteredCourses.Span[Count] = new RegisteredCourseDM(length);
                if (student.RegisteredCourses?.Count > 0)
                {
                    foreach (var t in student.RegisteredCourses)
                    {
                        RegisteredCourses.Span[Count].Add(t);
                    }
                }
            }
        }
Esempio n. 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //string SearchText = string.Empty;
            if (!string.IsNullOrEmpty(Request.QueryString["IsNewSearch"]))
            {
                IsNewSearch.Value = Request.QueryString["IsNewSearch"].ToString();
            }

            divError.Visible  = false;
            divResult.Visible = false;
            int departmentId = 0;
            List <Department> departmentList = IDepartmentService.GetData(0, 0, false);

            DepartmentId.DataSource     = departmentList;
            DepartmentId.DataTextField  = "Name";
            DepartmentId.DataValueField = "Id";
            DepartmentId.DataBind();
            DepartmentId.Items.Insert(0, new ListItem()
            {
                Text = "Select Department", Value = ""
            });
            DocType.Items.Insert(0, new ListItem()
            {
                Text = "Select Doc Type", Value = ""
            });
            if (!string.IsNullOrEmpty(Request.QueryString["DepartmentId"]) && int.TryParse(Request.QueryString["DepartmentId"], out int n))
            {
                DepartmentId.SelectedValue = Request.QueryString["DepartmentId"];
                departmentId = Convert.ToInt32(Request.QueryString["DepartmentId"]);
                List <DocTypeModel> docTypes = IDepartmentService.GetDocTypesByDepartmentId(departmentId);
                DocType.DataSource     = docTypes;
                DocType.DataTextField  = "DocType";
                DocType.DataValueField = "DocType";
                DocType.DataBind();
                if (!string.IsNullOrEmpty(Request.QueryString["DocType"]))
                {
                    DocType.SelectedValue = Request.QueryString["DocType"];
                }
            }
            else
            {
            }
            //if (!string.IsNullOrEmpty(Request.QueryString["DocType"]))
            //    DocType.SelectedValue = Request.QueryString["DocType"];

            if (departmentId != 0 || !string.IsNullOrEmpty(Request.QueryString["DocType"]) || !string.IsNullOrEmpty(Request.QueryString["Search"]))
            {
                if (!string.IsNullOrEmpty(Request.QueryString["Search"]))
                {
                    Search.Value = Request.QueryString["Search"];
                }

                if (!string.IsNullOrEmpty(Request.QueryString["hdnNumberPerPage"]))
                {
                    hdnNumberPerPage.Value = Request.QueryString["hdnNumberPerPage"].ToString();
                }

                if (!string.IsNullOrEmpty(Request.QueryString["hdnCurrentPageNo"]))
                {
                    hdnCurrentPageNo.Value = Request.QueryString["hdnCurrentPageNo"].ToString();
                }

                if (!string.IsNullOrEmpty(Request.QueryString["hdnTotalRecordsCount"]))
                {
                    hdnTotalRecordsCount.Value = Request.QueryString["hdnTotalRecordsCount"].ToString();
                }

                int skip = 0, take = 10;
                if (IsNewSearch.Value != "0")
                {
                    skip = 0;
                    take = 10;
                    hdnNumberPerPage.Value     = "10";
                    hdnCurrentPageNo.Value     = "1";
                    hdnTotalRecordsCount.Value = ISetService.GetSetsForMfilesAccountCount(departmentId, Request.QueryString["DocType"], Request.QueryString["Search"]).ToString();
                }
                else
                {
                    skip = (Convert.ToInt32(hdnCurrentPageNo.Value) - 1) * 10;
                    take = 10;
                }

                List <DocTypeSetModel> list = new List <DocTypeSetModel>();
                if (departmentId != 0 || !string.IsNullOrEmpty(Request.QueryString["DocType"]) || !string.IsNullOrEmpty(Request.QueryString["Search"]))
                {
                    list = ISetService.GetSetsForMfilesAccount(departmentId, Request.QueryString["DocType"], Request.QueryString["Search"], skip, take);
                }

                StringBuilder asb           = new StringBuilder();
                int           index         = 1;
                foreach (DocTypeSetModel set in list)
                {
                    Branch     branch         = IBranchService.GetSingle(set.BranchId);
                    Department department     = departmentList.FirstOrDefault(a => a.Id == set.DepartmentId);
                    string     departmentCode = department.Code;
                    string     deptCode       = departmentCode.Split('-')[0];
                    string     jobCode        = departmentCode.Split('-')[1];
                    string     columnData     = "";
                    if (departmentCode == "E-LIBRARY")
                    {
                        //AA NUMBER
                        //ACCOUNT NUMBER
                        columnData  = "AA No: " + set.AANO;
                        columnData += "<br/>Account No: " + set.AccountNo;
                    }
                    else if (deptCode == "ETP")
                    {
                        if (jobCode == "LN")
                        {
                            columnData  = "AA No: " + set.AANO;
                            columnData += "<br/>Account No: " + set.AccountNo;
                        }
                        else if (jobCode == "LL")
                        {
                            columnData = "AA No: " + set.AANO;
                        }
                        else if (jobCode == "PR")
                        {
                            columnData = "Project Code: " + set.AANO;
                        }
                        else if (jobCode == "WF")
                        {
                            columnData = "Welfare Code: " + set.AANO;
                        }
                    }
                    else if (deptCode == "LOS")
                    {
                        columnData = "AA No: " + set.AANO;
                    }

                    asb.Append(@"<tr>
                                    <td class=''>
                                        " + index + @"
                                    </td>
                                    <td>" + branch.Code + @"</td>
                                    <td>" + department.Code + @"</td>
                                    <td class='text-center mb-5'>
                                        " + set.BatchNo + @"
                                    </td>
                                    <td>
                                        <div><strong>" + columnData + @"</strong><div>
                                    </td>
                                    <td><div style='min-width: 150px;'><a href='#' data-original-title='Click to view' data-trigger='hover' data-placement='bottom' class='popovers text-info'><strong>" + set.DocType + @"</strong></a> ( <small> pages: <strong>" + set.PageCount + @"</strong></small> )</div></td>
                                    <td>" + MfileStatus(set.IsReleased) + @"</td>
                                    <td><a data-original-title='Click to view' data-trigger='hover' data-placement='bottom' class='popovers text-info' href='SetView.aspx?setId=" + set.SetId + @"' target='_blank'><i class='fa fa-eye'></i></a></td>
                                    <td>" + set.CreatedDate.ToString("dd/MM/yyyy HH:mm:ss") + @"</td>
                                </tr>");
                    //  }
                    index++;
                }

                string result = @"<button data-dismiss='alert' class='close close-sm' type='button'>
                                            <i class='fa fa-times'></i></button>
                                        <strong>Done!</strong> Found the " + hdnTotalRecordsCount.Value + " records with .";
                if (departmentId != 0)
                {
                    result += DepartmentId.SelectedItem.Text + " Department &";
                }
                if (!string.IsNullOrEmpty(Request.QueryString["DocType"]))
                {
                    result += Request.QueryString["DocType"] + " Doc Type &";
                }
                if (!string.IsNullOrEmpty(Request.QueryString["Search"]))
                {
                    result += "this " + Request.QueryString["Search"] + " text.";
                }
                divResult.Visible   = true;
                divResult.InnerHtml = result;

                setsTbody.InnerHtml = asb.ToString();
            }
            else
            {
                if (IsNewSearch.Value == "1")
                {
                    divError.Visible = true;
                }
                divError.InnerHtml = @"<button data-dismiss='alert' class='close close-sm' type='button'>
                                            <i class='fa fa-times'></i></button>
                                        <strong>Oh snap!</strong> Please select at lest one select option.";
            }
        }
Esempio n. 23
0
        /// <summary>
        /// Returns true if Employee instances are equal
        /// </summary>
        /// <param name="other">Instance of Employee to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Employee other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     EmployeeId == other.EmployeeId ||
                     EmployeeId != null &&
                     EmployeeId.Equals(other.EmployeeId)
                     ) &&
                 (
                     EmployeeCode == other.EmployeeCode ||
                     EmployeeCode != null &&
                     EmployeeCode.Equals(other.EmployeeCode)
                 ) &&
                 (
                     EmployeeName == other.EmployeeName ||
                     EmployeeName != null &&
                     EmployeeName.Equals(other.EmployeeName)
                 ) &&
                 (
                     Gender == other.Gender ||

                     Gender.Equals(other.Gender)
                 ) &&
                 (
                     DateOfBirth == other.DateOfBirth ||
                     DateOfBirth != null &&
                     DateOfBirth.Equals(other.DateOfBirth)
                 ) &&
                 (
                     PhoneNumber == other.PhoneNumber ||
                     PhoneNumber != null &&
                     PhoneNumber.Equals(other.PhoneNumber)
                 ) &&
                 (
                     DepartmentId == other.DepartmentId ||
                     DepartmentId != null &&
                     DepartmentId.Equals(other.DepartmentId)
                 ) &&
                 (
                     DepartmentName == other.DepartmentName ||
                     DepartmentName != null &&
                     DepartmentName.Equals(other.DepartmentName)
                 ) &&
                 (
                     Email == other.Email ||
                     Email != null &&
                     Email.Equals(other.Email)
                 ) &&
                 (
                     Salary == other.Salary ||

                     Salary.Equals(other.Salary)
                 ) &&
                 (
                     WorkStatus == other.WorkStatus ||

                     WorkStatus.Equals(other.WorkStatus)
                 ) &&
                 (
                     PositionId == other.PositionId ||
                     PositionId != null &&
                     PositionId.Equals(other.PositionId)
                 ) &&
                 (
                     PositionName == other.PositionName ||
                     PositionName != null &&
                     PositionName.Equals(other.PositionName)
                 ) &&
                 (
                     TaxCode == other.TaxCode ||
                     TaxCode != null &&
                     TaxCode.Equals(other.TaxCode)
                 ) &&
                 (
                     JoinDate == other.JoinDate ||
                     JoinDate != null &&
                     JoinDate.Equals(other.JoinDate)
                 ) &&
                 (
                     IdentityNumber == other.IdentityNumber ||
                     IdentityNumber != null &&
                     IdentityNumber.Equals(other.IdentityNumber)
                 ) &&
                 (
                     IdentityDate == other.IdentityDate ||
                     IdentityDate != null &&
                     IdentityDate.Equals(other.IdentityDate)
                 ) &&
                 (
                     IdentityPlace == other.IdentityPlace ||
                     IdentityPlace != null &&
                     IdentityPlace.Equals(other.IdentityPlace)
                 ));
        }
Esempio n. 24
0
 public override bool Equals(object obj)
 {
     return(obj is DepartmentManagerSM manager &&
            EmployeeId.Equals(manager.EmployeeId) &&
            DepartmentId.Equals(manager.DepartmentId));
 }