Пример #1
0
 public async Task <List <PlanMaterial> > GetMaterialByPlan(Guid planId)
 {
     using (var planDao = new PlanDao())
     {
         return(await planDao.JoinPlanId(planId));
     }
 }
Пример #2
0
 public async Task EditPlan(Plan plan)
 {
     using (var planDao = new PlanDao())
     {
         await planDao.EditAsync(plan);
     }
 }
Пример #3
0
 public async Task CreatePlan(Plan plan)
 {
     using (var planDao = new PlanDao())
     {
         await planDao.CreateAsync(plan);
     }
 }
Пример #4
0
 /// <summary>
 /// 获取其他施工项目部,排除已选施工项目部
 /// </summary>
 /// <param name="departId"></param>
 /// <returns></returns>
 public async Task <List <SysDepart> > GetOtherSysDepart(Guid?departId)
 {
     using (var planDao = new PlanDao())
     {
         return(await planDao.GetOtherSysDepart(departId));
     }
 }
Пример #5
0
 public Task SubmitPlan(SysUser sysUser, int status)
 {
     using (var planDao = new PlanDao())
     {
         throw new NotImplementedException();
     }
 }
Пример #6
0
 /// <summary>
 /// 获取单位项目中,未添加的施工项目部
 /// </summary>
 /// <param name="projectId">项目编号</param>
 /// <returns></returns>
 public async Task <List <SysDepart> > GetNewSysDepart(Guid projectId)
 {
     using (var planDao = new PlanDao())
     {
         return(await planDao.GetNewSysDepart(projectId));
     }
 }
Пример #7
0
 public async Task <List <Plan> > GetAllByProjectId(Guid id)
 {
     using (var planDao = new PlanDao())
     {
         return(await planDao.GetAllAsync().Where(m => m.ProjectId == id).ToListAsync());
     }
 }
Пример #8
0
 public async Task RemovePlan(Guid id)
 {
     using (var planDao = new PlanDao())
     {
         await planDao.RemoveAsync(id);
     }
 }
Пример #9
0
 public List <PlanDto> GetAllPlan(int year, int month, Guid?sysDepartId, int pageSize, int pageIndex, bool asc)
 {
     using (var planDao = new PlanDao())
     {
         return(planDao.JoinProject(year, month, sysDepartId).Result
                .Select(m => new PlanDto()
         {
             Id = m.Id,
             NodeNumber = m.NodeNumber,
             NextNodeNumber = m.FlowNode.NextNodeNumber,
             PlanId = m.Plan.Id,
             ProjectId = m.Plan.ProjectId,
             ProjectName = m.Plan.Project.ProjectName,
             StatusName = m.StatusName,
             SysDepartId = m.Plan.SysDepartId,
             SysDepartName = m.Plan.SysDepart.DepartName,
             SysDepartOwnerId = m.Plan.Project.SysDepartId,
             SysDepartOwnerName = m.Plan.Project.SysDepart.DepartName,
             UpdateTime = m.UpdateTime,
             CreateTime = m.CreateTime
         })
                .OrderByDescending(m => m.CreateTime)
                .ThenBy(m => m.SysDepartId)
                .ToList());
     }
 }
Пример #10
0
        public void addNewPlan(PlanModel plan)
        {
            if (plan.component_id < 1)
            {
                throw new Exception("Please select component");
            }
            if (String.IsNullOrEmpty(plan.model_name) || String.IsNullOrWhiteSpace(plan.model_name))
            {
                throw new Exception("Plan model cannot leave empty");
            }
            if (plan.plan_data < 0)
            {
                throw new Exception("Plan data must greater than 0");
            }
            if (plan.plan_line < 0)
            {
                throw new Exception("Plan line must greater than 0");
            }
            decimal model_id = BomModelModelDAO.getInstance().getIdByName(plan.model_name);

            plan.model_id = model_id;
            if (PlanDao.getInstance().isExist(plan))
            {
                throw new Exception("Plan existed");
            }
            PlanDao.getInstance().add(plan);
        }
Пример #11
0
 public void deletePlan(PlanModel plan)
 {
     if (plan.plan_id < 1)
     {
         throw new Exception("Please select a plan first");
     }
     PlanDao.getInstance().delete(plan);
 }
Пример #12
0
 public List <Project> GetProject()
 {
     using (var planDao = new PlanDao())
     {
         return(planDao.GetAllAsync()
                .Where(m => m.UpdateTime.Year == DateTime.Now.Year && m.UpdateTime.Month == DateTime.Now.Month)
                .Select(m => new Project()
         {
             ProjectName = m.Project.ProjectName
         }).ToList());
     }
 }
Пример #13
0
        private void cargarPlanes()
        {
            PlanDao plan = new PlanDao();

            List <Plan> planesVigentes = plan.ListarPlanesMedicosVigentes();

            foreach (Plan pln in planesVigentes)
            {
                ComboboxItem item = new ComboboxItem();
                item.Text  = pln.Descripcion;
                item.Value = pln.Codigo;
                this.cboPlan.Items.Add(item);
            }
        }
Пример #14
0
        public ObtenerListadoPlanesResponse ObtenerListadoDePlanes()
        {
            var repo = new PlanDao();

            var response = new ObtenerListadoPlanesResponse();

            var planes = repo.ListarPlanesMedicosVigentes();

            if (planes != null)
            {
                foreach (var plan in planes)
                {
                    response.DescPlanes.Add(plan.Descripcion);
                }
            }

            return(response);
        }
Пример #15
0
 public List <PlanDto> GetAllPlan(Guid sysDepart, string departType)
 {
     using (var planDao = new PlanDao())
     {
         return(planDao.JoinDepart(sysDepart, departType).Select(m => new PlanDto()
         {
             Id = m.Id,
             ProjectId = m.ProjectId,
             ProjectName = m.Project.ProjectName,
             SysDepartOwnerName = m.Project.SysDepart.DepartName,
             SysDepartOwnerId = m.Project.SysDepartId,
             SysDepartId = m.SysDepartId,
             SysDepartName = m.SysDepart?.DepartName,
             CreateTime = m.CreateTime
         })
                .OrderByDescending(m => m.CreateTime)
                .ThenBy(m => m.SysDepartId)
                .ToList());
     }
 }
Пример #16
0
 public long CountPlan()
 {
     return(PlanDao.Count());
 }
Пример #17
0
 public Plan GetPlan(Expression <Func <Plan, bool> > criteria)
 {
     return(PlanDao.Get(criteria));
 }
Пример #18
0
 public Plan GetPlan(int id)
 {
     return(PlanDao.Get(id));
 }
Пример #19
0
 public List <Plan> GetAllPlan(string conditions, string orders)
 {
     return(PlanDao.GetAll(conditions, orders));
 }
Пример #20
0
 public List <Plan> GetAllPlan(string orders)
 {
     return(PlanDao.GetAll(orders));
 }
Пример #21
0
 public List <Plan> GetAllPlan(Expression <Func <Plan, bool> > criteria)
 {
     return(PlanDao.GetAll(criteria));
 }
Пример #22
0
 public List <Plan> GetAllPlan()
 {
     return(PlanDao.GetAll());
 }
Пример #23
0
 public void DeletePlan(int id)
 {
     PlanDao.Delete(id);
 }
Пример #24
0
 public void UpdatePlan(Plan entity)
 {
     PlanDao.Update(entity);
 }
Пример #25
0
 public int SavePlan(Plan entity)
 {
     return(PlanDao.Save(entity));
 }
Пример #26
0
 public long CountPlan(Expression <Func <Plan, bool> > criteria)
 {
     return(PlanDao.Count(criteria));
 }
Пример #27
0
 public PlanService()
 {
     oPlanDao = new PlanDao();
 }
Пример #28
0
        public string GetDescripcionByCodigoPlan(int codigoPlan)
        {
            var repo = new PlanDao();

            return(repo.GetDescripcionByCodigoPlan(codigoPlan));
        }
Пример #29
0
        public int GetCodigoPlanByDescripcion(string descripcion)
        {
            var repo = new PlanDao();

            return(repo.GetCodigoPlanByDescripcion(descripcion));
        }