예제 #1
0
        public WipTaskDelete(int wipTaskID, int deletor)
        {
            _dbml = new ProjectModelDbEntities();
            _task = _dbml.Sales_Wip.SingleOrDefault(x => x.WipTaskID == wipTaskID);

            CheckIsDeletable(deletor);
        }
예제 #2
0
        public void UpdateTaskes()
        {
            List <tblWipTask> taskes         = _dbml.tblWipTasks.Where(x => x.IsPublic).ToList();
            List <Sales_Wip>  internalTaskes = _dbml.Sales_Wip.Where(x => x.JobID == _jobID).ToList();

            foreach (tblWipTask task in taskes)
            {
                int             contentID    = task.ContentID;
                Sales_Wip       internalTask = GetInternalTask(internalTaskes, contentID);
                Sales_WipPublic newTask;
                if (internalTask == null)
                {
                    newTask = GetNewTask(task);
                }
                else
                {
                    newTask = GetNewTask(internalTask);
                }
                _dbml.Sales_WipPublic.Add(newTask);
            }
            _dbml.SaveChanges();
        }
예제 #3
0
        private Sales_WipPublic GetNewTask(Sales_Wip internalTask)
        {
            var newTask = new Sales_WipPublic
            {
                JobID              = _jobID,
                estRevID           = 0,
                quoteRevID         = 0,
                woID               = 0,
                invoiceID          = 0,
                Priority           = 0,
                ContentID          = internalTask.ContentID,
                Contents           = GetContentName(internalTask.ContentID),
                Status             = 0,
                ScheduleStartDate  = internalTask.ScheduleStartDate,
                ScheduleFinishDate = internalTask.ScheduleFinishDate,
                Responsible        = internalTask.Responsible,
                CreatedBy          = _employeeID,
                LastUpdatedAt      = DateTime.Now,
                LastUpdatedBy      = _employeeID
            };

            return(newTask);
        }
예제 #4
0
 public WipTaskSelect(int wipTaskID)
 {
     _dbml = new ProjectModelDbEntities();
     _task = _dbml.Sales_Wip.Find(wipTaskID);
 }
예제 #5
0
 public WipTaskCreateNew(Sales_Wip task)
 {
     _task = task;
     _dbml = new ProjectModelDbEntities();
 }