void IWorkspaceWindow.RefreshCheckinProgress(
     CheckinStatus checkinStatus,
     BuildProgressSpeedAndRemainingTime.ProgressData progressData)
 {
     mDeveloperProgressOperationHandler.
     RefreshCheckinProgress(checkinStatus, progressData);
 }
Esempio n. 2
0
 void Apply(CheckinCreated e)
 {
     Id        = e.Id.ToString();
     StartDate = e.StartDate;
     Duration  = e.Duration;
     Status    = CheckinStatus.Pending;
 }
Esempio n. 3
0
        public void Start()
        {
            if (_startDate != DateTime.Now)
            {
                throw new Exception("not valid date to start");
            }

            if (_status == CheckinStatus.Expired)
            {
                throw new Exception("Expired");
            }

            if (_status != CheckinStatus.New)
            {
                throw new Exception("Already started");
            }

            var staffs = _employeeServices.FindStaffWithValidEffectiveDate(_startDate, _endDate);

            _status = CheckinStatus.Started;

            foreach (var staff in staffs)
            {
                _checkinEvaluates.Add(new CheckinEvaluate()
                {
                    Status      = CheckinCommentStatus.Pending,
                    EmployeeId  = staff.EmployeeId,
                    EvaluatorId = staff.EvaluatorId
                });
            }
            //can build email to send
            //or just email domain subscribe CheckinStarted to remind
            ApplyChange(new CheckinStarted(int.Parse(Id), staffs));
        }
Esempio n. 4
0
        public Checkin(int id, DateTime startDate, DateTime endDate)
        {
            Id         = id.ToString();
            _startDate = startDate;
            _endDate   = endDate;
            _status    = CheckinStatus.New;

            ApplyChange(new CheckinCreated(int.Parse(Id), startDate < endDate, _status));
        }
Esempio n. 5
0
        public void Expired()
        {
            if (_status != CheckinStatus.Started)
            {
                throw new Exception("Not started");
            }

            _status = CheckinStatus.Expired;

            List <EmployeeInfo> staffs = _employeeServices.FindStaffWithValidEffectiveDate(_startDate, _endDate);

            ApplyChange(new CheckinExpired(int.Parse(Id), staffs));
        }
Esempio n. 6
0
        internal void Refresh(
            CheckinStatus checkinStatus,
            BuildProgressSpeedAndRemainingTime.ProgressData progressData)
        {
            if (checkinStatus == null)
            {
                return;
            }

            var progress = mGuiClient.Progress;

            progress.ProgressHeader = checkinStatus.StatusString;

            if (checkinStatus.Status >= EnumCheckinStatus.eciConfirming)
            {
                progress.CanCancelProgress = false;
            }

            if (checkinStatus.Status == EnumCheckinStatus.eciCancelling)
            {
                return;
            }

            int nowTicks = Environment.TickCount;

            progress.TotalProgressMessage = mProgressRender.GetUploadSize(
                checkinStatus.TransferredSize, checkinStatus.TotalSize, progressData);

            progress.TotalProgressPercent = GetProgressBarPercent.ForTransfer(
                checkinStatus.TransferredSize, checkinStatus.TotalSize) / 100f;

            progress.ShowCurrentBlock = mProgressRender.
                                        NeedShowCurrentBlockForCheckinStatus(checkinStatus, nowTicks);

            string currentFileInfo = mProgressRender.GetCurrentFileInfo(
                checkinStatus.CurrentCheckinBlock, mWkInfo.ClientPath);

            progress.ProgressHeader = currentFileInfo;

            float fileProgressBarValue = GetProgressBarPercent.ForTransfer(
                checkinStatus.CurrentCheckinBlock.UploadedSize,
                checkinStatus.CurrentCheckinBlock.BlockSize) / 100f;

            progress.CurrentBlockProgressPercent = fileProgressBarValue;

            progress.CurrentBlockProgressMessage = mProgressRender.GetCurrentBlockUploadSize(
                checkinStatus.CurrentCheckinBlock, nowTicks);
        }
Esempio n. 7
0
        public static string ToResource(this CheckinStatus s, bool toLower = false)
        {
            string result = "";

            switch (s)
            {
            case CheckinStatus.CheckinPending:
                result = AppResource.ECheckinStatusCheckinPending;
                break;

            case CheckinStatus.Checkin:
                result = AppResource.ECheckinStatusCheckin;
                break;

            case CheckinStatus.RequestedCheckout:
                result = AppResource.ECheckinStatusRequestedCheckout;
                break;

            case CheckinStatus.Checkout:
                result = AppResource.ECheckinStatusCheckout;
                break;

            case CheckinStatus.RequestedCheckin:
                result = AppResource.ECheckinStatusRequestedCheckin;
                break;

            case CheckinStatus.Denied:
                result = AppResource.ECheckinStatusDenied;
                break;

            default:
                break;
            }

            if (toLower)
            {
                result = result.ToLower();
            }

            return(result);
        }
Esempio n. 8
0
 void IWorkspaceWindow.RefreshCheckinProgress(CheckinStatus checkinStatus)
 {
     mDeveloperProgressOperationHandler.RefreshCheckinProgress(checkinStatus);
 }
Esempio n. 9
0
 internal void RefreshCheckinProgress(
     CheckinStatus checkinStatus,
     BuildProgressSpeedAndRemainingTime.ProgressData progressData)
 {
     mCheckinProgress.Refresh(checkinStatus, progressData);
 }
Esempio n. 10
0
 public CheckinCreated(int checkinId, bool b, CheckinStatus status)
 {
     throw new NotImplementedException();
 }
Esempio n. 11
0
 internal void RefreshCheckinProgress(CheckinStatus checkinStatus)
 {
     mCheckinProgress.Refresh(checkinStatus);
 }
Esempio n. 12
0
 /// <summary>
 /// these kind of function will call when build up from list events to this Domain object
 /// check funtion LoadFromHistory in class AggregateRoot
 /// </summary>
 /// <param name="e"></param>
 void Apply(CheckinCompleted e)
 {
     Status = CheckinStatus.Completed;
 }