private void ConvertToTWork(TWorkViewModel vm, TWork entity, string ParentProjectId)
 {
     entity.WorkQty             = vm.WorkQty;
     entity.WorkPrice           = vm.WorkPrice;
     entity.WorkTotal           = vm.WorkQty * vm.WorkPrice;
     entity.WorkRealQty         = vm.WorkRealQty;
     entity.WorkRealPaid        = vm.WorkRealPaid;
     entity.JobId               = string.IsNullOrEmpty(vm.JobId) ? null : _jobTasks.One(vm.JobId);
     entity.ProjectId           = string.IsNullOrEmpty(ParentProjectId) ? null : _tasks.One(ParentProjectId);
     entity.WorkRetentionStatus = vm.WorkRetentionStatus;
 }
        public ActionResult TWorks_Create([DataSourceRequest] DataSourceRequest request, TWorkViewModel vm, string ParentProjectId)
        {
            if (vm != null && ModelState.IsValid)
            {
                TWork entity = new TWork();
                entity.SetAssignedIdTo(Guid.NewGuid().ToString());

                ConvertToTWork(vm, entity, ParentProjectId);

                entity.CreatedDate = DateTime.Now;
                entity.CreatedBy   = User.Identity.Name;
                entity.DataStatus  = "New";

                _workTasks.Insert(entity);
            }

            return(Json(new[] { vm }.ToDataSourceResult(request, ModelState)));
        }
Ejemplo n.º 3
0
 public IncompleteWorkItem(TWorkId id, TWork workItem)
 {
     this.WorkItem = workItem;
     this.Id       = id;
 }
 public IncompleteWorkItem(TWorkId id, TWork workItem)
 {
     WorkItem = workItem ?? throw new ArgumentNullException(nameof(workItem));
     Id       = id ?? throw new ArgumentNullException(nameof(id));
 }
Ejemplo n.º 5
0
        public static decimal GetLocationTotalGFA(OLocation loc)
        {
            decimal totalGFA = 0;
            if (loc.IsPhysicalLocation == 1)
            {
                if (loc.GrossFloorArea != null)
                    totalGFA = loc.GrossFloorArea.Value;
            }
            else
            {
                List<OLocation> locationList = TablesLogic.tLocation[TablesLogic.tLocation.ParentID == loc.ObjectID];
                foreach (OLocation location in locationList)
                    totalGFA += GetLocationTotalGFA(location);
            }
            return totalGFA;

            TWork w1 = new TWork();
            TWork w2 = new TWork();

            w1.Select(
                w1.ObjectID)
            .Where(
                w2.Select(w2.ObjectID.Count()).Where(w2.ParentID==w1.ObjectID) == 0
            );

        }