예제 #1
0
 /// <summary>
 /// 转换成枚举
 /// </summary>
 public static int ApplicationTypeToValue(ApplicationTypeEnum enumOption)
 {
     try{
         return((int)enumOption);
     }catch (Exception ex) {
         throw new ArgumentException("enumOption", ex);
     }
 }
 public CommandItem(string command, string name, string parent, string value, string value2 = "", string units = "", string notes = "", ApplicationTypeEnum applicationType = ApplicationTypeEnum.General)
 {
     Command         = command;
     Name            = name;
     Parent          = parent;
     Value           = value;
     Value2          = value2;
     Units           = units;
     Notes           = notes;
     ApplicationType = applicationType;
 }
예제 #3
0
        public DownloadApplicationActor(
            IDownloadApplicationSettings downloadApplicationSettings,
            IHttpClientFactory httpClientFactory,
            IHostingEnvironment hostingEnvironment,
            string getBuildsUrl,
            string getBuildDownloadLinkTemplateUrl,
            ApplicationTypeEnum applicationType,
            ActorPathsBuilder actorPathsBuilder)
        {
            this.getBuildsUrl = getBuildsUrl;
            this.getBuildDownloadLinkTemplateUrl = getBuildDownloadLinkTemplateUrl;
            this.hostingEnvironment          = hostingEnvironment;
            this.downloadApplicationSettings = downloadApplicationSettings;
            this.httpClientFactory           = httpClientFactory;
            this.applicationType             = applicationType;

            this.applicationBuildsActor = Context.ActorSelection(actorPathsBuilder.Get(WellKnownActorPaths.ApplicationBuilds));
        }
예제 #4
0
        public bool Vaildate()
        {
            _ItsView.ErrorMessage      = string.Empty;
            _ItsView.ErrorValidateTime = string.Empty;
            if (!int.TryParse(_ItsView.DepartmentID, out _DepartmentID))
            {
                _ItsView.ErrorMessage = "部门ID必须为整数!";
                return(false);
            }
            if (string.IsNullOrEmpty(_ItsView.SearchFrom))
            {
                _SearchFrom = Convert.ToDateTime("1900-1-1");
            }
            else if (!DateTime.TryParse(_ItsView.SearchFrom, out _SearchFrom))
            {
                _ItsView.ErrorValidateTime = "查询时间格式不正确!";
                return(false);
            }
            if (string.IsNullOrEmpty(_ItsView.SearchTo))
            {
                _SearchTo = Convert.ToDateTime("2900-12-31");
            }
            else if (!DateTime.TryParse(_ItsView.SearchTo, out _SearchTo))
            {
                _ItsView.ErrorValidateTime = "查询时间格式不正确!";
                return(false);
            }
            int applicationTypeID;
            int statusID;

            if (!int.TryParse(_ItsView.ApplicationType, out applicationTypeID))
            {
                _ItsView.ErrorMessage = "申请类型设置不正确!";
                return(false);
            }
            if (!int.TryParse(_ItsView.Status, out statusID))
            {
                _ItsView.ErrorMessage = "申请状态设置不正确!";
                return(false);
            }
            _ApplicationType   = (ApplicationTypeEnum)applicationTypeID;
            _ApplicationStatus = RequestStatus.FindRequestStatus(statusID);
            return(true);
        }
예제 #5
0
        /// <summary>
        /// 根据申请类型枚举获取名称
        /// </summary>
        /// <param name="type">申请类型</param>
        /// <returns></returns>
        public static string GetTypeName(ApplicationTypeEnum type)
        {
            switch (type)
            {
            case ApplicationTypeEnum.OverTime:
                return("加班申请");

            case ApplicationTypeEnum.InCityOut:
                return("市内外出申请");

            case ApplicationTypeEnum.OutCityOut:
                return("出差申请");

            case ApplicationTypeEnum.TrainOut:
                return("培训外出申请");

            case ApplicationTypeEnum.LeaveRequest:
                return("请假申请");

            default:
                return("");
            }
        }
        private void solidworksBuildTemplate_Click(object sender, RibbonControlEventArgs e)
        {
            ApplicationType = ApplicationTypeEnum.Solidworks;

            AddTemplate();
        }
        private void InventorGenTemplateButton_Click(object sender, RibbonControlEventArgs e)
        {
            ApplicationType = ApplicationTypeEnum.Inventor;

            AddTemplate();
        }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PostApplicationRequest" /> class.
 /// </summary>
 /// <param name="ApplicationName">The application title (required).</param>
 /// <param name="ApplicationDescription">Description of the application that will help you manage multiple applications.</param>
 /// <param name="ApplicationType">Indicates if the application is a mobile application (required).</param>
 /// <param name="ReleaseName">The release name (required).</param>
 /// <param name="ReleaseDescription">Description to add additional details that help describe the release.</param>
 /// <param name="EmailList">List the email addresses of additional people who should be informed of activity related to this release. Separate multiple email addresses with a semicolon or comma.</param>
 /// <param name="OwnerId">Select an Owner from the list of registered users in your tenant. The \&quot;Owner\&quot; receives all email notifications related to this application (required).</param>
 /// <param name="Attributes">Application attributes. This is an array of key/value objects. Example, [{\&quot;Attribute 1\&quot;: \&quot;value 1\&quot;}, {\&quot;Attribute 2\&quot;: \&quot;value 2\&quot;}, {\&quot;Attribute 3\&quot;: \&quot;value 3\&quot;} ].</param>
 /// <param name="BusinessCriticalityType">The business criticality id (required).</param>
 /// <param name="SdlcStatusType">The SDLC status id (required).</param>
 public PostApplicationRequest(string ApplicationName = default(string), string ApplicationDescription = default(string), ApplicationTypeEnum ApplicationType = default(ApplicationTypeEnum), string ReleaseName = default(string), string ReleaseDescription = default(string), string EmailList = default(string), int?OwnerId = default(int?), List <ApplicationAttribute> Attributes = default(List <ApplicationAttribute>), BusinessCriticalityTypeEnum BusinessCriticalityType = default(BusinessCriticalityTypeEnum), SdlcStatusTypeEnum SdlcStatusType = default(SdlcStatusTypeEnum))
 {
     // to ensure "ApplicationName" is required (not null)
     if (ApplicationName == null)
     {
         throw new InvalidDataException("ApplicationName is a required property for PostApplicationRequest and cannot be null");
     }
     else
     {
         this.ApplicationName = ApplicationName;
     }
     // to ensure "ApplicationType" is required (not null)
     if (ApplicationType == null)
     {
         throw new InvalidDataException("ApplicationType is a required property for PostApplicationRequest and cannot be null");
     }
     else
     {
         this.ApplicationType = ApplicationType;
     }
     // to ensure "ReleaseName" is required (not null)
     if (ReleaseName == null)
     {
         throw new InvalidDataException("ReleaseName is a required property for PostApplicationRequest and cannot be null");
     }
     else
     {
         this.ReleaseName = ReleaseName;
     }
     // to ensure "OwnerId" is required (not null)
     if (OwnerId == null)
     {
         throw new InvalidDataException("OwnerId is a required property for PostApplicationRequest and cannot be null");
     }
     else
     {
         this.OwnerId = OwnerId;
     }
     // to ensure "BusinessCriticalityType" is required (not null)
     if (BusinessCriticalityType == null)
     {
         throw new InvalidDataException("BusinessCriticalityType is a required property for PostApplicationRequest and cannot be null");
     }
     else
     {
         this.BusinessCriticalityType = BusinessCriticalityType;
     }
     // to ensure "SdlcStatusType" is required (not null)
     if (SdlcStatusType == null)
     {
         throw new InvalidDataException("SdlcStatusType is a required property for PostApplicationRequest and cannot be null");
     }
     else
     {
         this.SdlcStatusType = SdlcStatusType;
     }
     this.ApplicationDescription = ApplicationDescription;
     this.ReleaseDescription     = ReleaseDescription;
     this.EmailList  = EmailList;
     this.Attributes = Attributes;
 }
 public List <Request> GetRequestRecordByCondition(string employeeName, int departmentID, int?gradeType,
                                                   DateTime searchFrom, DateTime searchTo, ApplicationTypeEnum applicationType,
                                                   RequestStatus applicationStatus, Account loginUser)
 {
     return(new ApplicationSearch().GetRequestRecordByCondition(employeeName, departmentID, gradeType,
                                                                searchFrom, searchTo, applicationType, applicationStatus, loginUser));
 }
예제 #10
0
 public GetLatestApplicationBuildPath(ApplicationTypeEnum applicationTypeEnum)
 {
     this.ApplicationType = applicationTypeEnum;
 }
예제 #11
0
        private async Task <IEnumerable <DevicePushToken> > GetDevicesPushTokensByApplication(ApplicationTypeEnum applicationType)
        {
            var response = await this.pushNotificationsDevicesActor.Ask <GetDevicePushTokensByApplication.Response>(
                new GetDevicePushTokensByApplication(this.pushDeviceTypeByApplicationType[applicationType]));

            return(response.DevicePushTokens.ToArray());
        }
예제 #12
0
 public UpdateAvailableWithAdditionalData(ApplicationTypeEnum applicationType, IEnumerable <DevicePushToken> devicesPushTokens)
 {
     this.ApplicationType   = applicationType;
     this.DevicesPushTokens = devicesPushTokens;
 }
 public UpdateAvailable(ApplicationTypeEnum applicationType)
 {
     this.ApplicationType = applicationType;
 }
 public RefreshApplicationBuildSuccess(ApplicationTypeEnum applicationType, bool updateAvailable)
 {
     this.ApplicationType = applicationType;
     this.UpdateAvailable = updateAvailable;
 }
        private object GetApplicationBuildResult(DownloadApplicationBuild.Response message, ApplicationTypeEnum applicationType)
        {
            if (message is DownloadApplicationBuild.Error error)
            {
                return(new RefreshApplicationBuildError(error.Exception));
            }

            return(new RefreshApplicationBuildSuccess(
                       applicationType,
                       ((DownloadApplicationBuild.Success)message).UpdateAvailable));
        }
예제 #16
0
        /// <summary>
        /// 通过条件查找员工的请假,加班,外出情况,便于人事后台查看流程流转状态
        /// </summary>
        public List <Request> GetRequestRecordByCondition(string employeeName, int departmentID, int?gradeType,
                                                          DateTime from, DateTime to, ApplicationTypeEnum applicationType,
                                                          RequestStatus applicationStatus, Account loginUser)
        {
            List <Request> applicationList = new List <Request>();

            var list = EmployeeLogic.GetEmployeeBasicInfoByBasicCondition(employeeName, EmployeeTypeEnum.All, -1,
                                                                          gradeType, departmentID, true,
                                                                          HrmisPowers.A509, loginUser.Id, -1,
                                                                          new List <int>
            {
                (int)EmployeeTypeEnum.BorrowedEmployee
            });

            List <Employee> employeeList = new List <Employee>();

            foreach (var employeeEntity in list)
            {
                employeeList.Add(EmployeeEntity.Convert(employeeEntity));
            }
            //  new GetEmployee().GetEmployeeBasicInfoByBasicCondition(employeeName, EmployeeTypeEnum.All, -1, departmentID, true, -1, gradeType);
            //if (departmentID==-1)//如果查全部员工需去掉没有查询权限的员工
            //{
            //    EmployeeList = HrmisUtility.RemoteUnAuthEmployee(EmployeeList, AuthType.HRMIS, loginUser, HrmisPowers.A509);
            //}
            for (int i = 0; i < employeeList.Count; i++)
            {
                //if (EmployeeList[i] == null || EmployeeList[i].EmployeeType == EmployeeTypeEnum.BorrowedEmployee)
                //{
                //    continue;
                //}

                //根据入职离职时间确定考勤的有效时间

                DateTime employeeFromDate = DateTime.Compare(employeeList[i].EmployeeDetails.Work.ComeDate, from) > 0
                                                ? employeeList[i].EmployeeDetails.Work.ComeDate
                                                : from;
                DateTime employeeToDate;
                if (employeeList[i].EmployeeType == EmployeeTypeEnum.DimissionEmployee &&
                    employeeList[i].EmployeeDetails.Work.DimissionInfo != null)
                {
                    employeeToDate =
                        DateTime.Compare(employeeList[i].EmployeeDetails.Work.DimissionInfo.DimissionDate, to) < 0
                            ? employeeList[i].EmployeeDetails.Work.DimissionInfo.DimissionDate
                            : to;
                }
                else
                {
                    employeeToDate = to;
                }
                if (DateTime.Compare(employeeFromDate, employeeToDate) > 0)
                {
                    continue;
                }
                employeeList[i].EmployeeAttendance = new EmployeeAttendance(employeeFromDate, employeeToDate);
                employeeList[i].EmployeeAttendance.PlanDutyDetailList = _DalRull.GetPlanDutyDetailByAccount(employeeList[i].Account.Id, employeeFromDate, employeeToDate);
                //没有考勤规则的人不会这里出现
                if (employeeList[i].EmployeeAttendance.PlanDutyDetailList == null ||
                    employeeList[i].EmployeeAttendance.PlanDutyDetailList.Count == 0)
                {
                    continue;
                }
                List <Request> applicationListTemp = new List <Request>();
                switch (applicationType)
                {
                case ApplicationTypeEnum.All:
                    applicationListTemp.AddRange(
                        GetRequestFromLeaveRequest(employeeList[i].Account.Id,
                                                   employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate,
                                                   applicationStatus));
                    applicationListTemp.AddRange(
                        GetRequestFromOutApplication(employeeList[i].Account.Id,
                                                     employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate,
                                                     applicationStatus, OutType.All));
                    applicationListTemp.AddRange(
                        GetRequestFromOverWork(employeeList[i].Account.Id,
                                               employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate,
                                               applicationStatus));
                    break;

                case ApplicationTypeEnum.LeaveRequest:
                    applicationListTemp.AddRange(
                        GetRequestFromLeaveRequest(employeeList[i].Account.Id,
                                                   employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate,
                                                   applicationStatus));
                    break;

                case ApplicationTypeEnum.InCityOut:
                    applicationListTemp.AddRange(
                        GetRequestFromOutApplication(employeeList[i].Account.Id,
                                                     employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate,
                                                     applicationStatus, OutType.InCity));
                    break;

                case ApplicationTypeEnum.OutCityOut:
                    applicationListTemp.AddRange(
                        GetRequestFromOutApplication(employeeList[i].Account.Id,
                                                     employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate,
                                                     applicationStatus, OutType.OutCity));
                    break;

                case ApplicationTypeEnum.TrainOut:
                    applicationListTemp.AddRange(
                        GetRequestFromOutApplication(employeeList[i].Account.Id,
                                                     employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate,
                                                     applicationStatus, OutType.Train));
                    break;

                case ApplicationTypeEnum.OverTime:
                    applicationListTemp.AddRange(
                        GetRequestFromOverWork(employeeList[i].Account.Id,
                                               employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate,
                                               applicationStatus));
                    break;

                default:
                    break;
                }
                foreach (Request request in applicationListTemp)
                {
                    request.Account.Name = employeeList[i].Account.Name;
                }
                applicationList.AddRange(applicationListTemp);
            }
            return(applicationList);
        }