Exemple #1
0
        public ActionResult EditingDelete([ModelBinder(typeof(DevExpressEditorsBinder))] ro_PrestamoMasivo_Det_Info info_det)
        {
            ListaDetalle.DeleteRow(info_det.Secuencia, Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual));
            ro_PrestamoMasivo_Info model = new ro_PrestamoMasivo_Info();

            model.lst_detalle = ListaDetalle.get_list(Convert.ToDecimal(SessionFixed.IdTransaccionSessionActual));
            return(PartialView("_GridViewPartial_PrestamosMasivos_Det", model.lst_detalle));
        }
Exemple #2
0
        public static void FileUploadComplete(object sender, DevExpress.Web.FileUploadCompleteEventArgs e)
        {
            int cont = 0;
            ro_rubro_tipo_Bus                 bus_rubro                   = new ro_rubro_tipo_Bus();
            ro_empleado_info_list             empleado_info_list          = new ro_empleado_info_list();
            ro_PrestamoMasivo_Det_List        ListaDetalle_PrestamoMasivo = new ro_PrestamoMasivo_Det_List();
            List <ro_PrestamoMasivo_Det_Info> PrestamoMasivo_Det          = new List <ro_PrestamoMasivo_Det_Info>();
            var    IdTransaccionSession = Convert.ToDecimal(SessionFixed.IdTransaccionSession);
            int    Secuencia            = 1;
            Stream stream = new MemoryStream(e.UploadedFile.FileBytes);

            if (stream.Length > 0)
            {
                IExcelDataReader reader = null;
                reader = ExcelReaderFactory.CreateOpenXmlReader(stream);
                while (reader.Read())
                {
                    if (!reader.IsDBNull(0))
                    {
                        if (cont != 0)
                        {
                            int    IdEmpresa  = Convert.ToInt32(SessionFixed.IdEmpresa);
                            string cedula     = reader.GetString(0);
                            var    empleado   = empleado_info_list.get_list(IdTransaccionSession).Where(v => v.pe_cedulaRuc == cedula).FirstOrDefault();
                            var    CodRubro   = Convert.ToString(reader.GetValue(2));
                            var    info_rubro = bus_rubro.get_info_x_codigo(IdEmpresa, CodRubro);
                            if (empleado != null)
                            {
                                ro_PrestamoMasivo_Det_Info info = new ro_PrestamoMasivo_Det_Info
                                {
                                    Secuencia         = Secuencia++,
                                    IdEmpleado        = (empleado == null ? 0 : empleado.IdEmpleado),
                                    IdRubro           = (info_rubro == null ? null : info_rubro.IdRubro),
                                    Monto             = Convert.ToDouble(reader.GetValue(3)),
                                    NumCuotas         = Convert.ToInt32(reader.GetValue(4)),
                                    ru_descripcion    = (info_rubro == null ? "" : info_rubro.ru_descripcion),
                                    pe_nombreCompleto = (empleado == null ? "" : empleado.Empleado)
                                };
                                PrestamoMasivo_Det.Add(info);
                            }
                        }
                        cont++;
                    }
                }
                ListaDetalle_PrestamoMasivo.set_list(PrestamoMasivo_Det, IdTransaccionSession);
            }
        }
Exemple #3
0
        public void UpdateRow(ro_PrestamoMasivo_Det_Info info_det, decimal IdTransaccionSession)
        {
            int IdEmpresa = Convert.ToInt32(SessionFixed.IdEmpresa);
            ro_PrestamoMasivo_Det_Info edited_info = get_list(IdTransaccionSession).Where(m => m.Secuencia == info_det.Secuencia).First();
            var empleado = bus_empleado.get_info(IdEmpresa, info_det.IdEmpleado);

            if (empleado != null)
            {
                edited_info.pe_nombreCompleto = empleado.pe_apellido + ' ' + empleado.pe_nombre;
            }

            var rubro = bus_rubro.get_info(IdEmpresa, info_det.IdRubro);

            if (rubro != null)
            {
                edited_info.ru_descripcion = rubro.ru_descripcion;
            }

            edited_info.IdEmpleado = info_det.IdEmpleado;
            edited_info.IdRubro    = info_det.IdRubro;
            edited_info.NumCuotas  = info_det.NumCuotas;
            edited_info.Monto      = info_det.Monto;
        }
Exemple #4
0
        public ActionResult CmbRubro_PrestamosMasivos()
        {
            ro_PrestamoMasivo_Det_Info model = new ro_PrestamoMasivo_Det_Info();

            return(PartialView("_CmbRubro_PrestamosMasivos", model));
        }