Esempio n. 1
0
        public void exportexceldtl()
        {
            try
            {
                string record = this.Request["record"];

                Hashtable         ht      = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                List <ColumnInfo> records = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["params"].ToString());
                List <ColumnInfo> headers = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["headers"].ToString());

                prprirstBll bll = new prprirstBll();

                int           total = 0;
                List <object> obj   = bll.GetSelectedRecords <object>(records, false, 0, 0, ref total);


                if ((obj != null) && (total > 0))
                {
                    List <object> finalObj = obj.Cast <object>().ToList();
                    UtilExcel.ExportToExcel(finalObj[0].GetType(), Response, this.GetType().Name.GetPageName(), headers, finalObj);
                }
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Esempio n. 2
0
        public void exportExcel()
        {
            try
            {
                table_name = this.Request["tableName"];
                string record = this.Request["record"];
                string header = this.Request["header"];

                List <ColumnInfo> headers = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(header);

                List <object>     dataList   = null;
                List <ColumnInfo> parameters = new List <ColumnInfo>();

                MasterDataBll bll = new MasterDataBll();

                if (record != null)
                {
                    parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(record);
                }

                dataList = bll.GetSelectedRecords(table_name, parameters);

                if (dataList != null)
                {
                    UtilExcel.ExportToExcel(bll.GetDynamicType(table_name), Response, table_name, headers, dataList);
                }
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Esempio n. 3
0
        public virtual void getExportExcel <T, P>() where T : class where P : class
        {
            try
            {
                string record = this.Request["record"];

                Hashtable         ht      = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                List <ColumnInfo> records = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["params"].ToString());
                List <ColumnInfo> headers = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["headers"].ToString());

                T       bll     = (T)typeof(T).GetConstructor(new Type[] { }).Invoke(new object[] { });
                BaseBll baseBll = bll as BaseBll;

                int      total = 0;
                List <P> obj   = baseBll.GetSelectedRecords <P>(records, false, 0, 0, ref total);


                if ((obj != null) && (total > 0))
                {
                    List <object> finalObj = BuildAnonymousObject(obj).Cast <object>().ToList();
                    UtilExcel.ExportToExcel(finalObj[0].GetType(), Response, this.GetType().Name.GetPageName(), headers, finalObj);
                }
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Esempio n. 4
0
        public void GenerarExcel()
        {
            Cartera      cartera  = FactoryCartera.GetCartera();
            string       pathFile = @"c:\tmp\cartera.xlsx";
            ExcelPackage pck      = UtilExcel.CrearExcelPackage(pathFile);

            cartera.ToExcel(pck);
            UtilExcel.OpenMicrosoftExcel(pathFile);
        }
Esempio n. 5
0
        public void exportExcel()
        {
            try
            {
                string record = this.Request["record"];

                Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                //List<ColumnInfo> records = JavaScriptConvert.DeserializeObject<List<ColumnInfo>>(ht["params"].ToString());
                List <ColumnInfo> headers = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["headers"].ToString());

                List <ColumnInfo> atdtParameters     = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["atdtparams"].ToString());
                List <ColumnInfo> personalParameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["personalparams"].ToString());

                string scope = ht["scope"].ToString();

                List <ColumnInfo> fullParameters = new List <ColumnInfo>();

                for (int i = 0; i < personalParameters.Count; i++)
                {
                    fullParameters.Add(personalParameters[i]);
                }

                for (int i = 0; i < atdtParameters.Count; i++)
                {
                    fullParameters.Add(atdtParameters[i]);
                }

                fullParameters.Add(new ColumnInfo()
                {
                    ColumnName = "atst", ColumnValue = (scope == "All" ? "" : "1")
                });                                                                                                      //1: abnormal

                atanarstBll bll = new atanarstBll();

                int total = 0;


                List <object> obj = bll.GetAnalyzeResult(fullParameters, false, 0, 0, ref total);


                if ((obj != null) && (total > 0))
                {
                    List <object> finalObj = BuildAnonymousObject(obj).Cast <object>().ToList();
                    UtilExcel.ExportToExcel(finalObj[0].GetType(), Response, this.GetType().Name.GetPageName(), headers, finalObj);
                }
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Esempio n. 6
0
        public void Estrategia1()
        {
            Cartera cartera = FactoryCartera.GetCartera();
            EstrategiaInversion1 estrategia = new EstrategiaInversion1(cartera, "Wall");

            string       pathFile = @"c:\tmp\cartera.xlsx";
            ExcelPackage pck      = UtilExcel.CrearExcelPackage(pathFile);

            cartera.ToExcel(pck);
            UtilExcel.OpenMicrosoftExcel(pathFile);
            //Compra compraAValidar = new Compra(cartValor) { PrecioCompra = 25594.5, NumCompra = 0.2 };
            //BooelanMensaje resultado= EstrategiaInversion1.ValidarCompra(cartValor, compraAValidar);
            //            Assert.AreEqual(resultado.Valor, false);
        }
Esempio n. 7
0
        public void exportExcel()
        {
            try
            {
                string      record = this.Request["record"];
                pshctvalBll bll    = new pshctvalBll();

                tpshctcfg cfg = bll.GetSelectedObject <tpshctcfg>(new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "hccd", ColumnValue = record
                    }
                });

                tstdefcfg xdef = bll.GetSelectedObject <tstdefcfg>(new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "dfnm", ColumnValue = cfg.xdef
                    }
                });

                tstdefcfg ydef = bll.GetSelectedObject <tstdefcfg>(new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "dfnm", ColumnValue = cfg.ydef
                    }
                });

                ValueInfoBll     dd   = new ValueInfoBll();
                List <ValueInfo> lstX = typeof(ValueInfoBll).GetMethod(xdef.dasc).Invoke(dd, new object[] { }) as List <ValueInfo>;
                List <ValueInfo> lstY = typeof(ValueInfoBll).GetMethod(ydef.dasc).Invoke(dd, new object[] { }) as List <ValueInfo>;

                List <List <ColumnInfo> > lstResult = bll.GetHeadCountCfgValue(record, cfg, lstX, lstY);

                if (lstResult != null)
                {
                    UtilExcel.ExportToExcel(Response, this.GetType().Name, lstResult);
                }
            }
            catch (Exception ex)
            {
                string message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_QueryFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Esempio n. 8
0
        // 작업 상태가 변경될 경우 호출할 콜백
        void OnChangeWorkState(TYPE_WORK prev, TYPE_WORK cur, string msg)
        {
            string log = "work state convert : " + prev.ToString() + " to " + cur.ToString();

            if ("" == msg)
            {
                m_mainCon.m_logger.OutputInfo(log);
            }
            else
            {
                m_mainCon.m_logger.OutputInfo(log + " - " + msg);
            }

            // 작업 완료 상황에 맞추어 색상을 변경함
            if (TYPE_WORK.Login == prev && TYPE_WORK.ClearCart == cur)
            {
                btnStatLogin.BackColor = m_colFin;
            }
            else if (TYPE_WORK.ClearCart == prev && TYPE_WORK.CheckOrderItem == cur)
            {
                btnStatInitCart.BackColor = m_colFin;
            }
            else if (TYPE_WORK.CheckOrderItem == prev && TYPE_WORK.Payment == cur)
            {
                if (m_bOrderOK)
                {
                    btnStatPayment.BackColor = m_colFin;
                }
                else
                {
                    btnStatPayment.BackColor = m_colErr;
                }
            }
            else if (TYPE_WORK.Payment == prev && TYPE_WORK.Complete == cur)
            {
                // 작업이 끝났을때 처리.
                // 주문 상태를 엑셀로 출력.
                string inpath   = m_mainCon.m_orderData.pathOrder;
                string outDir   = Path.GetDirectoryName(inpath);
                string fileName = Path.GetFileNameWithoutExtension(inpath);
                string time     = DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss");
                string outPath  = outDir + "\\" + fileName + " - result(" + m_mainCon.m_orderData.seller + ")-" + time + "-.xlsx";

                UtilExcel.ListViewToExcel(this.listOrder, outPath);

                MessageBox.Show("작업 완료.");
            }
        }
Esempio n. 9
0
        public List <string> GetFkey(byte[] file, string guid, out string message)
        {
            log.Info("start create file " + guid);
            string fileName = AppDomain.CurrentDomain.BaseDirectory + "/Tempfile/" + guid + ".xls";

            using (System.IO.FileStream fs = System.IO.File.Create(fileName))
            {
                fs.Write(file, 0, file.Length);
            }
            log.Info("read file");
            DataTable     objTable = UtilExcel.readExcelFile(fileName, "Sheet1$", true);
            List <string> lstFkey  = new List <string>();

            message = "";
            try
            {
                DataRow           row  = objTable.Rows[0];
                const string      Fkey = "Fkey";
                DataRowCollection drc  = objTable.Rows;
                foreach (DataRow dr in drc)
                {
                    if (string.IsNullOrEmpty(dr[Fkey].ToString().Trim()))
                    {
                        continue;
                    }
                    lstFkey.Add(dr[Fkey].ToString().Trim());
                }
            }
            catch (IndexOutOfRangeException ex)
            {
                message = "Lỗi khi đọc file excel :File không đúng định dạng";
                return(null);
            }
            catch (FormatException ex)
            {
                message = "Lỗi khi đọc file excel: Không phải báo cáo 1.15-HDDT-Gửi cập nhật đồng bộ";
                return(null);
            }
            catch (Exception ex)
            {
                log.Error("PaymentTransactionIndex paymentViaBlock Error5" + ex.Message);
                message = "Lỗi khi đọc file excel :" + ex;
                return(null);
            }
            message = "";
            return(lstFkey);
        }
Esempio n. 10
0
        private void btnOrder_Click(object sender, EventArgs e)
        {
            OpenFileDialog OFD = new OpenFileDialog();

            if (OFD.ShowDialog() == DialogResult.OK)
            {
                edtOrder.Text = OFD.FileName;
                string filepath = OFD.FileName;
                //edtOrder.Text = @"D:\Project\Auto web order\Doc\주문상품리스트.xls";

                // 엑셀 파일 찾기
                OrderData orderData = new OrderData();
                orderData.pathOrder = filepath;

                // 엑셀 파일 열기. 엑셀은 시작 인덱스가 1 임
                UtilExcel.GetColumDatas(filepath
                                        , 1, orderData.listSerial
                                        , 2, orderData.listName
                                        , 4, orderData.listAmount
                                        , 6, orderData.listCategory
                                        , 7, orderData.listCode
                                        , 8, orderData.listSeller);

                // 디엠 사이트만 필터링
                orderData.FilterBySeller("디엠");

                //// 주문 아이템 로드
                //m_listOrderItem.Add(new OrderItem("111111111111", 1));  // 존재하지 않는 물건
                //m_listOrderItem.Add(new OrderItem("3600523399826", 1)); // 재고없는 물건
                //m_listOrderItem.Add(new OrderItem("4058172337215", 2));
                //m_listOrderItem.Add(new OrderItem("3574661264202", 17));// 주문 안되는 수량

                // 리스트뷰 업데이트
                for (int i = 0; i < orderData.GetCount(); i++)
                {
                    ListViewItem item = new ListViewItem(orderData.listSerial[i]);
                    item.SubItems.Add(orderData.listName[i]);
                    item.SubItems.Add(orderData.listAmount[i]);
                    item.SubItems.Add(orderData.listCategory[i]);
                    item.SubItems.Add(orderData.listSeller[i]);
                    item.SubItems.Add(orderData.listCode[i]);
                    listOrder.Items.Add(item);
                }

                m_mainCon.m_orderData = orderData;
            }
        }
Esempio n. 11
0
 public void exportExcel()
 {
     try
     {
         string            header  = this.Request["header"];
         List <ColumnInfo> headers = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(header);
         object            obj     = HttpContext.Session["traceJson"];
         if (obj != null)
         {
             List <Dictionary <string, string> > list = obj as List <Dictionary <string, string> >;
             UtilExcel.ExportToExcel(Response, this.GetType().Name.GetPageName(), headers, list);
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 12
0
        public void exportExcel()
        {
            string message = string.Empty;

            try
            {
                string record = this.Request["record"];
                string header = this.Request["header"];

                if ((record == null) || (record.Length < 1))
                {
                    record = "{\"year\":\"" + UtilDatetime.FormatDate3(DateTime.Now).Substring(0, 4) + "\"}";
                }

                if (header == null || header.Equals(string.Empty))
                {
                    return;
                }
                Hashtable         ht      = JavaScriptConvert.DeserializeObject <Hashtable>(record);
                List <ColumnInfo> headers = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(header);
                stperiodBll       bll     = new stperiodBll();

                List <ColumnInfo> parameters = new List <ColumnInfo>()
                {
                    new ColumnInfo()
                    {
                        ColumnName = "year", ColumnValue = ht["year"].ToString()
                    }
                };

                List <tstperiod> yearList = bll.GetSelectedRecords <tstperiod>(parameters);
                if (yearList != null)
                {
                    UtilExcel.ExportToExcel(Response, this.GetType().Name.GetPageName(), headers, yearList);
                }
            }
            catch (Exception ex)
            {
                message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_ExportExcelFail, ex, true) + "'}";
                Response.Output.Write(message);
            }
        }
Esempio n. 13
0
        public void procesarCargaDatos(string archivo, string semestre, int Estado)
        {
            Log.Info("Inicio proceso archivo[" + archivo + "]");
            UtilExcel utlXls = new UtilExcel();
            string    path   = "C:\\Program Files\\CargaExcel\\" + archivo;

            if (utlXls.init(path, "Pregrado"))
            {
                int  fila      = 5;
                bool continuar = true;
                while (continuar)
                {
                    //Crear Objetos
                    Persona personaAlumno      = new Persona();
                    Persona personaDocenteGuia = new Persona();
                    Persona personaSupervisor  = new Persona();
                    Alumno  Alumn = new Alumno();
                    ProfesionalSupervisor Supervisor = new ProfesionalSupervisor();
                    // UnidadDeServicio UServicio = new UnidadDeServicio();
                    Inmunizacion         inmun           = new Inmunizacion();
                    CentroFormador       CentroF         = new CentroFormador();
                    NombreCentroFormador NCentroF        = new NombreCentroFormador();
                    Carrera              Carr            = new Carrera();
                    Periodo              Per             = new Periodo();
                    NombreJornada        Njornada        = new NombreJornada();
                    Dias                 dia             = new Dias();
                    DocenciaHospitalaria DocHospitalaria = new DocenciaHospitalaria();
                    Institucion          institucion     = new Institucion();
                    NombreCampoClinico   NCampo          = new NombreCampoClinico();
                    CampoClinico         Campo           = new CampoClinico();
                    // NombreUnidadDeServicio NUnidadDeServicio = new NombreUnidadDeServicio();
                    CampoClinicoAlumno CampoAlumnos = new CampoClinicoAlumno();
                    IngresoServices    ingreso      = new IngresoServices();
                    Asignatura         Asignaturas  = new Asignatura();
                    Semestre           Semestres    = new Semestre();
                    Anio Ano = new Anio();



                    string CentroFormador = utlXls.getCellValue(string.Format("B{0}", fila));
                    if (CentroFormador != null && !CentroFormador.Equals(string.Empty))
                    {
                        //capturando Asignatura
                        string Asignatura = utlXls.getCellValue(string.Format("A{0}", fila));
                        //capturando Carrera
                        string Carrera = utlXls.getCellValue(string.Format("C{0}", fila));

                        //Institucion
                        string Institucion = utlXls.getCellValue(string.Format("D{0}", fila));

                        //Campo Clinico
                        string NombCampoClinico = utlXls.getCellValue(string.Format("E{0}", fila));

                        //Unidad de servicio
                        // string UnidadServicio = utlXls.getCellValue(string.Format("F{0}", fila));

                        //Rut Alumno
                        string RutAlumno = utlXls.getCellValue(string.Format("F{0}", fila));

                        //DV-Alumno
                        string DvAlumno = utlXls.getCellValue(string.Format("G{0}", fila));

                        //ApellidoAlumno
                        string ApellidoPaAlumno = utlXls.getCellValue(string.Format("H{0}", fila));

                        //ApellidoMaternoAlumno
                        string ApellidoMaAlumno = utlXls.getCellValue(string.Format("I{0}", fila));

                        //Nombre alumno
                        string NombreAlumno = utlXls.getCellValue(string.Format("J{0}", fila));

                        //Curso/nivel alumno
                        string CursoNivel = utlXls.getCellValue(string.Format("K{0}", fila));

                        //anio periodo
                        string anio = utlXls.getCellValue(string.Format("N{0}", fila));
                        //Fecha Inicio
                        DateTime FechaInicio = DateTime.Parse(utlXls.getCellValue(string.Format("L{0}", fila)) + "-" + utlXls.getCellValue(string.Format("M{0}", fila)) + "-" + utlXls.getCellValue(string.Format("N{0}", fila)));

                        //Fecha termino
                        DateTime FechaTermino = DateTime.Parse(utlXls.getCellValue(string.Format("O{0}", fila)) + "-" + utlXls.getCellValue(string.Format("P{0}", fila)) + "-" + utlXls.getCellValue(string.Format("Q{0}", fila)));

                        //Nombre Jornada
                        string NombreJornada = utlXls.getCellValue(string.Format("R{0}", fila));

                        //Dia lunes
                        string lunes = utlXls.getCellValue(string.Format("S{0}", fila));

                        //Dia Martes
                        string Martes = utlXls.getCellValue(string.Format("T{0}", fila));

                        //Dia Miercoles
                        string Miercoles = utlXls.getCellValue(string.Format("U{0}", fila));

                        //Dia Jueves
                        string Jueves = utlXls.getCellValue(string.Format("V{0}", fila));

                        //Dia Viernes
                        string Viernes = utlXls.getCellValue(string.Format("W{0}", fila));

                        //Dia Sabado
                        string Sabado = utlXls.getCellValue(string.Format("X{0}", fila));

                        //Dia Domingo
                        string Domingo = utlXls.getCellValue(string.Format("Y{0}", fila));


                        //falta la jornada tipo 2

                        //Inmunizaciones
                        string Inmunizaciones = utlXls.getCellValue(string.Format("AP{0}", fila));

                        //Observaciones alumno
                        string ObservacionAlumno = utlXls.getCellValue(string.Format("AQ{0}", fila));

                        //Docencia Hospitalaria
                        string DocenciaHospitalaria = utlXls.getCellValue(string.Format("AR{0}", fila));

                        //Rut Docente Guia
                        string RutDocenteGuia = utlXls.getCellValue(string.Format("AS{0}", fila));

                        //DV-Profesional docente guia
                        string DvProfesionalDocenteGuia = utlXls.getCellValue(string.Format("AT{0}", fila));

                        //Apellido paterno Profesional docente guia
                        string ApPaternoDocenteGuia = utlXls.getCellValue(string.Format("AU{0}", fila));

                        //Apellido Materno Profesional docente guia
                        string ApMaternoDocenteGuia = utlXls.getCellValue(string.Format("AV{0}", fila));

                        //Nombre Profresional docente guia
                        string NombreProfesionalDocenteGuia = utlXls.getCellValue(string.Format("AW{0}", fila));

                        //Profesion Docente guia
                        string ProfesionDocenteGuia = utlXls.getCellValue(string.Format("AX{0}", fila));

                        //n° Registro superintendencia de prestadores
                        string Nregistro = utlXls.getCellValue(string.Format("AY{0}", fila));

                        //Telefono docente guia
                        string TelefonoDocenteGuia = utlXls.getCellValue(string.Format("AZ{0}", fila));

                        //Correo Docente Guia
                        string CorreoDocenteGuia = utlXls.getCellValue(string.Format("BA{0}", fila));

                        //Inmunización docente guia
                        string InmunizacionDocenteGuia = utlXls.getCellValue(string.Format("BB{0}", fila));

                        //Observaciones DocenteGuia
                        string ObservacionesDocente = utlXls.getCellValue(string.Format("BC{0}", fila));

                        //cumplimiento de requisitos
                        string Cumple = utlXls.getCellValue(string.Format("BD{0}", fila));

                        //ValorDocenteGuia
                        string valorDocenteGuia = utlXls.getCellValue(string.Format("EZ{0}", fila));

                        //Observaciones pago docente
                        string ObservacionesPagoDocente = utlXls.getCellValue(string.Format("FA{0}", fila));

                        //RutProfesionalSpuervisor
                        string RutProfesionalSupervisor = utlXls.getCellValue(string.Format("FB{0}", fila));

                        //Dv Profesional supervisor
                        string DvProfesionalSupervisor = utlXls.getCellValue(string.Format("FC{0}", fila));

                        //Apellido paterno profesional supervisor
                        string ApPaternoProfesionalSupervisor = utlXls.getCellValue(string.Format("FD{0}", fila));

                        //Apellido Materno profesional supervisor
                        string ApMaternoProfesionalSupervisor = utlXls.getCellValue(string.Format("FE{0}", fila));

                        //Nombre Profesiona Supervisor
                        string NombreProfesionalSupervisor = utlXls.getCellValue(string.Format("FF{0}", fila));

                        //Valor profesional supervisor
                        string ValorProfesionalSupervisor = utlXls.getCellValue(string.Format("FG{0}", fila));

                        //Observaciones profesional supervisor
                        string ObservacionesProfesionalSupervisor = utlXls.getCellValue(string.Format("FH{0}", fila));

                        //Ingreso de datos
                        #region Alumno
                        //crear Nombre Centro Formador
                        NCentroF = ingreso.CrearNombreCentroFormador(CentroFormador, Estado);

                        //Crear inmunización
                        inmun = ingreso.CrearInmunizacion(Inmunizaciones);

                        //Crear Carrea
                        Carr = ingreso.CrearCarrera(Carrera, Estado);

                        //crear Centro formador
                        CentroF = ingreso.CrearCentroFormador(NCentroF.NombreCentroFormadorId, Carr.CarreraId);



                        //Ingreso Persona Alumno
                        personaAlumno.Rut       = RutAlumno;
                        personaAlumno.Dv        = DvAlumno;
                        personaAlumno.Nombre    = NombreAlumno;
                        personaAlumno.ApPaterno = ApellidoPaAlumno;
                        personaAlumno.ApMaterno = ApellidoMaAlumno;
                        Alumn.CursoNivel        = CursoNivel;
                        Alumn.Observaciones     = ObservacionAlumno;
                        if (ObservacionAlumno == "")
                        {
                            Alumn.Observaciones = " ";
                        }
                        // personAlumno=ingreso.CrearPersona(personAlumno);
                        personaAlumno = ingreso.CrearPersona(personaAlumno, Estado);

                        Alumn = ingreso.CrearAlumno(personaAlumno, Alumn, inmun, CentroF, Estado);
                        #endregion


                        #region Jornada
                        //Jornada

                        //Periodo
                        Per.FechaInicio  = FechaInicio;
                        Per.FechaTermino = FechaTermino;


                        //NombreJornada
                        Njornada.Nombre = NombreJornada;
                        Njornada        = ingreso.crearNombreJornada(Njornada, Estado);
                        Per             = ingreso.CrearPeriodos(Per, Njornada);
                        //Dias
                        string[] dias = new string[7];
                        dias[0] = lunes;
                        dias[1] = Martes;
                        dias[2] = Miercoles;
                        dias[3] = Jueves;
                        dias[4] = Viernes;
                        dias[5] = Sabado;
                        dias[6] = Domingo;

                        List <Dias> Listdia = ingreso.CrearDias();

                        /* //Jornada
                         * Jor = ingreso.CrearJornada(Njornada, Per, Alumn);
                         *
                         *
                         * //JornadaDias
                         * Jdias = ingreso.crearJornadaDias(Jor, dia, dias);*/


                        #endregion

                        #region ProfesionalDocenteGuia

                        //Capturar inmunizacion docente guia
                        inmun = ingreso.CrearInmunizacion(InmunizacionDocenteGuia);
                        //Capturar docencia hospitalaria
                        DocHospitalaria = ingreso.CrearDocenciaHospitalaria(DocenciaHospitalaria, Estado);
                        //Capturar datos  Persona docente guia
                        ProfesionalDocenteGuia DocenteGuia = new ProfesionalDocenteGuia();

                        personaDocenteGuia.Rut       = RutDocenteGuia;
                        personaDocenteGuia.Dv        = DvProfesionalDocenteGuia;
                        personaDocenteGuia.Nombre    = NombreProfesionalDocenteGuia;
                        personaDocenteGuia.ApPaterno = ApPaternoDocenteGuia;
                        personaDocenteGuia.ApMaterno = ApMaternoDocenteGuia;
                        //Capturar datos profesional docnete guia
                        DocenteGuia.Profesion = ProfesionDocenteGuia;
                        if (Nregistro == "")
                        {
                            DocenteGuia.NumeroSuperintendencia = 0;
                        }
                        else
                        {
                            DocenteGuia.NumeroSuperintendencia = Int64.Parse(Nregistro);
                        }

                        if (TelefonoDocenteGuia == "")
                        {
                            DocenteGuia.Telefono = 0;
                        }
                        else
                        {
                            //TelefonoDocenteGuia = TelefonoDocenteGuia.Replace(" ","");
                            DocenteGuia.Telefono = Convert.ToInt64(TelefonoDocenteGuia.Trim());
                        }

                        DocenteGuia.Correo = CorreoDocenteGuia;
                        if (valorDocenteGuia == "")
                        {
                            valorDocenteGuia = "0";
                        }
                        else if (valorDocenteGuia == "sin pago")
                        {
                            valorDocenteGuia = "0";
                        }
                        DocenteGuia.ValorDocente = Int64.Parse(valorDocenteGuia);
                        DocenteGuia.CumpleDatos  = Cumple;
                        if (RutDocenteGuia == "" && DvProfesionalDocenteGuia == "" && NombreProfesionalDocenteGuia == "")
                        {
                            personaDocenteGuia.Rut             = "Ninguno";
                            personaDocenteGuia.Dv              = "Ninguno";
                            personaDocenteGuia.Nombre          = "Ninguno";
                            personaDocenteGuia.ApPaterno       = "Ninguno";
                            personaDocenteGuia.ApMaterno       = "Ninguno";
                            DocenteGuia.NumeroSuperintendencia = 0;
                            DocenteGuia.Correo       = "Ninguno";
                            DocenteGuia.ValorDocente = 0;
                        }
                        personaDocenteGuia = ingreso.CrearPersona(personaDocenteGuia, Estado);
                        DocenteGuia        = ingreso.CrearProfesionalDocenteGuia(personaDocenteGuia, DocenteGuia, inmun, DocHospitalaria, Estado);

                        #endregion

                        //if (DocenteGuia == null)
                        //{
                        //    DocenteGuia = new ProfesionalDocenteGuia();
                        //    DocenteGuia.Rut = RutDocenteGuia;
                        //    DocenteGuia.Dv = DvProfesionalDocenteGuia;
                        //    DocenteGuia.Nombre = NombreProfesionalDocenteGuia;
                        //    DocenteGuia.ApPaterno = ApPaternoDocenteGuia;
                        //    DocenteGuia.ApMaterno = ApMaternoDocenteGuia;
                        //    //Capturar datos profesional docnete guia
                        //    DocenteGuia.Profesion = ProfesionDocenteGuia;
                        //    DocenteGuia.NumeroSuperintendencia = Int32.Parse(Nregistro);
                        //    DocenteGuia.Telefono = Int32.Parse(TelefonoDocenteGuia);
                        //    DocenteGuia.Correo = CorreoDocenteGuia;
                        //    DocenteGuia.ValorDocente = "";
                        //    DocenteGuia = ingreso.CrearProfesionalDocenteGuia(DocenteGuia, inmun, DocHospitalaria);
                        //}

                        #region ProfesionalSupervisor
                        personaSupervisor.Rut       = RutProfesionalSupervisor;
                        personaSupervisor.Dv        = DvProfesionalSupervisor;
                        personaSupervisor.Nombre    = NombreProfesionalSupervisor;
                        personaSupervisor.ApPaterno = ApPaternoProfesionalSupervisor;
                        personaSupervisor.ApMaterno = ApMaternoProfesionalSupervisor;
                        if (ValorProfesionalSupervisor == "")
                        {
                            Supervisor.ValorSupervisor = 0;
                        }
                        else
                        {
                            Supervisor.ValorSupervisor = Int32.Parse(ValorProfesionalSupervisor);
                        }

                        Supervisor.Observaciones = ObservacionesProfesionalSupervisor;

                        if (personaSupervisor.Rut == "" && personaSupervisor.Dv == "" && personaSupervisor.Nombre == "")
                        {
                            personaSupervisor.Rut       = "Ninguno";
                            personaSupervisor.Dv        = "Ninguno";
                            personaSupervisor.Nombre    = "Ninguno";
                            personaSupervisor.ApPaterno = "Ninguno";
                            personaSupervisor.ApMaterno = "Ninguno";
                            Supervisor.Observaciones    = "Ninguno";
                        }
                        personaSupervisor = ingreso.CrearPersona(personaSupervisor, Estado);
                        Supervisor        = ingreso.crearProfesionalSupervisor(personaSupervisor, Supervisor, Estado);
                        #endregion

                        //if (Supervisor == null)
                        //{
                        //    Supervisor = new ProfesionalSupervisor();
                        //    Supervisor.Rut = RutProfesionalSupervisor;
                        //    Supervisor.Dv = DvProfesionalSupervisor;
                        //    Supervisor.Nombre = NombreProfesionalSupervisor;
                        //    Supervisor.ApPaterno = ApPaternoProfesionalSupervisor;
                        //    Supervisor.ApMaterno = ApMaternoProfesionalSupervisor;
                        //    Supervisor.ValorSupervisor = Int32.Parse(ValorProfesionalSupervisor);
                        //    Supervisor.Observaciones = "";

                        //    Supervisor = ingreso.crearProfesionalSupervisor(Supervisor);
                        //}

                        #region institución
                        //institucion.NombreInstitucion = Institucion;
                        institucion = ingreso.CrearInstitucion(Institucion, Estado);
                        #endregion
                        #region NombreCampoClinico
                        NCampo = ingreso.CrearNombreCampoClinico(NombCampoClinico, Estado);
                        #endregion

                        #region CampoClinico
                        Campo = ingreso.CrearCampoClinico(NCampo, institucion, Estado);
                        #endregion

                        //#region NombreUnidadDeServicio
                        //NUnidadDeServicio = ingreso.CrearNombreUnidadDeServicio(UnidadServicio);
                        //#endregion

                        //#region UnidadDeServicio
                        //UServicio = ingreso.CrearUnidadDeServicio(NUnidadDeServicio, Campo);
                        //#endregion

                        #region Asignatura
                        Asignaturas.NombreAsignatura = Asignatura;
                        Asignaturas = ingreso.CrearAsignatura(Asignaturas, Estado);
                        #endregion

                        #region Semestre

                        Semestres.NombreSemestre = semestre;
                        Semestres = ingreso.CrearSemestre(Semestres);
                        #endregion

                        #region anio
                        Ano.Ano = anio;
                        Ano     = ingreso.CrearAnio(Ano);
                        #endregion

                        #region CampoClinicosAlumnos
                        CampoAlumnos = ingreso.CrearCampoClinicoAlumno(Alumn, DocenteGuia, Supervisor, Per, Asignaturas, Semestres, Ano, Campo);
                        #endregion


                        if (lunes.ToUpper().Trim() == "X")
                        {
                            ingreso.CrearCampoClinicoAlumnosDias(CampoAlumnos, "Lunes");
                        }
                        if (Martes.ToUpper().Trim() == "X")
                        {
                            ingreso.CrearCampoClinicoAlumnosDias(CampoAlumnos, "Martes");
                        }
                        if (Miercoles.ToUpper().Trim() == "X")
                        {
                            ingreso.CrearCampoClinicoAlumnosDias(CampoAlumnos, "Miercoles");
                        }
                        if (Jueves.ToUpper().Trim() == "X")
                        {
                            ingreso.CrearCampoClinicoAlumnosDias(CampoAlumnos, "Jueves");
                        }
                        if (Viernes.ToUpper().Trim() == "X")
                        {
                            ingreso.CrearCampoClinicoAlumnosDias(CampoAlumnos, "Viernes");
                        }
                        if (Sabado.ToUpper().Trim() == "X")
                        {
                            ingreso.CrearCampoClinicoAlumnosDias(CampoAlumnos, "Sabado");
                        }
                        if (Domingo.ToUpper().Trim() == "X")
                        {
                            ingreso.CrearCampoClinicoAlumnosDias(CampoAlumnos, "Domingo");
                        }
                        fila++;
                    }
                    else
                    {
                        continuar = false;
                    }
                }
            }
        }
Esempio n. 14
0
 private void ExportToExcel(string rpcd, List <ColumnInfo> lstParameters)
 {
     LoadData(rpcd, lstParameters);
     UtilExcel.ExportToExcelDataOnly(Response, this.GridView1, this.GetType().Name);
 }
Esempio n. 15
0
        public ArchivoReporte ExportarClientesAdvanced(string aniofabricacion, string aniomodelo, string sucursal, string asesorcomercial,
                                                       string fechaentregaDe, string fechaentregaHasta, string asesorservicio,
                                                       string fechaservicioDe, string fechaservicioHasta, string marca, string modelo,
                                                       string departamento, string provincia, string distrito, bool?porventavehiculo,
                                                       bool?porservicio, bool?porrepuesto,
                                                       string asesorVendedor, string fechaVentaDe, string fechaVentaHasta, string vin)
        {
            var clienteList = ObtenerClienteAvanzada(aniofabricacion, aniomodelo, sucursal, asesorcomercial,
                                                     fechaentregaDe, fechaentregaHasta, asesorservicio, fechaservicioDe, fechaservicioHasta, marca, modelo,
                                                     departamento, provincia, distrito, porventavehiculo, porservicio, porrepuesto,
                                                     asesorVendedor, fechaVentaDe, fechaVentaHasta, vin);

            var clienteDTOList = (from x in clienteList
                                  select new
            {
                x.TipoPersona,
                x.NumeroDocumento,
                x.NombreCompleto,
                x.ApellidoPaterno,
                x.ApellidoMaterno,
                x.Genero,
                x.FechaNacimiento,
                x.Telefono,
                x.Celular,
                x.Correo,
                x.Direccion,
                x.Departamento,
                x.Provincia,
                x.Distrito
            }).ToList();

            Dictionary <string, string> colNames = null;
            Dictionary <string, int>    colWidth = null;

            colNames = new Dictionary <string, string>();
            colNames.Add("TipoPersona", "Tipo cliente");
            colNames.Add("NumeroDocumento", "Doc cliente");
            colNames.Add("NombreCompleto", "Cliente Nombre");
            colNames.Add("ApellidoPaterno", "Cliente Ape Paterno");
            colNames.Add("ApellidoMaterno", "Cliente Ape Materno");
            colNames.Add("Genero", "Sexo");
            colNames.Add("FechaNacimiento", "Fecha Nacimiento");
            colNames.Add("Telefono", "Teléfono");
            colNames.Add("Celular", "Celular");
            colNames.Add("Correo", "Correo");
            colNames.Add("Direccion", "Dirección");
            colNames.Add("Departamento", "Departamento");
            colNames.Add("Provincia", "Provincia");
            colNames.Add("Distrito", "Distrito");

            colWidth = new Dictionary <string, int>();
            colWidth.Add("TipoPersona", 20);
            colWidth.Add("NumeroDocumento", 40);
            colWidth.Add("NombreCompleto", 40);
            colWidth.Add("ApellidoPaterno", 40);
            colWidth.Add("ApellidoMaterno", 40);
            colWidth.Add("Genero", 20);
            colWidth.Add("FechaNacimiento", 20);
            colWidth.Add("Telefono", 20);
            colWidth.Add("Celular", 20);
            colWidth.Add("Correo", 40);
            colWidth.Add("Direccion", 40);
            colWidth.Add("Departamento", 40);
            colWidth.Add("Provincia", 40);
            colWidth.Add("Distrito", 40);

            var estiloCelda = new EstiloCelda()
            {
                ColorLetra = NPOI.HSSF.Util.HSSFColor.LightBlue.Index,
                ColorFondo = NPOI.HSSF.Util.HSSFColor.Grey25Percent.Index
            };

            var exportar = UtilExcel.ExportarArchivo(new PlantillaExcel()
            {
                CabeceraColumna     = colNames,
                TituloExcel         = "Reporte Clientes",
                Filtros             = new List <string>(),
                Datos               = clienteDTOList,
                EstiloCeldaCabecera = estiloCelda,
                EstiloCelda         = new EstiloCelda()
                {
                    AjustarCelda = true
                },
                EstiloFiltro = new EstiloCelda()
                {
                    EsNegrita = true
                },
                EstiloTitulo = new EstiloCelda()
                {
                    Tamanio = 14, EsNegrita = true
                },
                TamanioColumna = colWidth
            });

            return(exportar);
        }
Esempio n. 16
0
        public List <string> GetFkey(byte[] file, string guid, out string message)
        {
            log.Info("start create file " + guid);
            string fileName = AppDomain.CurrentDomain.BaseDirectory + "/Tempfile/" + guid + ".xls";

            using (System.IO.FileStream fs = System.IO.File.Create(fileName))
            {
                fs.Write(file, 0, file.Length);
            }
            log.Info("read file");
            DataTable     objTable = UtilExcel.readExcelFile(fileName, "Sheet1$", true);
            List <string> lstFkey  = new List <string>();

            message = "";
            try
            {
                //DataRow row = objTable.Rows[0];
                //objTable.Rows.Remove(row);
                //const int THANHTOAN_ID = 2;
                //const int CHU_KY_NO = 5;
                const string      THANHTOAN_ID = "THANHTOAN_ID";
                const string      CHU_KY_NO    = "CHU_KY_NO";
                DataRowCollection drc          = objTable.Rows;
                foreach (DataRow dr in drc)
                {
                    if (string.IsNullOrEmpty(dr[THANHTOAN_ID].ToString().Trim()))
                    {
                        continue;
                    }
                    if (string.IsNullOrEmpty(dr[CHU_KY_NO].ToString()) || string.IsNullOrWhiteSpace(dr[CHU_KY_NO].ToString()))
                    {
                        continue;
                    }
                    string[] kyHd = dr[CHU_KY_NO].ToString().Trim().Split(',');
                    foreach (string s in kyHd)
                    {
                        string[] temp  = s.Trim().Split('/');
                        int      month = Convert.ToInt32(temp[0]);
                        int      year  = Convert.ToInt32(temp[1]);
                        lstFkey.Add(dr[THANHTOAN_ID].ToString().Trim() + year.ToString() + month.ToString("00"));
                    }
                }
            }
            catch (IndexOutOfRangeException ex)
            {
                message = "Lỗi khi đọc file excel :File không đúng định dạng";
                return(null);
            }
            catch (FormatException ex)
            {
                message = "Lỗi khi đọc file excel: Không phải báo cáo 1.15-HDDT-Gửi cập nhật đồng bộ";
                return(null);
            }
            catch (Exception ex)
            {
                log.Error("PaymentTransactionIndex paymentViaBlock Error5" + ex.Message);
                message = "Lỗi khi đọc file excel :" + ex;
                return(null);
            }
            message = "";
            return(lstFkey);
        }
        public ArchivoReporte ExportarSincronizacion(IEnumerable <VisorSincronizacionDTO> lista)
        {
            var visorDTOList = (from x in lista
                                select new
            {
                x.Fecha,
                x.TipoSincronizacion,
                x.IdProceso,
                x.TipoProceso,
                x.Aplicacion,
                x.Estado,
                x.Observacion,
                x.Data
            }).ToList();

            Dictionary <string, string> colNames = new Dictionary <string, string>();
            Dictionary <string, int>    colWidth = new Dictionary <string, int>();

            colNames.Add("Fecha", "Fecha");
            colNames.Add("TipoSincronizacion", "Tipo Sincronizacion");
            colNames.Add("IdProceso", "Id Proceso");
            colNames.Add("TipoProceso", "Tipo Proceso");
            colNames.Add("Aplicacion", "Aplicacion");
            colNames.Add("Estado", "Estado");
            colNames.Add("Observacion", "Observacion");
            colNames.Add("Data", "Data");

            colWidth.Add("Fecha", 20);
            colWidth.Add("TipoSincronizacion", 20);
            colWidth.Add("IdProceso", 20);
            colWidth.Add("TipoProceso", 20);
            colWidth.Add("Aplicacion", 20);
            colWidth.Add("Estado", 20);
            colWidth.Add("Observacion", 60);
            colWidth.Add("Data", 60);

            var estiloCelda = new EstiloCelda()
            {
                ColorLetra = NPOI.HSSF.Util.HSSFColor.LightBlue.Index,
                ColorFondo = NPOI.HSSF.Util.HSSFColor.Grey25Percent.Index
            };

            var exportar = UtilExcel.ExportarArchivo(new PlantillaExcel()
            {
                CabeceraColumna     = colNames,
                TituloExcel         = "Reporte Visor Sincronizacion",
                Filtros             = new List <string>(),
                Datos               = visorDTOList,
                EstiloCeldaCabecera = estiloCelda,
                EstiloCelda         = new EstiloCelda()
                {
                    AjustarCelda = true
                },
                EstiloFiltro = new EstiloCelda()
                {
                    EsNegrita = true
                },
                EstiloTitulo = new EstiloCelda()
                {
                    Tamanio = 14, EsNegrita = true
                },
                TamanioColumna = colWidth
            });

            return(exportar);
        }
Esempio n. 18
0
        public async Task <ArchivoReporte> ExportarAsync(string clienteId)
        {
            IEnumerable <Cotizacion> _cotizaciones = await cotizacionRepository.BuscarPorClienteAsync(clienteId);

            IEnumerable <CotizacionDTO> _cotizacionesDto = _mapper.Map <IEnumerable <Cotizacion>, IEnumerable <CotizacionDTO> >(_cotizaciones);
            var _cotizacionesToExport = (from c in _cotizacionesDto
                                         select new
            {
                c.NombreMarca,
                c.NombreModelo,
                c.NombreEstado,
                c.AñoModelo,
                c.NombreCliente,
                c.NumeroDocumento,
                c.TipoCliente,
                c.NombreEmpleado,
                c.NumeroCotizacion,
                c.FechaRegistro,
                c.MontoPrecioVenta,
                c.MontoPrecioCierre,
                c.NombrePuntoVenta
            }).ToList();

            Dictionary <string, string> colNames = null;
            Dictionary <string, int>    colWidth = null;

            colNames = new Dictionary <string, string>();
            colNames.Add("NombreMarca", "Marca");
            colNames.Add("NombreModelo", "Modelo");
            colNames.Add("NombreEstado", "Estado");
            colNames.Add("AñoModelo", "Version");
            colNames.Add("NombreCliente", "Cliente");
            colNames.Add("NumeroDocumento", "Numero de Documento");
            colNames.Add("TipoCliente", "Tipo de Cliente");
            colNames.Add("NombreEmpleado", "Asesor");
            colNames.Add("NumeroCotizacion", "Numero Cotizacion");
            colNames.Add("FechaRegistro", "Fecha");
            colNames.Add("MontoPrecioVenta", "Precio Final");
            colNames.Add("MontoPrecioCierre", "Precio Cierre");
            colNames.Add("NombrePuntoVenta", "Punto de Venta");

            colWidth = new Dictionary <string, int>();
            colWidth.Add("NombreMarca", 20);
            colWidth.Add("NombreModelo", 20);
            colWidth.Add("NombreEstado", 20);
            colWidth.Add("AñoModelo", 10);
            colWidth.Add("NombreCliente", 60);
            colWidth.Add("NumeroDocumento", 20);
            colWidth.Add("TipoCliente", 20);
            colWidth.Add("NombreEmpleado", 60);
            colWidth.Add("NumeroCotizacion", 20);
            colWidth.Add("FechaRegistro", 20);
            colWidth.Add("MontoPrecioVenta", 20);
            colWidth.Add("MontoPrecioCierre", 20);
            colWidth.Add("NombrePuntoVenta", 40);

            var estiloCelda = new EstiloCelda()
            {
                ColorLetra = NPOI.HSSF.Util.HSSFColor.White.Index,
                ColorFondo = NPOI.HSSF.Util.HSSFColor.Black.Index
            };

            var exportar = UtilExcel.ExportarArchivo(new PlantillaExcel()
            {
                CabeceraColumna     = colNames,
                TituloExcel         = "Reporte Cotizaciones",
                Filtros             = new List <string>(),
                Datos               = _cotizacionesToExport,
                EstiloCeldaCabecera = estiloCelda,
                EstiloCelda         = new EstiloCelda()
                {
                    AjustarCelda = true
                },
                EstiloFiltro = new EstiloCelda()
                {
                    EsNegrita = true
                },
                EstiloTitulo = new EstiloCelda()
                {
                    Tamanio = 14, EsNegrita = true
                },
                TamanioColumna = colWidth
            });

            return(exportar);
        }
Esempio n. 19
0
        public async Task <ArchivoReporte> ExportarAsync(string clienteId)
        {
            IEnumerable <TestDrive> _testsdrive = await testdriveRepository.BuscarPorClienteAsync(clienteId);

            IEnumerable <TestDriveDTO> _testsdriveDto = _mapper.Map <IEnumerable <TestDrive>, IEnumerable <TestDriveDTO> >(_testsdrive);
            var _testsdriveToExport = (from c in _testsdriveDto
                                       select new
            {
                c.NombreMarca,
                c.NombreModelo,
                c.CodigoFamiliaCorto,
                c.NombreCliente,
                c.NumeroDocumento,
                c.NombreAsesor,
                c.AsesorPuntoVenta,
                c.FechaPruebaManejo
            }).ToList();

            Dictionary <string, string> colNames = null;
            Dictionary <string, int>    colWidth = null;

            colNames = new Dictionary <string, string>();
            colNames.Add("NombreMarca", "Marca");
            colNames.Add("NombreModelo", "Modelo");
            colNames.Add("CodigoFamiliaCorto", "Version");
            colNames.Add("NombreCliente", "Cliente");
            colNames.Add("NumeroDocumento", "Numero de Documento");
            colNames.Add("NombreAsesor", "Asesor");
            colNames.Add("AsesorPuntoVenta", "Punto de Venta");
            colNames.Add("FechaPruebaManejo", "Fecha");

            colWidth = new Dictionary <string, int>();
            colWidth.Add("NombreMarca", 20);
            colWidth.Add("NombreModelo", 20);
            colWidth.Add("CodigoFamiliaCorto", 20);
            colWidth.Add("NombreCliente", 60);
            colWidth.Add("NumeroDocumento", 20);
            colWidth.Add("NombreAsesor", 60);
            colWidth.Add("AsesorPuntoVenta", 60);
            colWidth.Add("FechaPruebaManejo", 20);

            var estiloCelda = new EstiloCelda()
            {
                ColorLetra = NPOI.HSSF.Util.HSSFColor.White.Index,
                ColorFondo = NPOI.HSSF.Util.HSSFColor.Black.Index
            };

            var exportar = UtilExcel.ExportarArchivo(new PlantillaExcel()
            {
                CabeceraColumna     = colNames,
                TituloExcel         = "Reporte TestDrive",
                Filtros             = new List <string>(),
                Datos               = _testsdriveToExport,
                EstiloCeldaCabecera = estiloCelda,
                EstiloCelda         = new EstiloCelda()
                {
                    AjustarCelda = true
                },
                EstiloFiltro = new EstiloCelda()
                {
                    EsNegrita = true
                },
                EstiloTitulo = new EstiloCelda()
                {
                    Tamanio = 14, EsNegrita = true
                },
                TamanioColumna = colWidth
            });

            return(exportar);
        }
Esempio n. 20
0
 private void ExportToExcel(string hccd)
 {
     LoadData(hccd);
     UtilExcel.ExportToExcelDataOnly(Response, this.GridView1, this.GetType().Name);
 }
Esempio n. 21
0
        public async Task <ArchivoReporte> ExportarAsync(string clienteId)
        {
            IEnumerable <Venta> _ventas = await ventaRepository.BuscarPorClienteAsync(clienteId);

            IEnumerable <VentaDTO> _ventasDTO = _mapper.Map <IEnumerable <Venta>, IEnumerable <VentaDTO> >(_ventas);
            var _ventasToExport = (from c in _ventasDTO
                                   select new
            {
                c.NombreComercial,
                c.NumeroNotaPedido,
                c.NombreTipoVenta,
                c.FechaFacturacion,
                c.FechaEntrega,
                c.EstadoDespacho,
                c.FechaEstimacionDespacho,
            }).ToList();

            Dictionary <string, string> colNames = null;
            Dictionary <string, int>    colWidth = null;

            colNames = new Dictionary <string, string>();
            colNames.Add("NombreComercial", "Descripcion");
            colNames.Add("NumeroNotaPedido", "Codigo");
            colNames.Add("NombreTipoVenta", "Tipo Venta");
            colNames.Add("FechaFacturacion", "Fecha Facturacion");
            colNames.Add("FechaEntrega", "Fecha Entrega");
            colNames.Add("EstadoDespacho", "Estado");
            colNames.Add("FechaEstimacionDespacho", "Fecha Estado");

            colWidth = new Dictionary <string, int>();
            colWidth.Add("NombreComercial", 20);
            colWidth.Add("NumeroNotaPedido", 20);
            colWidth.Add("NombreTipoVenta", 20);
            colWidth.Add("FechaFacturacion", 60);
            colWidth.Add("FechaEntrega", 20);
            colWidth.Add("EstadoDespacho", 60);
            colWidth.Add("FechaEstimacionDespacho", 60);

            var estiloCelda = new EstiloCelda()
            {
                ColorLetra = NPOI.HSSF.Util.HSSFColor.White.Index,
                ColorFondo = NPOI.HSSF.Util.HSSFColor.Black.Index
            };

            var exportar = UtilExcel.ExportarArchivo(new PlantillaExcel()
            {
                CabeceraColumna     = colNames,
                TituloExcel         = "Reporte Ventas",
                Filtros             = new List <string>(),
                Datos               = _ventasToExport,
                EstiloCeldaCabecera = estiloCelda,
                EstiloCelda         = new EstiloCelda()
                {
                    AjustarCelda = true
                },
                EstiloFiltro = new EstiloCelda()
                {
                    EsNegrita = true
                },
                EstiloTitulo = new EstiloCelda()
                {
                    Tamanio = 14, EsNegrita = true
                },
                TamanioColumna = colWidth
            });

            return(exportar);
        }
Esempio n. 22
0
        public ArchivoReporte ExportarCliente(int tipofiltro, string textofiltro)
        {
            IEnumerable <Cliente> clienteList = clienteRepository.BuscarCliente(tipofiltro, textofiltro);
            var clienteDTOList = (from x in clienteList
                                  select new
            {
                x.TipoPersona,
                x.NumeroDocumento,
                x.NombreCompleto,
                x.ApellidoPaterno,
                x.ApellidoMaterno,
                x.Genero,
                x.FechaNacimiento,
                x.Telefono,
                x.Celular,
                x.Correo,
                x.Direccion,
                x.Departamento,
                x.Provincia,
                x.Distrito
            }).ToList();

            Dictionary <string, string> colNames = new Dictionary <string, string>();
            Dictionary <string, int>    colWidth = new Dictionary <string, int>();

            colNames.Add("TipoPersona", "Tipo cliente");
            colNames.Add("NumeroDocumento", "Doc cliente");
            colNames.Add("NombreCompleto", "Cliente Nombre");
            colNames.Add("ApellidoPaterno", "Cliente Ape Paterno");
            colNames.Add("ApellidoMaterno", "Cliente Ape Materno");
            colNames.Add("Genero", "Sexo");
            colNames.Add("FechaNacimiento", "Fecha Nacimiento");
            colNames.Add("Telefono", "Teléfono");
            colNames.Add("Celular", "Celular");
            colNames.Add("Correo", "Correo");
            colNames.Add("Direccion", "Dirección");
            colNames.Add("Departamento", "Departamento");
            colNames.Add("Provincia", "Provincia");
            colNames.Add("Distrito", "Distrito");

            colWidth.Add("TipoPersona", 20);
            colWidth.Add("NumeroDocumento", 40);
            colWidth.Add("NombreCompleto", 40);
            colWidth.Add("ApellidoPaterno", 40);
            colWidth.Add("ApellidoMaterno", 40);
            colWidth.Add("Genero", 20);
            colWidth.Add("FechaNacimiento", 20);
            colWidth.Add("Telefono", 20);
            colWidth.Add("Celular", 20);
            colWidth.Add("Correo", 40);
            colWidth.Add("Direccion", 40);
            colWidth.Add("Departamento", 40);
            colWidth.Add("Provincia", 40);
            colWidth.Add("Distrito", 40);

            var estiloCelda = new EstiloCelda()
            {
                ColorLetra = NPOI.HSSF.Util.HSSFColor.LightBlue.Index,
                ColorFondo = NPOI.HSSF.Util.HSSFColor.Grey25Percent.Index
            };

            var exportar = UtilExcel.ExportarArchivo(new PlantillaExcel()
            {
                CabeceraColumna     = colNames,
                TituloExcel         = "Reporte Clientes",
                Filtros             = new List <string>(),
                Datos               = clienteDTOList,
                EstiloCeldaCabecera = estiloCelda,
                EstiloCelda         = new EstiloCelda()
                {
                    AjustarCelda = true
                },
                EstiloFiltro = new EstiloCelda()
                {
                    EsNegrita = true
                },
                EstiloTitulo = new EstiloCelda()
                {
                    Tamanio = 14, EsNegrita = true
                },
                TamanioColumna = colWidth
            });

            return(exportar);
        }