コード例 #1
0
ファイル: WorkerRequestsClass.cs プロジェクト: gradusina/FA2
        public long AddWorkerRequest(RequestType requestType, long workerId, DateTime requestDate,
                                     DateTime requestFinishDate,
                                     SalarySaveType salarySaveType, InitiativeType initiativeType, IntervalType intervalType,
                                     WorkingOffType workingOffType,
                                     DateTime creationDate, long requestCreatedWorkerId, string requestNotes, long mainWorkerId)
        {
            var newRequestRow = WorkerRequestsTable.NewRow();

            newRequestRow["RequestTypeID"]          = (int)requestType;
            newRequestRow["WorkerID"]               = workerId;
            newRequestRow["RequestDate"]            = requestDate;
            newRequestRow["RequestFinishDate"]      = requestFinishDate;
            newRequestRow["SalarySaveTypeID"]       = (int)salarySaveType;
            newRequestRow["InitiativeTypeID"]       = (int)initiativeType;
            newRequestRow["IntervalTypeID"]         = (int)intervalType;
            newRequestRow["WorkingOffTypeID"]       = (int)workingOffType;
            newRequestRow["CreationDate"]           = creationDate;
            newRequestRow["RequestCreatedWorkerID"] = requestCreatedWorkerId;
            newRequestRow["RequestNotes"]           = requestNotes;
            newRequestRow["MainWorkerID"]           = mainWorkerId;

            WorkerRequestsTable.Rows.Add(newRequestRow);
            UpdateWorkerRequests();

            var workerRequestId = GetWorkerRequestId(workerId, creationDate);

            newRequestRow["WorkerRequestID"] = workerRequestId.HasValue
                ? workerRequestId.Value
                : 0;
            newRequestRow.AcceptChanges();

            if (workerRequestId.HasValue)
            {
                // Create global id
                var globalId = string.Format("0{0}{1:00000}",
                                             (int)TaskClass.SenderApplications.WorkerRequests, workerRequestId.Value);
                newRequestRow["GlobalID"] = globalId;
                UpdateWorkerRequests();
            }

            return(workerRequestId.Value);
        }
コード例 #2
0
ファイル: CombatManager.cs プロジェクト: lionsguard/perenthia
        /// <summary>
        /// Determines and sets the initiative of each of the specified avatars.
        /// </summary>
        /// <param name="initiativeType">The InitiativeType for this session of combat.</param>
        /// <param name="participants">The list of avatars participating in combat.</param>
        public static void DetermineInitiative(InitiativeType initiativeType, params IAvatar[] participants)
        {
            if (participants != null && participants.Length > 0)
            {
                for (int i = 0; i < participants.Length; i++)
                {
                    switch (initiativeType)
                    {
                    case InitiativeType.Individual:
                    case InitiativeType.Cyclic:
                        participants[i].Initiative = Dice.Roll(1, 10);
                        break;

                    default:
                        participants[i].Initiative = i;
                        break;
                    }
                }
            }
        }
コード例 #3
0
 public int DeleteInitiativeType(InitiativeType initiativeType)
 {
     return(_initiativeTypeRepo.DeleteInitiativeType(initiativeType));
 }
コード例 #4
0
 public int CreateInitiativeType(InitiativeType initiativeType)
 {
     return(_initiativeTypeRepo.CreateInitiativeType(initiativeType));
 }
コード例 #5
0
 public int UpdateInitiativeType(InitiativeType initiativeType)
 {
     return(_initiativeTypeRepo.UpdateInitiativeType(initiativeType));
 }
コード例 #6
0
 /// <summary>
 /// Inserts the type of the or update initiative.
 /// </summary>
 /// <param name="initiativeType">Type of the initiative.</param>
 /// <returns></returns>
 public int InsertOrUpdateInitiativeType(InitiativeType initiativeType)
 {
     return(InsertOrUpdate(initiativeType));
 }
コード例 #7
0
 /// <summary>
 /// Deletes the type of the initiative.
 /// </summary>
 /// <param name="initiativeType">Type of the initiative.</param>
 /// <returns></returns>
 public int DeleteInitiativeType(InitiativeType initiativeType)
 {
     return(DeleteRecord(initiativeType));
 }