Exemplo n.º 1
0
        private void cargaInf(int idPros)
        {
            DataTable    resultTable = new DataTable();
            ListViewItem viewItem;

            Models.Documentos docs;
            string            nombre, ap1, ap2, calle, colonia, noCasa, rfc, obs;
            int   numDoc = 1, idDoc, idEstatus;
            Int64 tel, codPost;

            streamDataList = new List <Models.Documentos>();
            conn.LLenaDateTable(ref resultTable, "Exec proc_listaProspectos 2," + idPros);

            nombre            = resultTable.Rows[0]["desc_nombre"].ToString();
            ap1               = resultTable.Rows[0]["desc_apellido1"].ToString();
            ap2               = resultTable.Rows[0]["desc_apellido2"].ToString();
            nombreInf.Text    = nombre + " " + ap1 + " " + ap2;
            calle             = resultTable.Rows[0]["desc_calle"].ToString();
            noCasa            = resultTable.Rows[0]["desc_numero"].ToString();
            colonia           = resultTable.Rows[0]["desc_colonia"].ToString();
            direccionInf.Text = "Calle. " + calle + ". #" + noCasa + " Col." + colonia;
            tel               = Int64.Parse(resultTable.Rows[0]["num_telefono"].ToString());
            telInf.Text       = tel.ToString();
            codPost           = Int64.Parse(resultTable.Rows[0]["num_codPost"].ToString());
            cPInf.Text        = codPost.ToString();
            rfcInf.Text       = rfc = resultTable.Rows[0]["desc_rfc"].ToString();
            obsInf.Text       = obs = resultTable.Rows[0]["desc_observ"].ToString();
            idDoc             = int.Parse(resultTable.Rows[0]["num_documentoProc"].ToString());
            idEstatus         = int.Parse(resultTable.Rows[0]["num_estatus"].ToString());

            foreach (Models.Estatus item in stats.EstatusList)
            {
                if (item.Id_estatus.Equals(idEstatus))
                {
                    estatusInf.Text = item.Desc_estatus;
                    break;
                }
            }
            resultTable.Reset();
            conn.LLenaDateTable(ref resultTable, "Exec proc_listaProspectos 3," + idPros);

            foreach (DataRow dr in resultTable.Rows)
            {
                docs = new Models.Documentos(dr["desc_nombreDoc"].ToString(),
                                             dr["desc_rutaDoc"].ToString(),
                                             (byte[])dr["bin_documento"]);
                streamDataList.Add(docs);

                viewItem = new ListViewItem(numDoc.ToString());
                viewItem.SubItems.Add(dr["desc_nombreDoc"].ToString());
                listView3.Items.Add(viewItem);
                numDoc++;
            }
            dataObjec            = new Models.Prospecto(nombre, ap1, ap2, calle, noCasa, colonia, codPost, tel, rfc, streamDataList);
            dataObjec.Obsrv      = obs;
            dataObjec.NumDocs    = idDoc;
            dataObjec.NumEstatus = idEstatus;
        }
Exemplo n.º 2
0
        public void tabListadoInit()
        {
            listView2.Items.Clear();
            stats     = null;
            dataObjec = null;
            List <Models.Estatus> statsList = new List <Models.Estatus>();
            DataTable             result    = new DataTable();

            conn.LLenaDateTable(ref result, "Exec proc_actEstatus 3,0,0,0");
            foreach (DataRow dr in result.Rows)
            {
                stats = new Models.Estatus(int.Parse(dr["id_estatus"].ToString()), dr["desc_estatus"].ToString());
                statsList.Add(stats);
            }
            stats.EstatusList = statsList;
            llenaListView2();
        }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool      okValidation = true;
            DataTable resultTable  = new DataTable();
            int       resultInt;
            string    query = "";

            earseErrors();
            foreach (Control controlText in tabPage1.Controls)
            {
                if (controlText is TextBox)
                {
                    okValidation &= ValidatingEmptyFields(controlText);
                }
            }
            okValidation &= emptyDocuments();

            if (okValidation)
            {
                resultInt = conn.ExecuteScalarInt("Exec proc_obtenDataDocs 1") + 1;
                conn.LLenaDateTable(ref resultTable, "Exec proc_obtenDataDocs 2");
                dataObjec = new Models.Prospecto(nombre.Text, apellido1.Text, apellido2.Text, calle.Text, numeroCasa.Text, colonia.Text, Int64.Parse(cP.Text), Int64.Parse(telefono.Text), rfc.Text, streamDataList);
                listToTable(ref resultTable, dataObjec.DocsList, resultInt);
                conn.BulkCopy(resultTable, "Documentos");
                query = "Exec proc_capturaProspecto '" +
                        dataObjec.NombrePros + "', '" +
                        dataObjec.PrimerApe + "', '" +
                        dataObjec.SegundoApe + "', '" +
                        dataObjec.CallePros + "', '" +
                        dataObjec.NumeroCasa + "', '" +
                        dataObjec.Colonia + "', " +
                        dataObjec.CodePost + ", '" +
                        dataObjec.TelPros + "', '" +
                        dataObjec.rfc1 + "', " +
                        resultInt + ", " + 1 + "";
                conn.Execute(query);

                MessageBox.Show("La captura a sido exitosa.",
                                "Exitoso",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);

                dataObjec.clearProspecto();
            }
        }