Пример #1
0
        public Task <bool> TaskAllocation(tbAllocation taskAllocation)
        {
            return(Task.Run(() =>
            {
                try
                {
                    if (tbAllocations.Where(rec => rec.ContractAddress == taskAllocation.ContractAddress).Select(s => s).SingleOrDefault() == null)
                    {
                        TaskAllocationInsert(taskAllocation);
                    }
                    else
                    {
                        TaskAllocationUpdate(taskAllocation);
                    }

                    SubmitChanges();

                    return true;
                }
                catch (Exception err)
                {
                    string logCode = string.Empty;
                    proc_EventLog(err.Message, (short)EventType.Error, ref logCode);
                    return false;
                }
            }));
        }
Пример #2
0
        private void TaskAllocationUpdate(tbAllocation newAllocation)
        {
            tbAllocation existingAllocation = tbAllocations.Where(m => m.ContractAddress == newAllocation.ContractAddress).Single();

            existingAllocation.TaskStatusCode  = newAllocation.TaskStatusCode;
            existingAllocation.UnitCharge      = newAllocation.UnitCharge;
            existingAllocation.TaxRate         = newAllocation.TaxRate;
            existingAllocation.ActionOn        = newAllocation.ActionOn;
            existingAllocation.QuantityOrdered = newAllocation.QuantityOrdered;
        }
Пример #3
0
 private void TaskAllocationInsert(tbAllocation taskAllocation)
 {
     tbAllocations.InsertOnSubmit(taskAllocation);
 }