Esempio n. 1
0
 public OrdenCompra(int pidOrdenCpra, DateTime pfechaHora, float pmontoT, Empleado plegEC)
 {
     idOrdenCpra = pidOrdenCpra;
     fechaHora = pfechaHora;
     montoTotal = pmontoT;
     legajoEncargCpra = plegEC;
 }
Esempio n. 2
0
        protected void btnGuardar_Click(object sender, EventArgs e)
        {
            Empleado oEmpleado = new Empleado();
            oEmpleado.Apellido = txtApellido.Text;
            oEmpleado.Nombre = txtNombre.Text;
            oEmpleado.Dni = Convert.ToInt64(txtDni.Text);
            oEmpleado.FechaAlta = Convert.ToDateTime(txtFechaAlta.Text.Trim());
            oEmpleado.FechaBaja = txtFechaBaja.Text.Trim() != String.Empty ? Convert.ToDateTime(txtFechaBaja.Text.Trim()) : (DateTime?)null;
            oEmpleado.FechaNac = txtFechaNac.Text.Trim() != String.Empty ? Convert.ToDateTime(txtFechaNac.Text.Trim()) : (DateTime?)null;
            oEmpleado.Legajo = Convert.ToInt64(txtLegajo.Text);

            Usuario oUsuario = new Usuario();
            oUsuario.Id_rol = Convert.ToInt32(ddlRol.SelectedItem.Value);
            oUsuario.Legajo = Convert.ToInt64(txtLegajo.Text);
            oUsuario.Id_usuario = txtUsuario.Text;
            oUsuario.Hashed_password = txtPassword.Text;
            oUsuario.Id_cliente = null;

            if (Page.IsValid)
            {
                if (hdfOperacion.Value == Operacion.Insert.ToString())
                {
                    Insert(oEmpleado, oUsuario);
                }
                if (hdfOperacion.Value == Operacion.Update.ToString())
                {
                    Updadte(oEmpleado, oUsuario);
                }
                hdfOperacion.Value = Operacion.None.ToString();
                CargarGrilla();
                ClickGuardar();
            }
        }
Esempio n. 3
0
 public PedidoProduccion(int pidPedidoProd, int pcantTareas, float pmontoTotal, DateTime pfechaHora, Cliente pidCliente, Empleado plegajo)
 {
     idPedidoProd = pidPedidoProd;
     cantTareas = pcantTareas;
     montoTotal = pmontoTotal;
     fechaHora = pfechaHora;
     idCliente = pidCliente;
     legajo = plegajo;
 }
 public AsignacionProduccion(int pidAsignacion, int pduracion, int pcantidad, DateTime pfechaHora, 
     Empleado plegajoE, Empleado plegajoEA, EstadoAsignacion pidEstado)
 {
     idAsignacion = pidAsignacion;
     duracion = pduracion;
     cantidad = pcantidad;
     fechaHora = pfechaHora;
     legajoEjecutor = plegajoE;
     legajoEncargadoAsignacion = plegajoEA;
     idEstado = pidEstado;
 }
Esempio n. 5
0
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            Empleado oEmpleado = new Empleado();
            oEmpleado.Apellido = txtApellido.Text;
            oEmpleado.Nombre = txtNombre.Text;
            oEmpleado.Dni = txtDni.Text.Trim() != String.Empty ? Convert.ToInt64(txtDni.Text.Trim()) : (Int64?)null;
            oEmpleado.FechaAlta = txtFechaAlta.Text.Trim() != String.Empty ? Convert.ToDateTime(txtFechaAlta.Text.Trim()) : (DateTime?)null;
            oEmpleado.FechaBaja = txtFechaBaja.Text.Trim() != String.Empty ? Convert.ToDateTime(txtFechaBaja.Text.Trim()) : (DateTime?)null;
            oEmpleado.FechaNac = txtFechaNac.Text.Trim() != String.Empty ? Convert.ToDateTime(txtFechaNac.Text.Trim()) : (DateTime?)null;
            oEmpleado.Legajo = txtLegajo.Text.Trim() != String.Empty ? Convert.ToInt64(txtLegajo.Text.Trim()) : (Int64?)null;

            gvEmpleados.DataSource = EmpleadoDAO.GetByParam(oEmpleado);
            gvEmpleados.DataBind();
        }
Esempio n. 6
0
 private void Updadte(Empleado oEmpleado, Usuario oUsuario)
 {
     UsuarioDAO.Update(oUsuario);
     EmpleadoDAO.Update(oEmpleado);
 }
Esempio n. 7
0
 private void Insert(Empleado oEmpleado, Usuario oUsuario)
 {
     EmpleadoDAO.Insert(oEmpleado);
     UsuarioDAO.Insert(oUsuario);
 }
Esempio n. 8
0
        protected void gvEmpleados_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            // get the row index stored in the CommandArgument property
            int index = Convert.ToInt32(e.CommandArgument);

            // get the GridViewRow where the command is raised
            GridViewRow selectedRow = ((GridView)e.CommandSource).Rows[index];

            if (e.CommandName == "Select")
            {
                // for bound fields, values are stored in the Text property of Cells [ fieldIndex ]
                txtNombre.Text = selectedRow.Cells[0].Text;
                txtApellido.Text = selectedRow.Cells[1].Text;
                txtDni.Text = selectedRow.Cells[2].Text;
                txtFechaNac.Text = Server.HtmlDecode(selectedRow.Cells[3].Text);
                txtLegajo.Text = selectedRow.Cells[4].Text;
                txtFechaAlta.Text = Server.HtmlDecode(selectedRow.Cells[5].Text);
                txtFechaBaja.Text = Server.HtmlDecode(selectedRow.Cells[6].Text);
                txtUsuario.Text = Server.HtmlDecode(selectedRow.Cells[7].Text);
                txtFechaBaja.Text = String.Format("{0:dd/MM/yyyy}", gvEmpleados.DataKeys[index]["FechaBaja"]);
                txtPassword.Text = gvEmpleados.DataKeys[index]["hashed_password"].ToString();
                DataSet ds = EmpleadoDAO.GetRolEmpleado(txtUsuario.Text);

                ddlRol.SelectedValue = ds.Tables[0].Rows[0]["id_rol"].ToString();
                ClickModificar();
            }
            if (e.CommandName == "Delete")
            {
                int legajo = Convert.ToInt32(selectedRow.Cells[4].Text);
                Empleado oEmpleado = new Empleado();
                oEmpleado.Legajo = legajo;
                //Le paso el id_usuario
                UsuarioDAO.Delete(selectedRow.Cells[7].Text);
                EmpleadoDAO.Delete(oEmpleado);
                CargarGrilla();
            }
        }
Esempio n. 9
0
        public void MyTestInitialize()
        {
            empleado = new Empleado();
            empleado.Apellido = "Perez";

            empleado.FechaAlta = DateTime.Now;
            empleado.FechaNac = DateTime.Now;

            empleado.Legajo = 153;
            empleado.Nombre = "Carlitos";
            //empleado.NroDoc = 10;
        }