예제 #1
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);
    }
예제 #2
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);
    }
예제 #3
0
 public void SaveDelegationInfo(WCFStaffDelegationModel delegation)
 {
     Data.SaveDelegationInfo(delegation);
 }