Esempio n. 1
0
        public UCRequestEntry(UserInformation userInfo)
        {
            this.userInfo = userInfo;
            InitializeComponent();
            ServiceCategoryJobPresenter serviceJobPresenter = new ServiceCategoryJobPresenter();

            serviceJobContainer = serviceJobPresenter.GetServiceJobTree();
            var treeNodes = LoadServiceTree(serviceJobContainer.ServiceCategoryDtos);

            treeServices.Nodes.AddRange(treeNodes.ToArray());
            txtRequester.Text = userInfo.FirstName + " " + userInfo.LastName;
            dtpDate.Value     = DateTime.Now;
            person            = myView.baseDataPresenter.getPersonel(userInfo.PerId);
            txtOwnername.Text = person.FullName;
            txtOwnername.Tag  = person;

            attachBs.DataSource  = attachBlist;
            igridAtch.DataSource = attachBs;

            if (userInfo.ActionId == (int)RequestAction.All || userInfo.ActionId == (int)RequestAction.IndChart)
            {
                btnSelectOwner.Enabled = true;
            }
            else
            {
                btnSelectOwner.Enabled = false;
            }
            grpDeviceList.Enabled = false;
            grpOwner.Enabled      = false;

            SetGrid();
        }
        public Common.DTOContainer.ServiceJobDtoContainer GetServiceCategoryJob(int serviceJobId, int serveceCatId)
        {
            ServiceJobDtoContainer container = new ServiceJobDtoContainer();
            var catJob = bs.GetSingle(it => it.Servicejobid == serviceJobId && it.Servicecategoryid == serveceCatId);

            container.ServiceCategoryJobs.Add(catJob);
            return(container);
        }
Esempio n. 3
0
        private void InitializeData()
        {
            ServiceCategoryJobPresenter serviceJobPresenter = new ServiceCategoryJobPresenter();

            serviceJobContainer = serviceJobPresenter.GetServiceJobTree();
            var treeNodes = LoadServiceTree(serviceJobContainer.ServiceCategoryDtos);

            treeServices.Nodes.AddRange(treeNodes.ToArray());
        }
        public ServiceJobDtoContainer GetCompleteServiceCategoryJob(int serviceCatJobId)
        {
            ServiceJobDtoContainer container = new ServiceJobDtoContainer();
            var catJob = bs.GetSingle(it => it.ServiceCatJobId == serviceCatJobId);
            ServiceJobTDataAccess      serviceJobDa = new ServiceJobTDataAccess();
            ServiceCategoryTDataAccess serviceCatDa = new ServiceCategoryTDataAccess();
            var serviceCat = serviceCatDa.GetSingle(it => it.ServiceCatId == catJob.Servicecategoryid);
            var serviceJob = serviceJobDa.GetSingle(it => it.ServiceJobId == catJob.Servicejobid);

            catJob.ServiceCategory = serviceCat;
            catJob.ServiceJob      = serviceJob;
            container.ServiceCategoryJobs.Add(catJob);
            return(container);
        }
Esempio n. 5
0
        public Common.DTOContainer.ServiceJobDtoContainer LoadServiceJobs(int serviceCategoryId, bool enabled)
        {
            ServiceJobDtoContainer container = new ServiceJobDtoContainer();

            if (serviceCategoryId > 0)
            {
                var lst = ((ServiceJobTDataAccess)this.dataAccess).Load(serviceCategoryId, enabled);
                container.ServiceJobs.AddRange(lst);
            }
            else
            {
                var lst = this.GetAll();
                container.ServiceJobs.AddRange(lst);
            }

            return(container);
        }
Esempio n. 6
0
        public Common.DTOContainer.ServiceJobDtoContainer GetServiceJobTree()
        {
            PersonelTDataAccess pers = new PersonelTDataAccess();

            ServiceJobDtoContainer        container            = new ServiceJobDtoContainer();
            ServiceCategoryTDataAccess    serviceCatDa         = new ServiceCategoryTDataAccess();
            ServiceCategoryJobTDataAccess serviceCategoryJobDa = new ServiceCategoryJobTDataAccess();


            var serviceCategoris = serviceCatDa.GetAll();
            var serviceCatJobs   = serviceCategoryJobDa.GetAll();
            var serviceJobs      = this.dataAccess.GetAll();

            container.ServiceCategoryDtos.AddRange(serviceCategoris);
            container.ServiceCategoryJobs.AddRange(serviceCatJobs);
            container.ServiceJobs.AddRange(serviceJobs);

            return(container);
        }
Esempio n. 7
0
        public Common.DTOContainer.ServiceJobDtoContainer LoadServiceCategoryJobsByJob(int serviceJobId)
        {
            ServiceCategoryTDataAccess serviceCatDa = new ServiceCategoryTDataAccess();
            ServiceJobDtoContainer     container    = new ServiceJobDtoContainer();
            var catList = serviceCatDa.GetAll();

            foreach (var item in catList)
            {
                var cat = this.GetSingle(it => it.Servicecategoryid == item.ServiceCatId && it.Servicejobid == serviceJobId);
                if (cat != null)
                {
                    cat.ServiceCategory = item;
                    container.ServiceCategoryJobs.Add(cat);
                }
                else
                {
                    container.ServiceCategoryDtos.Add(item);
                }
            }

            return(container);
        }
Esempio n. 8
0
        public Common.DTOContainer.ServiceJobDtoContainer LoadServiveCategoryJobs(int serviceCategoryId)
        {
            ServiceJobDtoContainer        container            = new ServiceJobDtoContainer();
            ServiceCategoryJobTDataAccess serviceCategoryJobDa = new ServiceCategoryJobTDataAccess();
            var serviceCatJobs = serviceCategoryJobDa.GetAll(it => it.Servicecategoryid == serviceCategoryId);
            var serviceJobs    = LoadServiceJobs(-1).ServiceJobs;

            foreach (var item in serviceJobs)
            {
                var serviceCat = serviceCatJobs.FirstOrDefault(it => it.Servicejobid == item.ServiceJobId);
                if (serviceCat != null)
                {
                    serviceCat.ServiceJob = item;
                    container.ServiceCategoryJobs.Add(serviceCat);
                }
                else
                {
                    container.ServiceJobs.Add(item);
                }
            }

            return(container);
        }