예제 #1
0
        public void registarDatos()
        {
            clsElemento Elemento = new clsElemento();
            if (cbidGrupoElemento.Value != null)
                Elemento.idGrupoElemento = Convert.ToByte(cbidGrupoElemento.Value);
            if (cbidUnidadMedida.Value != null)
                Elemento.idUnidadMedida = Convert.ToByte(cbidUnidadMedida.Value);
            Elemento.Referencia = txtReferencia.Text;
            Elemento.Nombre = txtNombre.Text;
            Double valorMt2 = 0;
            Double.TryParse(txtMt2.Text, out valorMt2);
            Elemento.Mt2 = valorMt2;
            Double valorPeso = 0;
            Double.TryParse(txtPeso.Text, out valorPeso);
            Elemento.Peso = valorPeso;
            Elemento.Rotacion = ckRotacion.Checked ? true : false;
            Elemento.Activo = ckActivo.Checked ? true : false;

            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            int resultado = 0;
            if (IdElemento == 0)
            {
                resultado = fachadaCore.insertarElemento(Elemento);
                lbId.Text = resultado.ToString();
            }
            else
            {
                SentenciaSQL sql = new SentenciaSQL();
                sql.FiltroBD.Add(new FiltroBD(clsElemento.Campos.Id, IdElemento, FiltroBD.OperadorLogico.igual));
                resultado = fachadaCore.editarElemento(Elemento, sql);
            }
        }
예제 #2
0
        public void registarDatos()
        {
            clsTipoDocumento TipoDocumento = new clsTipoDocumento();
            TipoDocumento.Nombre = txtNombre.Text;
            Int64 valorConsecutivo = 0;
            Int64.TryParse(txtConsecutivo.Text, out valorConsecutivo);
            TipoDocumento.Consecutivo = valorConsecutivo;
            TipoDocumento.Activo = ckActivo.Checked ? true : false;
            TipoDocumento.Operacion = txtOperacion.Text;

            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            int resultado = 0;
            if (IdTipoDocumento == 0)
            {
                resultado = fachadaCore.insertarTipoDocumento(TipoDocumento);
                lbId.Text = resultado.ToString();
            }
            else
            {
                SentenciaSQL sql = new SentenciaSQL();
                sql.FiltroBD.Add(new FiltroBD(clsTipoDocumento.Campos.Id, IdTipoDocumento, FiltroBD.OperadorLogico.igual));
                resultado = fachadaCore.editarTipoDocumento(TipoDocumento, sql);
            }
        }
예제 #3
0
 public DataTable datatableConsultar(SentenciaSQL sql)
 {
     DataTable datos = new DataTable();
     string SentenciaSQL = "";
     SentenciaSQL = construirSelect() + CondicionSQL(sql);
     datos = EjecutorBaseDatos.obtenerConsulta(SentenciaSQL);
     return datos;
 }
예제 #4
0
 public int Editar(clsMenuRol obj, SentenciaSQL sql)
 {
     int resultado = 0;
     EjecutorBaseDatos.limpiarParametros();
     string sentenciaSQL = construirUpdate(obj) + CondicionSQL(sql);
     resultado = EjecutorBaseDatos.ejecutarSentencia(sentenciaSQL);
     return resultado;
 }
예제 #5
0
        private DataTable obtenerDatos()
        {
            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaSeg = new clsFachadaSAFcore(ref ejecutor);

            SentenciaSQL sql = new SentenciaSQL();
            DataTable datos = fachadaSeg.consultarDatosBodega(sql);
            Session["Datos" + nombreForm] = datos;
            return datos;
        }
예제 #6
0
        public clsMenu Consultar(SentenciaSQL sql)
        {
            DataTable datos = new DataTable();
            clsFabricaMenu fab = new clsFabricaMenu();

            string SentenciaSQL = "";
            SentenciaSQL = construirSelect() + CondicionSQL(sql);
            datos = EjecutorBaseDatos.obtenerConsulta(SentenciaSQL);
            return fab.CrearObjeto(datos);
        }
예제 #7
0
        private DataTable obtenerDatoCiudad()
        {
            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaSeg = new clsFachadaSAFcore(ref ejecutor);

            SentenciaSQL sql = new SentenciaSQL();
            sql.FiltroBD.Add(new FiltroBD(clsCiudad.Campos.Activo, true, FiltroBD.OperadorLogico.igual));
            DataTable datos = fachadaSeg.consultarDatosCiudad(sql);
            Session["DatosCiudad" + nombreForm] = datos;
            return datos;
        }
예제 #8
0
        public clsMenuRol Consultar(SentenciaSQL sql)
        {
            DataTable datos = new DataTable();
            clsFabricaMenuRol fab = new clsFabricaMenuRol();

            string sentenciaSQL = "";
            EjecutorBaseDatos.limpiarParametros();
            sentenciaSQL = construirSelect() + CondicionSQL(sql);
            datos = EjecutorBaseDatos.obtenerConsulta(sentenciaSQL);
            return fab.CrearObjeto(datos);
        }
예제 #9
0
        protected void eliminarDatos(OrderedDictionary keys)
        {
            clsDetalleDocumento DetalleDocumento = new clsDetalleDocumento();
            DetalleDocumento.Id = keys["Id"] as int?;

            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            int resultado = 0;

            SentenciaSQL sql = new SentenciaSQL();
            sql.FiltroBD.Add(new FiltroBD(clsDetalleDocumento.Campos.Id, DetalleDocumento.Id, FiltroBD.OperadorLogico.igual));
            resultado = fachadaCore.eliminarDetalleDocumento(DetalleDocumento, sql);

            Session["Datos" + nombreForm] = null;
            gvDatos.DataBind();
        }
예제 #10
0
        public void registarDatos()
        {
            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            clsCliente Cliente = new clsCliente();
            if (cbidCiudad.SelectedItem != null)
                Cliente.idCiudad = Convert.ToInt16(cbidCiudad.Value);
            else
            {
                if(cbidCiudad.Text != string.Empty)
                {
                    clsCiudad Ciudad = new clsCiudad();
                    Ciudad.Nombre = cbidCiudad.Text;
                    Ciudad.Activo = true;
                    Cliente.idCiudad = (short)fachadaCore.insertarCiudad(Ciudad);
                }
            }

            Cliente.Identificacion = txtIdentificacion.Text;
            Cliente.Nombre1 = txtNombre1.Text;
            Cliente.Nombre2 = txtNombre2.Text;
            Cliente.Apellido1 = txtApellido1.Text;
            Cliente.Apellido2 = txtApellido2.Text;
            Cliente.Direccion = txtDireccion.Text;
            Cliente.Telefono = txtTelefono.Text;
            Cliente.Celular = txtCelular.Text;
            Cliente.Correo = txtCorreo.Text;
            Cliente.Activo = ckActivo.Checked ? true : false;

            int resultado = 0;
            if (IdCliente == 0)
            {
                resultado = fachadaCore.insertarCliente(Cliente);
                lbId.Text = resultado.ToString();
            }
            else
            {
                SentenciaSQL sql = new SentenciaSQL();
                sql.FiltroBD.Add(new FiltroBD(clsCliente.Campos.Id, IdCliente, FiltroBD.OperadorLogico.igual));
                resultado = fachadaCore.editarCliente(Cliente, sql);
            }
        }
예제 #11
0
        public void registarDatos()
        {
            clsDocumento Documento = new clsDocumento();
            if (cbidTipoDocumento.Value != null)
                Documento.idTipoDocumento = Convert.ToByte(cbidTipoDocumento.Value);
            if (txtFecha.Date != DateTime.MinValue)
                Documento.Fecha = txtFecha.Date;
            Documento.Descripcion = txtDescripcion.Text;
            Documento.Anulado = ckAnulado.Checked ? true : false;

            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            int resultado = 0;
            if (IdDocumento == 0)
            {
                SentenciaSQL sql = new SentenciaSQL();
                sql.FiltroBD.Add(new FiltroBD(clsTipoDocumento.Campos.Id, Documento.idTipoDocumento, FiltroBD.OperadorLogico.igual));
                clsTipoDocumento tipoDocumento = fachadaCore.consultarEntidadTipoDocumento(sql);

                int numero = 0;
                int.TryParse(tipoDocumento.Consecutivo.ToString(), out numero);
                Documento.Numero = numero;

                resultado = fachadaCore.insertarDocumento(Documento);
                if (resultado > 0)
                {
                    txtNumero.Text = Documento.Numero.ToString();
                    lbId.Text = resultado.ToString();

                    tipoDocumento.Id = null;
                    tipoDocumento.Consecutivo += 1;
                    resultado = fachadaCore.editarTipoDocumento(tipoDocumento, sql);
                }
            }
            else
            {
                SentenciaSQL sql = new SentenciaSQL();
                sql.FiltroBD.Add(new FiltroBD(clsDocumento.Campos.Id, IdDocumento, FiltroBD.OperadorLogico.igual));
                resultado = fachadaCore.editarDocumento(Documento, sql);
            }
        }
예제 #12
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var ejecutor = (Comandos)Session["ejecutorBDSAFseg"];
                var fachadaSeg = new clsFachadaSAFSegAdicional(ref ejecutor);
                var rol = (clsRol)Session["UsuarioRol"];

                SentenciaSQL sql = new SentenciaSQL();
                sql.FiltroBD.Add(new FiltroBD(clsMenuRol.Campos.idrol, rol.Id, FiltroBD.OperadorLogico.igual));
                sql.FiltroBD.Add(new FiltroBD(clsMenu.Campos.idmenunivel1, 0, FiltroBD.OperadorLogico.igual));
                sql.OrdenBD.Add(clsMenu.Campos.orden);
                List<clsMenu> menu = fachadaSeg.consultarListaMenuRol(sql);
                if (menu != null)
                {
                    foreach (var item in menu)
                        Menu.Items.Add(item.Nombre, "ID" + item.Id, "", item.Url);
                }
            }
        }
예제 #13
0
파일: login.ascx.cs 프로젝트: kenchic/SAF
        protected void btnIngresar_Click(object sender, EventArgs e)
        {
            var ejecutor = (Comandos)Session["ejecutorBDSAFseg"];
            var fachadaSeg = new clsFachadaSAFseg(ref ejecutor);

            SentenciaSQL sql = new SentenciaSQL();
            sql.FiltroBD.Add(new FiltroBD(clsUsuario.Campos.usuario, inpUsuario.Value, FiltroBD.OperadorLogico.igual));
            sql.FiltroBD.Add(new FiltroBD(clsUsuario.Campos.clave, inpClave.Value, FiltroBD.OperadorLogico.igual));
            var usuario = fachadaSeg.consultarEntidadUsuario(sql);
            if (usuario != null)
            {
                Session["Usuario"] = usuario;

                sql = new SentenciaSQL();
                sql.FiltroBD.Add(new FiltroBD(clsRol.Campos.id, usuario.idRol, FiltroBD.OperadorLogico.igual));
                var rol = fachadaSeg.consultarEntidadRol(sql);

                Session["UsuarioRol"] = rol;
                Response.Redirect("~/sistema/frmPrincipal.aspx");
            }
        }
예제 #14
0
        public void registarDatos()
        {
            clsCiudad Ciudad = new clsCiudad();
            Ciudad.Nombre = txtNombre.Text;
            Ciudad.Activo = ckActivo.Checked ? true : false;

            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            int resultado = 0;
            if (IdCiudad == 0)
            {
                resultado = fachadaCore.insertarCiudad(Ciudad);
                lbId.Text = resultado.ToString();
            }
            else
            {
                SentenciaSQL sql = new SentenciaSQL();
                sql.FiltroBD.Add(new FiltroBD(clsCiudad.Campos.Id, IdCiudad, FiltroBD.OperadorLogico.igual));
                resultado = fachadaCore.editarCiudad(Ciudad, sql);
            }
        }
예제 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request["ModuloID"] != null)
                {
                    var idModulo = Request["ModuloID"];
                    var ejecutor = (Comandos)Session["ejecutorBDSAFseg"];
                    var fachadaSeg = new clsFachadaSAFSegAdicional(ref ejecutor);
                    var rol = (clsRol)Session["UsuarioRol"];

                    SentenciaSQL sql = new SentenciaSQL();
                    sql.FiltroBD.Add(new FiltroBD(clsMenuRol.Campos.idrol, rol.Id, FiltroBD.OperadorLogico.igual));
                    sql.FiltroBD.Add(new FiltroBD(clsMenu.Campos.idmenunivel1, idModulo, FiltroBD.OperadorLogico.igual));
                    sql.OrdenBD.Add(clsMenu.Campos.orden);

                    List<clsMenu> menu = fachadaSeg.consultarListaMenuRol(sql);

                    if (menu != null)
                    {
                        var index = -1;
                        var idNivel2 = -1;
                        foreach (var item in menu)
                        {
                            if (item.idMenuNivel2 == 0)
                            {
                                index++;
                                nbMenuModulo.Groups.Add(item.Nombre);
                                idNivel2 = item.idMenuNivel2.Value;
                            }
                            else
                                nbMenuModulo.Groups[index].Items.Add(item.Nombre, "ID" + item.Id, item.Imagen, item.Url);
                        }
                    }
                }
            }
        }
예제 #16
0
        protected void actualizarDatos(OrderedDictionary keys, OrderedDictionary newValues)
        {
            clsDetalleDocumento DetalleDocumento = new clsDetalleDocumento();
            DetalleDocumento.Id = keys["Id"] as int?;
            DetalleDocumento.idElemento = newValues["idElemento"] as short?;
            DetalleDocumento.idDocumento = (int)IdDocumento;
            DetalleDocumento.idBodegaOrigen = newValues["idBodegaOrigen"] as byte?;
            DetalleDocumento.idBodegaDestino = newValues["idBodegaDestino"] as byte?;
            Int32 valorCantidad = 0;
            Int32.TryParse(newValues["Cantidad"].ToString(), out valorCantidad);
            DetalleDocumento.Cantidad = valorCantidad;

            var ejecutor = (Comandos)Session["ejecutorBDSAFcore"];
            var fachadaCore = new clsFachadaSAFcore(ref ejecutor);

            int resultado = 0;

            SentenciaSQL sql = new SentenciaSQL();
            sql.FiltroBD.Add(new FiltroBD(clsDetalleDocumento.Campos.Id, DetalleDocumento.Id, FiltroBD.OperadorLogico.igual));
            resultado = fachadaCore.editarDetalleDocumento(DetalleDocumento, sql);

            Session["Datos" + nombreForm] = null;
            gvDatos.DataBind();
        }
예제 #17
0
 public int editarTipoDocumento(clsTipoDocumento obj, SentenciaSQL sql)
 {
     m_clsTipoDocumentoDALC = new clsTipoDocumentoDALC(m_EjecutorBaseDatos);
     return m_clsTipoDocumentoDALC.Editar(obj, sql);
 }
예제 #18
0
 private string OrdenSQL(SentenciaSQL sql)
 {
     string ordenar = "";
     if (sql.OrdenBD.Count > 0)
     {
         foreach (var orden in sql.OrdenBD)
             ordenar += "," + orden;
         ordenar = " Order By " + ordenar.Substring(1);
     }
     return ordenar;
 }
예제 #19
0
 private string CondicionSQL(SentenciaSQL sql)
 {
     string condicion = "";
     if (sql.FiltroBD.Count > 0)
     {
         foreach (var filtro in sql.FiltroBD)
         {
             EjecutorBaseDatos.agregarParametro(filtro.Campo,filtro.Valor);
             condicion += filtro.Filtro;
         }
         condicion = " Where " + condicion.Substring(4);
     }
     return condicion;
 }
 public int Eliminar(clsDetalleRepDevolucionServicio obj, SentenciaSQL sql)
 {
     int resultado=0;
     EjecutorBaseDatos.limpiarParametros();
     string sentenciaSQL = construirDelete() + CondicionSQL(sql);
     resultado = EjecutorBaseDatos.ejecutarSentencia(sentenciaSQL);
     return resultado;
 }
        public List<clsDetalleRepDevolucionServicio> listConsultar(SentenciaSQL sql)
        {
            DataTable datos = new DataTable();
            clsFabricaDetalleRepDevolucionServicio fab = new clsFabricaDetalleRepDevolucionServicio();

            string sentenciaSQL = "";
            EjecutorBaseDatos.limpiarParametros();
            sentenciaSQL = construirSelect() + CondicionSQL(sql);
            datos = EjecutorBaseDatos.obtenerConsulta(sentenciaSQL);
            return fab.CrearObjetos(datos);
        }
예제 #22
0
 public int eliminarDetalleVenta(clsDetalleVenta obj, SentenciaSQL sql)
 {
     m_clsDetalleVentaDALC = new clsDetalleVentaDALC(m_EjecutorBaseDatos);
     return m_clsDetalleVentaDALC.Eliminar(obj, sql);
 }
예제 #23
0
 public List<clsDetalleVenta> consultarListaDetalleVenta(SentenciaSQL sql)
 {
     m_clsDetalleVentaDALC = new clsDetalleVentaDALC(m_EjecutorBaseDatos);
     return m_clsDetalleVentaDALC.listConsultar(sql);
 }
예제 #24
0
 public clsDetalleVenta consultarEntidadDetalleVenta(SentenciaSQL sql)
 {
     m_clsDetalleVentaDALC = new clsDetalleVentaDALC(m_EjecutorBaseDatos);
     return m_clsDetalleVentaDALC.Consultar(sql);
 }
예제 #25
0
 public DataTable consultarDatosDetalleVenta(SentenciaSQL sql)
 {
     m_clsDetalleVentaDALC = new clsDetalleVentaDALC(m_EjecutorBaseDatos);
     return m_clsDetalleVentaDALC.datatableConsultar(sql);
 }
예제 #26
0
 public int eliminarElemento(clsElemento obj, SentenciaSQL sql)
 {
     m_clsElementoDALC = new clsElementoDALC(m_EjecutorBaseDatos);
     return m_clsElementoDALC.Eliminar(obj, sql);
 }
예제 #27
0
 public List<clsElemento> consultarListaElemento(SentenciaSQL sql)
 {
     m_clsElementoDALC = new clsElementoDALC(m_EjecutorBaseDatos);
     return m_clsElementoDALC.listConsultar(sql);
 }
예제 #28
0
 public clsElemento consultarEntidadElemento(SentenciaSQL sql)
 {
     m_clsElementoDALC = new clsElementoDALC(m_EjecutorBaseDatos);
     return m_clsElementoDALC.Consultar(sql);
 }
예제 #29
0
 public int Eliminar(clsMenuRol obj, SentenciaSQL sql)
 {
     int resultado=0;
     EjecutorBaseDatos.limpiarParametros();
     return resultado;
 }
예제 #30
0
 public DataTable consultarDatosElemento(SentenciaSQL sql)
 {
     m_clsElementoDALC = new clsElementoDALC(m_EjecutorBaseDatos);
     return m_clsElementoDALC.datatableConsultar(sql);
 }