Ejemplo n.º 1
0
        //  private Person person;
        // private Person[] persons;
        public OcorrView(ServerServiceClient serverClient)
        {
            InitializeComponent();
            this.serverClient = serverClient;
            SampleGenericDelegate2<CrimeType[]> del = new SampleGenericDelegate2<CrimeType[]>(serverClient.GetAllCrimeType);

            IAsyncResult result = del.BeginInvoke(null, null);

            crimes = del.EndInvoke(result);
            foreach (CrimeType c in crimes)
            {
                comboBox1.Items.Add(c.Name);
            }

            /*
              comboBox1.SelectedIndex = 0;

            if (regist == null)
            {
               // this.regist = new Regist();
                this.person = person;
                Editable();
            }
            else
            {
                NonEditable();
               // this.person = person;
                this.regist = regist;
                date_time_text.Text = regist.Date.ToShortDateString();
                id_text.Text = regist.Id.ToString();
                Description.Text = regist.Description;
            }
            */
        }
Ejemplo n.º 2
0
        public void AddDocument(Document d)
        {
            if (d == null)
            {
                return;
            }
            try
            {
                SampleGenericDelegate2 <DocumentType[]> del = new SampleGenericDelegate2 <DocumentType[]>(serverClient.GetAllDocumentType);

                IAsyncResult result = del.BeginInvoke(null, null);


                DocumentType[] list = del.EndInvoke(result);


                d.Type.Name = list.First(doc => doc.Id == d.Type.Id).Name;
            }
            catch (Exception e)
            {
                var info = new InfoForm();
                info.Add(e.Message);
                info.ShowDialog(this);
                info.Dispose();
            }
            int row =
                dataGridView1.Rows.Add(new object[]
            {
                d.id, d.code, d.emission_date.ToShortDateString(), d.expiration_date.ToShortDateString(), d.Type.Name,
                d.emission_local
            });
        }
Ejemplo n.º 3
0
        public void AddDocument(Document d)
        {
            if (d == null) return;
            try
            {

                SampleGenericDelegate2<DocumentType[]> del = new SampleGenericDelegate2<DocumentType[]>(serverClient.GetAllDocumentType);

                IAsyncResult result = del.BeginInvoke(null, null);

                DocumentType[] list = del.EndInvoke(result);

                d.Type.Name = list.First(doc => doc.Id == d.Type.Id).Name;
            }
            catch (Exception e)
            {
                var info = new InfoForm();
                info.Add(e.Message);
                info.ShowDialog(this);
                info.Dispose();
            }
            int row =
                dataGridView1.Rows.Add(new object[]
                {
                    d.id, d.code, d.emission_date.ToShortDateString(), d.expiration_date.ToShortDateString(), d.Type.Name,
                    d.emission_local
                });
        }
Ejemplo n.º 4
0
        //  private Person person;
        // private Person[] persons;

        public OcorrView(ServerServiceClient serverClient)
        {
            InitializeComponent();
            this.serverClient = serverClient;
            SampleGenericDelegate2 <CrimeType[]> del = new SampleGenericDelegate2 <CrimeType[]>(serverClient.GetAllCrimeType);

            IAsyncResult result = del.BeginInvoke(null, null);

            crimes = del.EndInvoke(result);
            foreach (CrimeType c in crimes)
            {
                comboBox1.Items.Add(c.Name);
            }

            /*
             * comboBox1.SelectedIndex = 0;
             *
             * if (regist == null)
             * {
             * // this.regist = new Regist();
             *  this.person = person;
             *  Editable();
             * }
             * else
             * {
             *  NonEditable();
             * // this.person = person;
             *  this.regist = regist;
             *  date_time_text.Text = regist.Date.ToShortDateString();
             *  id_text.Text = regist.Id.ToString();
             *  Description.Text = regist.Description;
             * }
             */
        }
Ejemplo n.º 5
0
        public DocumentEditor(ServerServiceClient serverClient, Person person)
        {
            InitializeComponent();
            this.person       = person;
            this.serverClient = serverClient;
            if (documents == null)
            {
                SampleGenericDelegate2 <DocumentType[]> del = new SampleGenericDelegate2 <DocumentType[]>(serverClient.GetAllDocumentType);

                IAsyncResult result = del.BeginInvoke(null, null);

                documents = del.EndInvoke(result);
            }
            Editable();
        }
Ejemplo n.º 6
0
        public DocumentEditor(ServerServiceClient serverClient, Person person)
        {
            InitializeComponent();
            this.person = person;
            this.serverClient = serverClient;
            if (documents == null)
            {
                SampleGenericDelegate2<DocumentType[]> del = new SampleGenericDelegate2<DocumentType[]>(serverClient.GetAllDocumentType);

                IAsyncResult result = del.BeginInvoke( null, null);

                documents = del.EndInvoke(result);
            }
            Editable();
        }
Ejemplo n.º 7
0
        public RegistoCriminal(ServerServiceClient serverClient)
        {
            InitializeComponent();
            this.serverClient = serverClient;
             try
            {
                SampleGenericDelegate2<Regist[]> del = new SampleGenericDelegate2<Regist[]>(serverClient.GetAllRegists);

                IAsyncResult result = del.BeginInvoke(null, null);

                registos = del.EndInvoke(result);
                 if(registos!=null)
                     SetRegists();

            }
            catch (Exception e)
            {
                var info = new InfoForm();
                info.Add(e.Message);
                info.ShowDialog(this);
                info.Dispose();
            }
        }
Ejemplo n.º 8
0
        public RegistoCriminal(ServerServiceClient serverClient)
        {
            InitializeComponent();
            this.serverClient = serverClient;
            try
            {
                SampleGenericDelegate2 <Regist[]> del = new SampleGenericDelegate2 <Regist[]>(serverClient.GetAllRegists);

                IAsyncResult result = del.BeginInvoke(null, null);

                registos = del.EndInvoke(result);
                if (registos != null)
                {
                    SetRegists();
                }
            }
            catch (Exception e)
            {
                var info = new InfoForm();
                info.Add(e.Message);
                info.ShowDialog(this);
                info.Dispose();
            }
        }