Example #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Models.Documentos doc;
            int index = 0;

            if (streamDataList == null)
            {
                streamDataList = new List <Models.Documentos>();
            }

            index = streamDataList.Count;

            if (nombreDocText.Text == "")
            {
                errorProvider.SetError(nombreDocText, "Debe insertar un nombre antes de agregar un documento.");
            }
            else
            {
                ListViewItem lvi;
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
                    doc = new Models.Documentos(nombreDocText.Text, openFileDialog1.FileName, uploadData());
                    streamDataList.Add(doc);
                    lvi = new ListViewItem(streamDataList[index].NombreDoc.ToString());
                    lvi.SubItems.Add(streamDataList[index].ArchivoDoc.ToString());
                    listView1.Items.Add(lvi);
                }
            }
            nombreDocText.ResetText();
        }
Example #2
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;
        }