示例#1
0
 protected void GridEstado_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e)
 {
     if (e.ButtonID == "btnCambiar")
     {
         int lintCodigoEstado = Convert.ToInt32(this.GridEstado.GetRowValues(e.VisibleIndex, "Estado_ID"));
         this.GridEstado.JSProperties.Clear();
         this.GridEstado.JSProperties.Add("cpMuestra", "General.aspx");
         if (lintCodigoEstado > -1)
         {
             Guid lGuid = new Guid(Session["xCodigo"].ToString());
             using (ICCEntities lObjEntidad = new ICCEntities())
             {
                 TRX_DYR_Movil lObjMovil = new TRX_DYR_Movil();
                 lObjMovil = (from p in lObjEntidad.TRX_DYR_Movil
                              where p.Codigo == lGuid
                              select p).FirstOrDefault();
                 if (lObjMovil != null)
                 {
                     lObjMovil.Estado_ID = Convert.ToInt32(this.GridEstado.GetRowValues(e.VisibleIndex, "Estado_ID"));
                     lObjEntidad.SaveChanges();
                 }
             }
         }
     }
 }
示例#2
0
        private void SubGuardarPlantilla()
        {
            int             lintIndice          = Convert.ToInt32(Session["ID"]);
            int             lintDYR_ID          = Convert.ToInt32(Session["DYR_ID"]);
            string          lStrCuencas         = string.Empty;
            string          lStrSecciones       = string.Empty;
            ASPxPageControl lObjPageControl     = (ASPxPageControl)ASPxGridViewPlantillaEncabezado.FindDetailRowTemplateControl(lintIndice, "ASPxPageControlPlantilla");
            ASPxGridView    lObjGridViewCuenca  = (ASPxGridView)lObjPageControl.FindControl("ASPxGridViewCuenca");
            ASPxGridView    lObjGridViewSeccion = (ASPxGridView)lObjPageControl.FindControl("ASPxGridViewSeccion");
            List <object>   lObjCuencas         = lObjGridViewCuenca.GetSelectedFieldValues("SubCuencaRio_ID");
            List <object>   lObjSecciones       = lObjGridViewSeccion.GetSelectedFieldValues("SubSeccion_ID");

            foreach (object lObjCuenca in lObjCuencas)
            {
                lStrCuencas += lObjCuenca.ToString() + ",";
            }
            foreach (object lObjSeccion in lObjSecciones)
            {
                lStrSecciones += lObjSeccion.ToString() + ",";
            }
            if (lStrCuencas.Length > 0)
            {
                lStrCuencas = lStrCuencas.Substring(0, lStrCuencas.Length - 1);
            }
            if (lStrSecciones.Length > 0)
            {
                lStrSecciones = lStrSecciones.Substring(0, lStrSecciones.Length - 1);
            }
            using (ICCEntities lObjEntidad = new ICCEntities())
            {
                lObjEntidad.xSpCrearPlantilla(lintDYR_ID, lStrCuencas, lStrSecciones);
                lObjEntidad.SaveChanges();
            }
        }
示例#3
0
        protected void ASPxGridView1_RowUpdated(object sender, DevExpress.Web.Data.ASPxDataUpdatedEventArgs e)
        {
            int lintSolicitudID = Convert.ToInt32(e.NewValues["Solicitud_ID"]);

            using (ICCEntities lObjIcc = new ICCEntities())
            {
                xSpHtml_Result lObjCorreo = new xSpHtml_Result();
                lObjCorreo = lObjIcc.xSpHtml(lintSolicitudID).FirstOrDefault();
                SubEnviarCorreo(lObjCorreo.Correo, lObjCorreo.Html);
            }
            this.ASPxGridView1.DataBind();
        }
示例#4
0
 protected void ASPxFormLayout1_E7_Click(object sender, EventArgs e)
 {
     using (ICCEntities lObjIcc = new ICCEntities())
     {
         xSpHtmlRecuperacion_Result lObjCorreo = new xSpHtmlRecuperacion_Result();
         lObjCorreo = lObjIcc.xSpHtmlRecuperacion(ASPxFormLayout1_E2.Text).FirstOrDefault();
         if (lObjCorreo != null)
         {
             SubEnviarCorreo(lObjCorreo.Correo, lObjCorreo.Html);
         }
     }
 }
示例#5
0
 protected void ASPxFormLayout1_E8_Click(object sender, EventArgs e)
 {
     try
     {
         using (ICCEntities lObjEntidad = new ICCEntities())
         {
             TRX_Solicitud lObjSolicitud = new TRX_Solicitud();
             lObjSolicitud = (from p in lObjEntidad.TRX_Solicitud
                              where p.CorreoElectronico == ASPxFormLayout1_E6.Text
                              select p).FirstOrDefault();
             if (lObjSolicitud != null)
             {
                 throw new Exception("Correo electrónico ya ha realizado solicitud anteriormente.");
             }
             if (ASPxFormLayout1_E4.Text != ASPxFormLayout1_E9.Text)
             {
                 throw new Exception("La contraseña no coindice, ingrese nuevamente la contraseña.");
             }
             if (ASPxFormLayout1_E6.Text.Trim().Length == 0)
             {
                 throw new Exception("Es necesario ingresar un correo electrónico valido.");
             }
             if (ASPxFormLayout1_E4.Text.Trim().Length == 0)
             {
                 throw new Exception("Es necesario ingresar una contraseña valida.");
             }
             if (ASPxFormLayout1_E9.Text.Trim().Length == 0)
             {
                 throw new Exception("Es necesario ingresar una re-contraseña valida.");
             }
             if (ASPxFormLayout1_E2.Text.Trim().Length == 0)
             {
                 throw new Exception("Es necesario ingresar nombre y apellidos.");
             }
             lObjSolicitud                   = new TRX_Solicitud();
             lObjSolicitud.Contrasena        = ASPxFormLayout1_E4.Text;
             lObjSolicitud.CorreoElectronico = ASPxFormLayout1_E6.Text;
             lObjSolicitud.Estado_ID         = 1;
             lObjSolicitud.NombresApellidos  = ASPxFormLayout1_E2.Text;
             lObjSolicitud.Organizacion_ID   = Convert.ToInt32(ASPxFormLayout1_E3.SelectedItem.Value);
             lObjSolicitud.Departamento_ID   = Convert.ToInt32(ASPxFormLayout1_E1.SelectedItem.Value);
             lObjSolicitud.Municipio_ID      = Convert.ToInt32(ASPxFormLayout1_E5.SelectedItem.Value);
             lObjEntidad.TRX_Solicitud.Add(lObjSolicitud);
             lObjEntidad.SaveChanges();
             Response.Redirect("~/");
         }
     }
     catch (Exception ex)
     {
         Response.Write("<script>alert('" + ex.Message + "');</script>");
     }
 }
示例#6
0
        private void subValidaciones()
        {
            string lS = Path.GetFileName(Request.PhysicalPath);

            using (ICCEntities lobjEntidad = new ICCEntities())
            {
                int lintPermite = lobjEntidad.xSPAccesos(Path.GetFileName(Request.PhysicalPath), User.Identity.Name).FirstOrDefault().Value;
                if (lintPermite == 0)
                {
                    Response.Redirect("~/Validaciones.aspx");
                }
            }
        }
示例#7
0
 private void SubCrearCookiePermisos(string lStrCorreoElectronico)
 {
     using (ICCEntities lObjIcc = new ICCEntities())
     {
         HttpCookie lObjCookie = Request.Cookies["cObjPermisos"];
         if (lObjCookie == null)
         {
             lObjCookie = new HttpCookie("cObjPermisos");
         }
         lObjCookie.Value   = JsonConvert.SerializeObject(lObjIcc.xSPPermisos(lStrCorreoElectronico).ToList());;
         lObjCookie.Expires = DateTime.Now.AddDays(1);
         Response.Cookies.Add(lObjCookie);
     }
 }
示例#8
0
 protected void ASPxFormLayout1_E8_Click(object sender, EventArgs e)
 {
     using (ICCEntities lObjEntidad = new ICCEntities())
     {
         TRX_Solicitud lObjSolicitud = new TRX_Solicitud();
         lObjSolicitud = (from p in lObjEntidad.TRX_Solicitud
                          where p.CorreoElectronico == ASPxFormLayout1_E2.Text && p.Contrasena == ASPxFormLayout1_E4.Text
                          select p).FirstOrDefault();
         if (lObjSolicitud != null)
         {
             FormsAuthentication.SetAuthCookie(ASPxFormLayout1_E2.Text, true);
             SubCrearCookiePermisos(ASPxFormLayout1_E2.Text);
             Response.Redirect("~/Contenido/index.html");
         }
     }
 }
示例#9
0
        public UnitOfWork(ICCEntities _context)
        {
            context     = _context;
            UserAcount  = new UserAcountRepository(_context);
            UserRole    = new UserRoleRepository(_context);
            Role        = new RoleRepository(_context);
            OrderItem   = new OrderItemRepository(_context);
            Membership  = new MembershipRepository(_context);
            Machine     = new MachineRepository(_context);
            Item        = new ItemRepository(_context);
            Facility    = new FacilityRepository(_context);
            BuyFacility = new BuyFacilityRepository(_context);
            BookMachine = new BookMachineRepository(_context);

            // UserAcounts = new UserAcountRepository(userAcount);
        }
示例#10
0
 protected void SubBuscarMunicipios(int lintCodigoDepartamento)
 {
     using (ICCEntities lObjIcc = new ICCEntities())
     {
         List <CAT_STD_Municipio> lObjMunicipios = new List <CAT_STD_Municipio>();
         ASPxFormLayout1_E5.Items.Clear();
         lObjMunicipios = (from p in lObjIcc.CAT_STD_Municipio
                           where p.Departamento_ID == lintCodigoDepartamento
                           select p).ToList();
         foreach (CAT_STD_Municipio lObjMunicipio in lObjMunicipios)
         {
             ASPxFormLayout1_E5.Items.Add(lObjMunicipio.Municipio_DSC, lObjMunicipio.Municipio_ID);
         }
         if (lObjMunicipios.Count > 0)
         {
             ASPxFormLayout1_E5.SelectedIndex = 0;
         }
     }
 }
示例#11
0
 private void SubBuscarPlantillas(ASPxComboBox lCmbPlantilla, int lintCodigoOrganizacion)
 {
     lCmbPlantilla.Items.Clear();
     using (ICCEntities lObjEntidad = new ICCEntities())
     {
         List <TRX_DYR_Plantilla_Encabezado> lObjPlantillas = new List <TRX_DYR_Plantilla_Encabezado>();
         lObjPlantillas = (from p in lObjEntidad.TRX_DYR_Plantilla_Encabezado
                           where p.Organizacion_ID == lintCodigoOrganizacion
                           select p).ToList();
         foreach (TRX_DYR_Plantilla_Encabezado lObjPlantilla in lObjPlantillas)
         {
             lCmbPlantilla.Items.Add(lObjPlantilla.DYR_DSC, lObjPlantilla.DYR_ID);
         }
         if (lCmbPlantilla.Items.Count > 0)
         {
             lCmbPlantilla.SelectedIndex = 0;
         }
     }
 }
示例#12
0
 private void SubBuscarMunicipios(ASPxComboBox lCmbMunicipio, int lintCodigoDepartamento)
 {
     lCmbMunicipio.Items.Clear();
     using (ICCEntities lObjEntidad = new ICCEntities())
     {
         List <CAT_STD_Municipio> lObjMunicipios = new List <CAT_STD_Municipio>();
         lObjMunicipios = (from p in lObjEntidad.CAT_STD_Municipio
                           where p.Departamento_ID == lintCodigoDepartamento
                           select p).ToList();
         foreach (CAT_STD_Municipio lObjMunicipio in lObjMunicipios)
         {
             lCmbMunicipio.Items.Add(lObjMunicipio.Municipio_DSC, lObjMunicipio.Municipio_ID);
         }
         if (lCmbMunicipio.Items.Count > 0)
         {
             lCmbMunicipio.SelectedIndex = 0;
         }
     }
 }
示例#13
0
        private void SubCargarSecciones()
        {
            int             lintIndice          = Convert.ToInt32(Session["ID"]);
            int             lintCodigo          = Convert.ToInt32(Session["DYR_ID"]);
            ASPxPageControl lObjTab             = (ASPxPageControl)ASPxGridViewPlantillaEncabezado.FindDetailRowTemplateControl(lintIndice, "ASPxPageControlPlantilla");
            ASPxGridView    lObjGridViewSeccion = (ASPxGridView)lObjTab.FindControl("ASPxGridViewSeccion");

            lObjGridViewSeccion.Selection.UnselectAll();
            using (ICCEntities lObjEntidad = new ICCEntities())
            {
                List <TRX_DYR_Plantilla_Detalle_Seccion> lObjSecciones = new List <TRX_DYR_Plantilla_Detalle_Seccion>();
                lObjSecciones = (from p in lObjEntidad.TRX_DYR_Plantilla_Detalle_Seccion
                                 where p.DYR_ID == lintCodigo
                                 select p).ToList();
                foreach (TRX_DYR_Plantilla_Detalle_Seccion lObjSeccion in lObjSecciones)
                {
                    lObjGridViewSeccion.Selection.SelectRowByKey(lObjSeccion.SubSeccion_ID);
                }
            }
        }
示例#14
0
        protected void ASPxFileManager1_FileUploading(object source, DevExpress.Web.FileManagerFileUploadEventArgs e)
        {
            DirectoryInfo di = new DirectoryInfo(MapPath("~/Boletines/" + Session["xID"]));

            foreach (FileInfo file in di.GetFiles())
            {
                file.Delete();
            }
            int lintCodigoBoletin = Convert.ToInt32(Session["xID"]);

            using (ICCEntities lObjEntidad = new ICCEntities())
            {
                CAT_STD_Boletin lobjBoletin = new CAT_STD_Boletin();
                lobjBoletin = (from p in lObjEntidad.CAT_STD_Boletin
                               where p.CodigoBoletin == lintCodigoBoletin
                               select p).FirstOrDefault();
                if (lobjBoletin != null)
                {
                    lobjBoletin.NombreArchivo = e.FileName;
                }
                lObjEntidad.SaveChanges();
            }
        }
示例#15
0
 private void SubCargarPlantilla(int pCodigoPlantilla)
 {
     GridViewCuenca.Selection.UnselectAll();
     GridViewSecciones.Selection.UnselectAll();
     using (ICCEntities lObjEntidad = new ICCEntities())
     {
         List <TRX_DYR_Plantilla_Detalle_Cuenca>  lObjCuencas   = new List <TRX_DYR_Plantilla_Detalle_Cuenca>();
         List <TRX_DYR_Plantilla_Detalle_Seccion> lObjSecciones = new List <TRX_DYR_Plantilla_Detalle_Seccion>();
         lObjCuencas = (from p in lObjEntidad.TRX_DYR_Plantilla_Detalle_Cuenca
                        where p.DYR_ID == pCodigoPlantilla
                        select p).ToList();
         lObjSecciones = (from p in lObjEntidad.TRX_DYR_Plantilla_Detalle_Seccion
                          where p.DYR_ID == pCodigoPlantilla
                          select p).ToList();
         foreach (TRX_DYR_Plantilla_Detalle_Cuenca lObjCuenca in lObjCuencas)
         {
             GridViewCuenca.Selection.SetSelectionByKey(lObjCuenca.SubCuentaRio_ID, true);
         }
         foreach (TRX_DYR_Plantilla_Detalle_Seccion lObjSeccion in lObjSecciones)
         {
             GridViewSecciones.Selection.SetSelectionByKey(lObjSeccion.SubSeccion_ID, true);
         }
     }
 }
 public UserAcountRepository(ICCEntities context) : base(context)
 {
     _iCCEntities = context;
 }
 public MembershipRepository(ICCEntities context) : base(context)
 {
     _iCCEntities = context;
 }
示例#18
0
 public RoleRepository(ICCEntities context) : base(context)
 {
     _iCCEntities = context;
 }
 public OrderItemRepository(ICCEntities context) : base(context)
 {
     _iCCEntities = context;
 }
 public BuyFacilityRepository(ICCEntities context) : base(context)
 {
     _iCCEntities = context;
 }
示例#21
0
 public MachineRepository(ICCEntities context) : base(context)
 {
     _iCCEntities = context;
 }