Ejemplo 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();
        }
Ejemplo n.º 2
0
        public UCSelectServiceCategoryJob()
        {
            InitializeComponent();
            ServiceCategoryJobPresenter serviceJobPresenter = new ServiceCategoryJobPresenter();
            var serviceJobContainer = serviceJobPresenter.GetServiceJobTree();
            var treeNodes           = LoadServiceTree(serviceJobContainer.ServiceCategoryDtos);

            treeServices.Nodes.AddRange(treeNodes.ToArray());
        }
Ejemplo n.º 3
0
        private void InitializeData()
        {
            ServiceCategoryJobPresenter serviceJobPresenter = new ServiceCategoryJobPresenter();

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

            treeServices.Nodes.AddRange(treeNodes.ToArray());
        }
Ejemplo n.º 4
0
        private void AddRoleSJob()
        {
            var selected = (SdServiceCategoryDto)treeServices.SelectedNode.Tag;
            var job      = (SdServiceJobDto)lstJobs.SelectedItem;

            if (selected != null && job != null)
            {
                ServiceCategoryJobPresenter cjPresenter = new ServiceCategoryJobPresenter();
                var serviceCatJob = cjPresenter.GetServiceCategoryJob(job.ServiceJobId, selected.ServiceCatId);
                if (serviceCatJob != null)
                {
                    UCChangeRole frm = new UCChangeRole(serviceCatJob);
                    ISE.UILibrary.Utils.UIUtils.SetFrmTrans(frm, "گروه کاری مرتبط", FormBorderStyle.FixedDialog);
                }
            }
        }
Ejemplo n.º 5
0
        private void LoadServiceCategoryJob()
        {
            if (request != null)
            {
                ServiceCategoryJobPresenter serviceCatJobPresenter = new ServiceCategoryJobPresenter();

                var serviceCatJob = serviceCatJobPresenter.GetCompleteServiceCategoryJob(request.Servicecategoryjobid.Value);

                if (serviceCatJob != null)
                {
                    txtUserRequest.Text = serviceCatJob.GetFullName();
                    txtUserRequest.Tag  = serviceCatJob;
                }
                if (request.Finalservicecategoryjobid.HasValue)
                {
                    var finalServiceCatJob = serviceCatJobPresenter.GetCompleteServiceCategoryJob(request.Finalservicecategoryjobid.Value);
                    if (finalServiceCatJob != null)
                    {
                        txtFinalRequest.Text = finalServiceCatJob.GetFullName();
                        txtFinalRequest.Tag  = finalServiceCatJob;
                    }
                }
            }
        }
Ejemplo n.º 6
0
        private void SetUI(SdUserRequestDto _userRequest)
        {
            ServiceCategoryJobPresenter serviceCatJobPresenter = new ServiceCategoryJobPresenter();
            BaseDataServicePresenter    baseDataPresenter      = new BaseDataServicePresenter();

            if (userRequest != null)
            {
                numUpDownPriority.Value = userRequest.Priority ?? 0;
                var serviceCatJob = serviceCatJobPresenter.GetCompleteServiceCategoryJob(userRequest.Servicecategoryjobid.Value);
                if (serviceCatJob != null)
                {
                    txtUserRequest.Text = serviceCatJob.GetFullName();
                    txtUserRequest.Tag  = serviceCatJob;
                }
                if (userRequest.Finalservicecategoryjobid.HasValue)
                {
                    var finalserviceCatJob = serviceCatJobPresenter.GetCompleteServiceCategoryJob(userRequest.Finalservicecategoryjobid.Value);
                    if (finalserviceCatJob != null)
                    {
                        txtFinalRequest.Text = finalserviceCatJob.GetFullName();
                        txtFinalRequest.Tag  = finalserviceCatJob;
                    }
                }
                if (userRequest.Createuserid.HasValue)
                {
                    var creatorUser = baseDataPresenter.getPersonel(userRequest.Createuserid.Value);
                    txtRequester.Text = creatorUser.FullName;
                }
                if (userRequest.Owneruserid.HasValue)
                {
                    var ownerUser = baseDataPresenter.getPersonel(userRequest.Owneruserid.Value);
                    txtOwnername.Text = ownerUser.FullName;
                }
                if (serviceCatJob.HasAttachments)
                {
                    var attachments = requestPresenter.GetRequestAttachments(userRequest.SerReqId);

                    attachBs.DataSource  = attachBlist;
                    igridAtch.DataSource = attachBs;
                    foreach (var item in attachments)
                    {
                        attachBs.Add(item);
                    }
                }
                person = myView.baseDataPresenter.getPersonel(userRequest.Owneruserid ?? 0);
                if (serviceCatJob.ServiceCategory.HasDevices)
                {
                    var device = baseDataPresenter.GetDevice(userRequest.Transferid ?? 0);

                    if (device != null)
                    {
                        PersonDevice pd = new PersonDevice(device, person);
                        igridDeviceList.DataSource = new List <PersonDevice>()
                        {
                            pd
                        };
                    }
                }
                else
                {
                    grpDeviceList.Visible = false;
                }
                txtDescription.Text = userRequest.Description;
                if (userRequest.Creditdate.HasValue)
                {
                    dtpCreditDate.Value = userRequest.Creditdate.Value;
                }


                txtContact.Text = userRequest.Callnumber;
            }
        }
Ejemplo n.º 7
0
        public UCRequestEntry(TransMode tMode, SdUserRequestDto request, UserInformation userInfo)
        {
            this.userInfo = userInfo;
            InitializeComponent();
            this.userRequest = request;
            this.tMode       = tMode;
            this.userInfo    = userInfo;
            if (tMode == TransMode.ViewRecord || tMode == TransMode.EditRecord)
            {
                UserRequestPresenter        requestPresenter       = new UserRequestPresenter();
                BaseDataServicePresenter    baseDataPresenter      = new BaseDataServicePresenter();
                ServiceCategoryJobPresenter serviceCatJobPresenter = new ServiceCategoryJobPresenter();


                var creatorPers = baseDataPresenter.getPersonel(request.Createuserid.Value);
                txtRequester.Text = creatorPers.FullName;
                if (userRequest.Owneruserid.HasValue)
                {
                    var ownerUser = baseDataPresenter.getPersonel(request.Owneruserid.Value);
                    txtOwnername.Text = ownerUser.FullName;
                }


                if (request.Createdate != null)
                {
                    dtpDate.Value = request.Createdate.Value;
                }
                var serviceCatJob = serviceCatJobPresenter.GetCompleteServiceCategoryJob(request.Servicecategoryjobid.Value);

                lstJobs.DataSource = new List <string>()
                {
                    serviceCatJob.ServiceJob.Title
                };

                treeServices.Nodes.Add(serviceCatJob.ServiceCategory.Title);



                txtDescription.Text = userRequest.Description;
                if (userRequest.Creditdate.HasValue)
                {
                    dtpCreditDate.Value = userRequest.Creditdate.Value;
                }



                if (serviceCatJob.ServiceCategory.HasMenus)
                {
                }

                txtContact.Text = userRequest.Callnumber;

                if (serviceCatJob.HasAttachments)
                {
                    var attachments = requestPresenter.GetRequestAttachments(userRequest.SerReqId);

                    attachBs.DataSource  = attachBlist;
                    igridAtch.DataSource = attachBs;
                    foreach (var item in attachments)
                    {
                        attachBs.Add(item);
                    }
                }
                person = myView.baseDataPresenter.getPersonel(userRequest.Owneruserid ?? 0);
                if (serviceCatJob.ServiceCategory.HasDevices)
                {
                    var device = baseDataPresenter.GetDevice(userRequest.Transferid ?? 0);

                    if (device != null)
                    {
                        PersonDevice pd = new PersonDevice(device, person);
                        igridDeviceList.DataSource = new List <PersonDevice>()
                        {
                            pd
                        };
                    }
                }

                btnCreateRequest.Visible = false;
                txtContact.ReadOnly      = true;
                txtDescription.ReadOnly  = true;
                txtMenu.ReadOnly         = true;
                txtRequester.ReadOnly    = true;
                btnMInAtc.Enabled        = false;
                btnSelectAttch.Enabled   = false;
                btnSelectMenu.Enabled    = false;
                if (tMode == TransMode.ViewRecord)
                {
                    btnSelectOwner.Enabled = false;
                }
                igridDeviceList.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
                LoadAttachment(request.SerReqId);
                igridAtch.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
            }
            SetGrid();
        }
Ejemplo n.º 8
0
        public UCRequestEntry(TransMode tMode, ISE.Cartable.DE.CartableDataSet.MY_CARTABLE_FOR_SERVICE_DESKRow row, UserInformation userInfo)
        {
            this.userInfo = userInfo;
            InitializeComponent();
            servieDeskRow = row;
            this.tMode    = tMode;
            this.userInfo = userInfo;
            if (tMode == TransMode.ViewRecord || tMode == TransMode.EditRecord)
            {
                UserRequestPresenter        requestPresenter       = new UserRequestPresenter();
                BaseDataServicePresenter    baseDataPresenter      = new BaseDataServicePresenter();
                ServiceCategoryJobPresenter serviceCatJobPresenter = new ServiceCategoryJobPresenter();


                treeServices.Visible = false;
                lstJobs.Visible      = false;
                txtRequester.Text    = row.PERSONELNAME;


                if (row.IsCREATEDATENull() == false)
                {
                    dtpDate.Value = row.CREATEDATE;
                }


                lstJobs.DataSource = new List <string>()
                {
                    row.SERVICEJOB
                };

                treeServices.Nodes.Add(row.SERVICECATEGORY);

                userRequest = requestPresenter.GetRequest(row.SER_REQ_ID);
                if (userRequest.Owneruserid.HasValue)
                {
                    var ownerUser = baseDataPresenter.getPersonel(userRequest.Owneruserid.Value);
                    txtOwnername.Text = ownerUser.FullName;
                }
                txtDescription.Text = userRequest.Description;
                if (userRequest.Creditdate.HasValue)
                {
                    dtpCreditDate.Value = userRequest.Creditdate.Value;
                }

                var serviceCatJob = serviceCatJobPresenter.GetCompleteServiceCategoryJob(userRequest.Servicecategoryjobid.Value);

                if (serviceCatJob.ServiceCategory.HasMenus)
                {
                }

                txtContact.Text = userRequest.Callnumber;

                if (serviceCatJob.HasAttachments)
                {
                    var attachments = requestPresenter.GetRequestAttachments(userRequest.SerReqId);

                    attachBs.DataSource  = attachBlist;
                    igridAtch.DataSource = attachBs;
                    foreach (var item in attachments)
                    {
                        attachBs.Add(item);
                    }
                }
                person = myView.baseDataPresenter.getPersonel(userRequest.Owneruserid ?? 0);
                if (serviceCatJob.ServiceCategory.HasDevices)
                {
                    var device = baseDataPresenter.GetDevice(userRequest.Transferid ?? 0);

                    if (device != null)
                    {
                        PersonDevice pd = new PersonDevice(device, person);
                        igridDeviceList.DataSource = new List <PersonDevice>()
                        {
                            pd
                        };
                    }
                }
                if (userRequest.Owneruserid != userRequest.Createuserid)
                {
                    txtOwnername.Text = person.FullName;
                }
                btnCreateRequest.Visible  = false;
                txtContact.ReadOnly       = true;
                txtDescription.ReadOnly   = true;
                txtMenu.ReadOnly          = true;
                txtRequester.ReadOnly     = true;
                btnMInAtc.Enabled         = false;
                btnSelectAttch.Enabled    = false;
                btnSelectMenu.Enabled     = false;
                btnSelectOwner.Enabled    = false;
                btnViewWorks.Visible      = true;
                igridDeviceList.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
                LoadAttachment(row.SER_REQ_ID);
                igridAtch.AllowEdit = Janus.Windows.GridEX.InheritableBoolean.False;
            }
            SetGrid();
        }