Пример #1
0
        public void DeleteWorkerRequest(long workerRequestId)
        {
            var rows = WorkerRequestsTable.Select(string.Format("WorkerRequestID = {0}", workerRequestId));

            if (!rows.Any())
            {
                return;
            }

            var workerRequestRow = rows.First();

            workerRequestRow.Delete();

            UpdateWorkerRequests();
        }
Пример #2
0
        public void SetConfirmationInfo(long workerRequestId, string mainWorkerNotes, bool isConfirmed,
                                        DateTime confirmationDate)
        {
            var rows = WorkerRequestsTable.Select(string.Format("WorkerRequestID = {0}", workerRequestId));

            if (!rows.Any())
            {
                return;
            }

            var workerRequestRow = rows.First();

            workerRequestRow["MainWorkerNotes"]  = mainWorkerNotes;
            workerRequestRow["IsConfirmed"]      = isConfirmed;
            workerRequestRow["ConfirmationDate"] = confirmationDate;

            UpdateWorkerRequests();
        }
Пример #3
0
        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);
        }