Пример #1
0
    public static string TermiateDelegation(string deptId)
    {
        ManageAuthorityDelegationController manageAuthorityDelegationController = new ManageAuthorityDelegationController();

        manageAuthorityDelegationController.TermiateEmployee(deptId);
        return(deptId);
    }
Пример #2
0
    // Delegate
    public static List <WCFStaffModel> GetStaffNameByDepartmentId(string depId, string staffId)
    {
        ManageAuthorityDelegationController manageAuthorityDelegationController = new ManageAuthorityDelegationController();
        List <Staff>         staffList    = manageAuthorityDelegationController.GetStaffNameByDepartmentId(depId, staffId);
        List <WCFStaffModel> wcfStaffList = new List <WCFStaffModel>();

        foreach (Staff s in staffList)
        {
            WCFStaffModel w = new WCFStaffModel();
            w.StaffId          = s.StaffId;
            w.Password         = s.Password;
            w.StaffName        = s.StaffName;
            w.RoleId           = s.RoleId;
            w.RoleName         = s.Role.RoleName;
            w.DepartmentId     = s.DepartmentId;
            w.DepartmentName   = s.Department.DepartmentName;
            w.Email            = s.Email;
            w.PhoneNumber      = s.PhoneNumber;
            w.Address          = s.Address;
            w.EmailPassword    = s.EmailPassword;
            w.DepartmentHeadId = s.Department.DepartmentHead_ID;
            wcfStaffList.Add(w);
        }
        return(wcfStaffList);
    }
Пример #3
0
    public static WCFStaffDelegationModel CheckDelegationStatus(string depId)
    {
        ManageAuthorityDelegationController manageAuthorityDelegationController = new ManageAuthorityDelegationController();

        LogicUniversityDataModel.Delegate delegation      = manageAuthorityDelegationController.CheckStatus(depId);
        WCFStaffDelegationModel           staffDelegation = new WCFStaffDelegationModel();

        if (delegation != null)
        {
            // if (DateTime.Now.Date <= delegation.StartDate.Value.Date)
            //  {

            staffDelegation.DelegateId       = delegation.DelegateId;
            staffDelegation.DepartmentHeadId = delegation.DepartmentHeadId;
            staffDelegation.StaffId          = delegation.StaffId;
            staffDelegation.StaffName        = delegation.Staff.StaffName;
            staffDelegation.RoleName         = delegation.Staff.Role.RoleName;
            staffDelegation.StartDate        = ((DateTime)delegation.StartDate).ToString(format);
            staffDelegation.EndDate          = ((DateTime)delegation.EndDate).ToString(format);
            if ((Boolean)delegation.Status)
            {
                staffDelegation.Status = "TRUE";
            }
            else
            {
                staffDelegation.Status = "FALSE";
            }
            //   }
            //if(DateTime.Now.Date > delegation.EndDate.Value.Date)
            //{
            //    staffDelegation.DelegateId = delegation.DelegateId;
            //    staffDelegation.DepartmentHeadId = delegation.DepartmentHeadId;
            //    staffDelegation.StaffId = delegation.StaffId;
            //    staffDelegation.StaffName = delegation.Staff.StaffName;
            //    staffDelegation.RoleName = delegation.Staff.Role.RoleName;
            //    staffDelegation.StartDate = ((DateTime)delegation.StartDate).ToString(format);
            //    staffDelegation.EndDate = ((DateTime)delegation.EndDate).ToString(format);
            //    if ((Boolean)delegation.Status)
            //    {
            //        staffDelegation.Status = "TRUE";
            //    }
            //    else
            //    {
            //        staffDelegation.Status = "FALSE";
            //    }

            //}
            //(DateTime.Now.Date > delegation.EndDate.Value.Date)
        }
        return(staffDelegation);
    }
Пример #4
0
    public static void SaveDelegationInfo(WCFStaffDelegationModel delegation)
    {
        ManageAuthorityDelegationController manageAuthorityDelegationController = new ManageAuthorityDelegationController();
        DelegateEmployee delegateStaff = new DelegateEmployee();

        delegateStaff.DepartmentheadId = delegation.DepartmentHeadId;
        delegateStaff.StaffId          = delegation.StaffId;
        delegateStaff.StaffName        = delegation.StaffName;
        delegateStaff.StartDate        = Convert.ToDateTime(delegation.StartDate);
        delegateStaff.EndDate          = Convert.ToDateTime(delegation.EndDate);
        delegateStaff.Status           = true;

        String roleName = delegation.RoleName;

        // manageAuthorityDelegationController.SaveDelegateInfo(delegateStaff);
        manageAuthorityDelegationController.SaveDelegateInfoMobile(delegateStaff, delegateStaff.StaffName, roleName);
    }