void CargarDataDetalle(String idDetalleCita, String idServicio)
        {
            DataSet data = AtencionPeluqueriaBuss.BuscarCitaDetalleEmpleados(idDetalleCita, idServicio);

            if (idDetalleCita != "0")
            {
                if (data.Tables[0].Rows.Count > 0)
                {
                    Utilidades.CargaCombo(ref cboSector, AtencionPeluqueriaBuss.GetSectores(idServicio), "idSector", "descripcion", true);
                    Utilidades.CargaCombo(ref cboRol, AtencionPeluqueriaBuss.GetRoles(idServicio), "idRol", "descripcion", true);
                    cboSector.SelectedValue = data.Tables[0].Rows[0]["idSector"].ToString();
                }  //detalle

                EmpleadosAsig = new DataTable();
                EmpleadosAsig.Columns.Add("idEmpleado");
                EmpleadosAsig.Columns.Add("nombreEmpleado");
                EmpleadosAsig.Columns.Add("idServicio");
                DataTable EmpleadosTotal = data.Tables[1];
                if (EmpleadosTotal != null)
                {
                    foreach (DataRow dr in EmpleadosTotal.Select("idServicio=" + idServicio))
                    {
                        DataRow dr1 = EmpleadosAsig.NewRow();
                        dr1[0] = dr[0];
                        dr1[1] = dr[1];
                        dr1[2] = dr[2];
                        EmpleadosAsig.Rows.Add(dr1);
                    }
                }
                this.gvEmpleadosAsig.DataSource = EmpleadosAsig;
                this.gvEmpleadosAsig.DataBind();
            }
        }
        void CargarEmpleados()
        {
            List <Empleado> lstEmpleados = new List <Empleado>();
            String          Citasstr     = "";

            Citasstr = idCitaA.Value;
            foreach (GridViewRow gvRow in grvresultado.Rows)
            {
                Int32    rowIndex = gvRow.RowIndex;
                String   val      = (string)grvresultado.DataKeys[rowIndex]["DescripcionCita"];
                Int32    idCita   = (Int32)grvresultado.DataKeys[rowIndex]["idCita"];
                CheckBox hdnCheck = (CheckBox)gvRow.Cells[0].FindControl("chkAsignacion");
                if (hdnCheck.Checked)
                {
                    Citasstr = Citasstr + ";" + idCita.ToString();
                }
            }

            DataTable Empleados = AtencionPeluqueriaBuss.BuscarEmpleados(cboRol.SelectedValue, Citasstr);

            foreach (DataRow dr in Empleados.Rows)
            {
                if (EmpleadosAsig.AsEnumerable().Where(c => c.Field <string>("nombreEmpleado").Equals(dr["nombreEmpleado"])).Count() == 0)
                {
                    Empleado obj = new Empleado();
                    obj.idEmpleado     = Int32.Parse(dr["idEmpleado"].ToString());
                    obj.nombreEmpleado = dr["nombreEmpleado"].ToString();
                    lstEmpleados.Add(obj);
                }
            }
            gvEmpleados.DataSource = lstEmpleados;
            gvEmpleados.DataBind();
            gvEmpleadosAsig.DataSource = EmpleadosAsig;
            gvEmpleadosAsig.DataBind();
        }
Beispiel #3
0
 void CargarCombos()
 {
     Utilidades.CargaCombo(ref cboGrafico1, AtencionPeluqueriaBuss.GetServicio(), Utilitario.Comun.Dominios.IdServicio, Utilitario.Comun.Dominios.DescripcionServicio, true);
     Utilidades.CargaCombo(ref cbografico4, AtencionPeluqueriaBuss.GetRoles("0"), Utilitario.Comun.Dominios.IdRol, Utilitario.Comun.Dominios.DescripcionRol, true);
     Utilidades.CargaCombo(ref filtroservicio, AtencionPeluqueriaBuss.GetServicio(), Utilitario.Comun.Dominios.IdServicio, Utilitario.Comun.Dominios.DescripcionServicio, true);
     Utilidades.CargaCombo(ref cboGrafico2, AtencionPeluqueriaBuss.GetServicio(), Utilitario.Comun.Dominios.IdServicio, Utilitario.Comun.Dominios.DescripcionServicio, true);
 }
        void CargarDataDetalle(Int32 idCita)
        {
            Session["idCitaDetalle"] = idCita.ToString();
            DataSet data = AtencionPeluqueriaBuss.BuscarCitaDetalleCompleto(idCita);

            if (idCita != 0)
            {
                if (data.Tables[0].Rows.Count > 0)
                {
                    txtCodigo.Text        = data.Tables[0].Rows[0]["NroCita"].ToString();
                    txtFechaCita.Text     = data.Tables[0].Rows[0]["fechaCita"].ToString();
                    txtHoraCita.Text      = data.Tables[0].Rows[0]["horaCita"].ToString();
                    txtnombrecliente.Text = data.Tables[0].Rows[0]["Cliente"].ToString();
                    txtEstado.Text        = data.Tables[0].Rows[0]["Estado"].ToString();

                    txtnombreMascota.Text  = data.Tables[0].Rows[0]["nombreMascota"].ToString();
                    txtEspecieMascota.Text = data.Tables[0].Rows[0]["descripcionEspecie"].ToString();
                    txtRazaMascota.Text    = data.Tables[0].Rows[0]["nombreRaza"].ToString();
                    txtTamanioMascota.Text = data.Tables[0].Rows[0]["Tamanio"].ToString();
                    txtGeneroMascota.Text  = data.Tables[0].Rows[0]["Sexo"].ToString();
                    txtEdadMascota.Text    = data.Tables[0].Rows[0]["Edad"].ToString();
                }  //detalle


                Servicios        = data.Tables[1];
                EmpleadosDetalle = data.Tables[2];

                this.grvresultadodet.DataSource = OrdenarServicios(Servicios, EmpleadosDetalle);
                this.grvresultadodet.DataBind();
            }
        }
Beispiel #5
0
        private void ListarHojas()
        {
            HojaServicio hoja = new HojaServicio();

            hoja.NumHojaServicio = Utilidades.ToInt(txtNumeroHoja.Text);
            hoja.idServicio      = Utilidades.ToInt(cboservicio.SelectedValue);
            hoja.FechaInicial    = txtfechaInicio.Text;
            hoja.FechaFinal      = txtFechaFin.Text;
            hoja.idCliente       = Utilidades.ToInt(txtcodigocliente.Text);
            hoja.NombreCliente   = txtnombrecliente.Text;

            DataTable data = AtencionPeluqueriaBuss.BusquedaHojaServicio(hoja);

            if (data.Rows.Count == 0)
            {
                lblmsg.Text = "Sin registros para mostrar";
            }
            else
            {
                lblmsg.Text = "";
            }

            this.grvresultado.DataSource = data;
            this.grvresultado.DataBind();
        }
        void CargarDetalle2()
        {
            DataTable Data2 = AtencionPeluqueriaBuss.BuscarMateriales(Int32.Parse(cboAlmacenV.SelectedValue), txtFechaMovHasta.Text, "");

            grvresultado2.DataSource = Data2;
            grvresultado2.DataBind();
        }
        void CargarDataDetalle3(Int32 idMovimiento)
        {
            DataTable Data2 = AtencionPeluqueriaBuss.BuscarMovimientosAtencion(idMovimiento);

            grvresultado3.DataSource = Data2;
            grvresultado3.DataBind();
        }
Beispiel #8
0
        protected void grvIngresoMateriales_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Anular")
            {
                try
                {
                    int         Idkardex  = Utilidades.ToInt(e.CommandArgument.ToString());
                    GridViewRow Gvr       = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;
                    int         FilaIndex = Gvr.RowIndex;

                    KardexMaterial kardex = new KardexMaterial()
                    {
                        IdKardexMaterial = Idkardex
                    };
                    AtencionPeluqueriaBuss.GrabarKardexMaterial(kardex, 2);
                    ListarKardex();
                }
                catch (Exception ex)
                {
                    msgError.Clear();
                    msgError.AppendLine("Fecha:" + DateTime.Now.ToString());
                    msgError.AppendLine("Descripción:" + ex.Message);
                    msgError.AppendLine("Detalle:" + ex.StackTrace);
                    log.Error(msgError.ToString());
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "$.growl.warning({ title: 'Mensaje Sistema', message: 'Error interno del sistema contacte con su administrador.'});", true);
                }
            }
        }
        void CargarDetalle()
        {
            DataTable Data = AtencionPeluqueriaBuss.BuscarServicioHoy(0, txtfechaIni.Text, txtFechaFinal.Text);

            grvresultado.DataSource = Data;
            grvresultado.DataBind();
        }
        void CargarDetalleSector()
        {
            DataTable Data = AtencionPeluqueriaBuss.BuscarSector(0, txtfechaIni.Text, txtFechaFinal.Text, cboRecurso.SelectedValue, cboEstado.SelectedValue);

            grvresultado2.DataSource = Data;
            grvresultado2.DataBind();
        }
        void CargarDataDetalle(Int32 idMaterial, Int32 tipo)
        {
            DataTable Data2 = AtencionPeluqueriaBuss.BuscarMaterialesMovimiento(idMaterial);

            gvMaterialesV.DataSource = Data2;
            gvMaterialesV.DataBind();
        }
        void CargarDetalle()
        {
            DataTable Data = AtencionPeluqueriaBuss.BuscarMovimientos(Int32.Parse(cboAlmacen.SelectedValue), txtfechaIni.Text, txtFechaFinal.Text, "0", "0", cboEstado.SelectedValue, txtNumReq.Text);

            grvresultado.DataSource = Data;
            grvresultado.DataBind();
        }
 private void CargarCombo()
 {
     Utilidades.CargaCombo(ref cboAlmacenV, AtencionPeluqueriaBuss.GetAlmacen(), Utilitario.Comun.Dominios.IdAlmacen, Utilitario.Comun.Dominios.DescripcionAlmacen, true);
     Utilidades.CargaCombo(ref cboAlmacen, AtencionPeluqueriaBuss.GetAlmacen(), Utilitario.Comun.Dominios.IdAlmacen, Utilitario.Comun.Dominios.DescripcionAlmacen, true);
     Utilidades.CargaCombo(ref cboTipo, AtencionPeluqueriaBuss.GetParametros("013"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);
     Utilidades.CargaCombo(ref cboEstado, AtencionPeluqueriaBuss.GetParametros("011"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);
     Utilidades.CargaCombo(ref cboTipoReq, AtencionPeluqueriaBuss.GetParametros("013"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);
 }
        protected void combobox_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                foreach (GridViewRow gvRow in gvMateriales.Rows)
                {
                    Int32   rowIndex    = gvRow.RowIndex;
                    Int32   idMaterial  = (Int32)gvMateriales.DataKeys[rowIndex]["IdMaterial"];
                    TextBox txtCantidad = (TextBox)gvRow.Cells[0].FindControl("txtCantidad");

                    DataRow Dr = DtMateriales.Select("IdMaterial=" + idMaterial.ToString())[0];
                    Dr[4] = txtCantidad.Text;
                }

                if (DtMateriales.Select("IdMaterial=" + combobox.SelectedValue).Count() == 0)
                {
                    DataTable Ds = AtencionPeluqueriaBuss.BuscarMaterialesxCodigo(Int32.Parse(combobox.SelectedValue), Int32.Parse(idAlmacen.Value));

                    DataRow Dr = DtMateriales.NewRow();

                    if (Ds.Rows.Count > 0)
                    {
                        Dr[0] = Ds.Rows[0]["IdMaterial"].ToString();
                        Dr[1] = Ds.Rows[0]["material"].ToString();
                        Dr[2] = Ds.Rows[0]["descripcion"].ToString();
                        Dr[3] = Ds.Rows[0]["umedida"].ToString();
                        Dr[4] = Ds.Rows[0]["Cantidad"].ToString();
                        Dr[5] = Ds.Rows[0]["Precio"].ToString();
                        Dr[6] = "0";
                        DtMateriales.Rows.Add(Dr);
                    }


                    gvMateriales.DataSource = DtMateriales;
                    gvMateriales.DataBind();
                }
                else
                {
                    lblModalValTitle.Text = "Error";
                    lblVal.Text           = "El material ya fue ingresado;";
                    lblVal.ForeColor      = System.Drawing.Color.Red;
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModalVal", "$('#myModalVal').modal();", true);
                    upModalVal.Update();
                }
                combobox.SelectedValue = "0";
            }
            catch (Exception ex)
            {
                msgError.Clear();
                msgError.AppendLine("Fecha:" + DateTime.Now.ToString());
                msgError.AppendLine("Descripción:" + ex.Message);
                msgError.AppendLine("Detalle:" + ex.StackTrace);
                log.Error(msgError.ToString());
            }
        }
Beispiel #15
0
 protected void grvResultadoPopup_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         DropDownList ddl = e.Row.FindControl("cboEmpleadoServ") as DropDownList;
         if (ddl != null)
         {
             Utilidades.CargaCombo(ref ddl, AtencionPeluqueriaBuss.GetEmpleados(), "idEmpleado", "nombres", true);
         }
     }
 }
        void CargarDataDetalle(Int32 idHojaServicio, Int32 tipo)
        {
            idTipo.Value = tipo.ToString();
            DataSet Data = AtencionPeluqueriaBuss.BuscarServicioDetalle(idHojaServicio);

            if (tipo == 0)
            {
                btnEjecutar.Visible  = false;
                btnGuardarP.Visible  = false;
                txtComent.Visible    = false;
                btnSend.Visible      = false;
                gvMateriales.Enabled = false;
                txtComent.Rows       = 6;
            }
            else if (tipo == 1)
            {
                btnEjecutar.Visible  = true;
                btnGuardarP.Visible  = false;
                txtComent.Visible    = true;
                btnSend.Visible      = false;
                gvMateriales.Enabled = true;
                txtComent.Rows       = 2;
            }
            else
            {
                btnEjecutar.Visible  = false;
                btnGuardarP.Visible  = true;
                txtComent.Visible    = true;
                txtComent.Rows       = 1;
                btnSend.Visible      = false;
                gvMateriales.Enabled = true;
            }
            if (Data.Tables[0].Rows.Count > 0)
            {
                imgMascota.ImageUrl = Data.Tables[0].Rows[0]["Foto"].ToString();

                txtNombreMascota.Text  = Data.Tables[0].Rows[0]["nombreMascota"].ToString();
                txtEspecieMascota.Text = Data.Tables[0].Rows[0]["especieMascota"].ToString();
                txtRazaMascota.Text    = Data.Tables[0].Rows[0]["razaMascota"].ToString();
                txtAlertas.Text        = Data.Tables[0].Rows[0]["observaciones"].ToString();
                txtEstado.Text         = Data.Tables[0].Rows[0]["estado"].ToString();
                txtServicio.Text       = Data.Tables[0].Rows[0]["Servicio"].ToString();
                lblModalPTitle2.Text   = txtServicio.Text;
                gvComents.DataSource   = Data.Tables[2];
                gvComents.DataBind();
                dtComents = Data.Tables[2];

                gvMateriales.DataSource = Data.Tables[1];
                gvMateriales.DataBind();

                gvTracking.DataSource = Data.Tables[3];
                gvTracking.DataBind();
            }  //detalle
        }
        protected void btngrabar_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtnommaterial.Text == string.Empty)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "$.growl.warning({ title: 'Mensaje Sistema', message: 'Primero debe realizar la busqueda del material.'});", true);
                    return;
                }

                int       idmaterial = Utilidades.ToInt(txtcodmaterial.Text);
                DataTable data       = AtencionPeluqueriaBuss.GetDatosMaterial(idmaterial);

                decimal cantidad = Utilidades.ToDecimal(txtcantidad.Text);

                if (cantidad == 0)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "$.growl.warning({ title: 'Mensaje Sistema', message: 'Ingrese la cantidad.'});", true);
                    return;
                }

                if (data.Rows.Count > 0)
                {
                    this.txtnommaterial.Text    = data.Rows[0]["Nombre"].ToString();
                    this.txtDescripciónmat.Text = data.Rows[0]["Descripcion"].ToString();
                    this.txtcategoria.Text      = data.Rows[0]["Categoria"].ToString();
                    this.txtmodelo.Text         = data.Rows[0]["Modelo"].ToString();
                    this.txtundmedida.Text      = data.Rows[0]["UnidadMedida"].ToString();
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "alert('El material para el código ingresado no existe.')", true);
                    limpiarform();
                    return;
                }


                KardexMaterial kardex = new KardexMaterial();

                kardex.FechaMovimiento = txtfecharegistro.Text;
                kardex.Cantidad        = Utilidades.ToDecimal(txtcantidad.Text);
                kardex.PrecioCompra    = Utilidades.ToDecimal(txtpreciocompra.Text);
                kardex.TipoMovimiento  = cboTipoMov.SelectedValue;
                kardex.idMaterial      = Utilidades.ToInt(txtcodmaterial.Text);
                kardex.NumGuia         = txtnumguia.Text.ToUpper();
                AtencionPeluqueriaBuss.GrabarKardexMaterial(kardex, 1);
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "$.growl.warning({ title: 'Mensaje Sistema', message: 'Movimiento de kardex ingresado correctamente.'});", true);
                this.limpiarform();
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "$.growl.warning({ title: 'Mensaje Sistema', message: 'Error interno del sistema.'});", true);
            }
        }
        private void CargarCombos()
        {
            Utilidades.CargaCombo(ref cboRecurso, AtencionPeluqueriaBuss.GetParametrosGEN("Recurso"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);
            Utilidades.CargaCombo(ref cboEstado, AtencionPeluqueriaBuss.GetParametrosGEN("Estado"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);

            Utilidades.CargaCombo(ref cboEstadoCanil, AtencionPeluqueriaBuss.GetParametrosGEN("Estado"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);
            Utilidades.CargaCombo(ref cboTamanioCanil, AtencionPeluqueriaBuss.GetParametrosGEN("TamanioCanil"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);
            Utilidades.CargaCombo(ref cboEspecieCanil, AtencionPeluqueriaBuss.GetParametrosGEN("EspecieCanil"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);

            Utilidades.CargaCombo(ref cboEstadoSector, AtencionPeluqueriaBuss.GetParametrosGEN("Estado"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);
            Utilidades.CargaCombo(ref cboServicioSector, AtencionPeluqueriaBuss.GetParametrosGEN("ServicioSector"), Utilitario.Comun.Dominios.ID, Utilitario.Comun.Dominios.Descripcion, true);
        }
Beispiel #19
0
        protected void btngrabar_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtcodigocliente.Text == string.Empty)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "alert('Debe realizar primero la busqueda de la cita.')", true);
                    return;
                }

                int     idcita = Utilidades.ToInt(txtcodigocita.Text);
                DataSet data   = AtencionPeluqueriaBuss.GetDatosCita(idcita);


                if (data.Tables[0].Rows.Count > 0)
                {
                    txtcodigocliente.Text  = data.Tables[0].Rows[0]["idcliente"].ToString();
                    txtnombrecliente.Text  = data.Tables[0].Rows[0]["NombreCliente"].ToString();
                    txtcodigomascota.Text  = data.Tables[0].Rows[0]["idMascota"].ToString();
                    txtnombremascota.Text  = data.Tables[0].Rows[0]["nombreMascota"].ToString();
                    txtespeciemascota.Text = data.Tables[0].Rows[0]["descripcionEspecie"].ToString();
                    txtedadmascota.Text    = data.Tables[0].Rows[0]["Edad"].ToString();
                    txtsexomascota.Text    = data.Tables[0].Rows[0]["DscSexoMascota"].ToString();
                    txttamañomascota.Text  = data.Tables[0].Rows[0]["tamaño"].ToString();

                    //detalle

                    this.grvresultado.DataSource = data.Tables[1];
                    this.grvresultado.DataBind();
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "alert('La cita para el código ingresado no existe, o no esta pendiente.')", true);
                    return;
                }

                HojaServicio hoja = new HojaServicio();
                hoja.idEmpleado      = 1;
                hoja.FechaEmision    = txtfecharegistro.Text;
                hoja.NumHojaServicio = 0;
                hoja.Canil           = cbojaula.SelectedValue;
                hoja.idCita          = Utilidades.ToInt(txtcodigocita.Text);
                hoja.Observaciones   = txtobservaciones.Text.ToUpper();
                AtencionPeluqueriaBuss.GrabarHojaServicio(hoja, null, 1);
                Response.Redirect("ActualizarHojaServicio.aspx");
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "$.growl.warning({ title: 'Mensaje Sistema', message: 'Error interno del sistema.'});", true);
            }
        }
        void CargarDataDetalleCanil(Int32 idCanil, Int32 tipo)
        {
            DataSet Ds = AtencionPeluqueriaBuss.BuscarCanilDetalle(idCanil);

            txtCodigoCanil.Text = "";
            txtNombreCanil.Text = "";
            cboTamanioCanil.ClearSelection();
            cboEspecieCanil.ClearSelection();
            cboEstadoCanil.ClearSelection();
            txtObservacionesCanil.Text = "";

            if (Ds.Tables[0].Rows.Count > 0)
            {
                txtCodigoCanil.Text           = Ds.Tables[0].Rows[0]["CodigoCanil"].ToString();
                txtNombreCanil.Text           = Ds.Tables[0].Rows[0]["NombreCanil"].ToString();
                cboTamanioCanil.SelectedValue = Ds.Tables[0].Rows[0]["TamanioCanil"].ToString();
                cboEspecieCanil.SelectedValue = Ds.Tables[0].Rows[0]["EspecieCanil"].ToString();
                cboEstadoCanil.SelectedValue  = Ds.Tables[0].Rows[0]["EstadoCanil"].ToString();
                txtObservacionesCanil.Text    = Ds.Tables[0].Rows[0]["ObservacionesCanil"].ToString();
            }

            if (tipo == 0)
            {
                divCodigoCanil.Visible = false;
                cboEspecieCanil.Attributes.Remove("disabled");
                cboEstadoCanil.Attributes.Remove("disabled");
                cboTamanioCanil.Attributes.Remove("disabled");
                txtObservacionesCanil.Attributes.Remove("disabled");
                btnGuardarCanil.Visible = true;
            }
            else
            {
                divCodigoCanil.Visible = true;
                if (tipo == 3)
                {
                    cboEspecieCanil.Attributes.Add("disabled", "disabled");
                    cboEstadoCanil.Attributes.Add("disabled", "disabled");
                    cboTamanioCanil.Attributes.Add("disabled", "disabled");
                    txtObservacionesCanil.Attributes.Add("disabled", "disabled");
                    btnGuardarCanil.Visible = false;
                }
                else
                {
                    cboEspecieCanil.Attributes.Remove("disabled");
                    cboEstadoCanil.Attributes.Remove("disabled");
                    cboTamanioCanil.Attributes.Remove("disabled");
                    txtObservacionesCanil.Attributes.Remove("disabled");
                    btnGuardarCanil.Visible = true;
                }
            }
        }
        private void CargaListado()
        {
            Cita obj = new Cita();

            obj.FechaInicial = txtfechaInicio.Text;
            obj.FechaFinal   = txtFechaFin.Text;
            obj.CodigoEstado = cboEstado.SelectedValue;

            DataTable data = AtencionPeluqueriaBuss.BuscarCita(obj);


            this.grvresultado.DataSource = data;
            this.grvresultado.DataBind();
        }
        protected void btnGuardarP_Click(object sender, EventArgs e)
        {
            if (cboSector.SelectedValue != "0" && cboSector.SelectedValue != "" && gvEmpleadosAsig.Rows.Count > 0)
            {
                String Citasstr = "";
                Citasstr = idCitaP.Value;
                foreach (GridViewRow gvRow in grvresultado.Rows)
                {
                    Int32    rowIndex = gvRow.RowIndex;
                    String   val      = (string)grvresultado.DataKeys[rowIndex]["DescripcionCita"];
                    Int32    idCita   = (Int32)grvresultado.DataKeys[rowIndex]["idCita"];
                    CheckBox hdnCheck = (CheckBox)gvRow.Cells[0].FindControl("chkAsignacion");
                    if (hdnCheck.Checked)
                    {
                        Citasstr = Citasstr + ";" + idCita.ToString();
                    }
                }
                if (AtencionPeluqueriaBuss.GrabarProgramación(Int32.Parse(idServicioP.Value), Citasstr, EmpleadosAsig, Int32.Parse(idDetalleCitaP.Value), Int32.Parse(cboSector.SelectedValue.ToString()), 1, txtMotivoAnulacion.Text))
                {
                    EmpleadosAsig  = new DataTable();
                    Servicios      = new DataTable();
                    EmpleadosTotal = new DataTable();

                    lblMensajeTitulo.Text = "MENSAJE INFORMATIVO";
                    lblMensaje.Text       = "Mensaje informativo: Se procedió a asignar recursos al servicio.";
                    lblMensaje.ForeColor  = System.Drawing.Color.Blue;


                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModalMensaje", "$('#myModalMensaje').modal();", true);
                    upModalMensaje.Update();
                }
                else
                {
                    lblModalValTitle.Text = "ERROR";
                    lblVal.Text           = "Ocurrio un error al grabar. Favor comunicarse con el administrador del sistema.";
                    lblVal.ForeColor      = System.Drawing.Color.Red;
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModalVal", "$('#myModalVal').modal();", true);
                    upModalVal.Update();
                }
            }
            else
            {
                lblModalValTitle.Text = "ERROR";
                lblVal.Text           = "Debe ingresar el Sector y/o por lo menos un empleado.";
                lblVal.ForeColor      = System.Drawing.Color.Red;
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModalVal", "$('#myModalVal').modal();", true);
                upModalVal.Update();
            }
        }
        protected void grvresultado_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes["onclick"] = Page.ClientScript.GetPostBackClientHyperlink(grvresultado, "Select$" + e.Row.RowIndex);
                e.Row.ToolTip = "Ver Detalle";

                GridView gvDetalle = (GridView)e.Row.FindControl("gvDetalle");
                Int32    idCita    = Int32.Parse(grvresultado.DataKeys[e.Row.RowIndex].Values[0].ToString());

                DataSet data = AtencionPeluqueriaBuss.BuscarCitaDetalle(idCita);
                gvDetalle.DataSource = data.Tables[0];
                gvDetalle.DataBind();
            }
        }
        void CargarDataDetalle2(Int32 idMovimiento, Int32 tipo, Int32 almacenID)
        {
            DataSet   Ds    = AtencionPeluqueriaBuss.BuscarMaterialesDispositivo(idMovimiento, almacenID);
            DataTable Data2 = Ds.Tables[0];

            Data2.Columns.Add("SubTotal");
            foreach (DataRow Dr in Data2.Rows)
            {
                Dr[6] = (Decimal.Parse(Dr["Precio"].ToString()) * Decimal.Parse(Dr["Cantidad"].ToString()));
            }



            gvMateriales.DataSource = Data2;
            gvMateriales.DataBind();
            DtMateriales = Data2;

            txtNroReq.Text   = "";
            txtFechaReq.Text = "";
            cboTipoReq.ClearSelection();
            if (Ds.Tables[1].Rows.Count > 0)
            {
                txtNroReq.Text           = Ds.Tables[1].Rows[0]["NroReq"].ToString();
                txtFechaReq.Text         = Ds.Tables[1].Rows[0]["FECHAMOV"].ToString();
                cboTipoReq.SelectedValue = Ds.Tables[1].Rows[0]["TipoMovimiento"].ToString();
                txtSede.Text             = Ds.Tables[1].Rows[0]["Sede"].ToString();
                idAlmacen.Value          = Ds.Tables[1].Rows[0]["IdAlmacen"].ToString();
            }
            if (tipo == 3)
            {
                txtFechaReq.ReadOnly = true;
                txtFechaReq.Attributes.Add("disabled", "disabled");
                cboTipoReq.Attributes.Add("disabled", "disabled");
                divBuscar.Visible    = false;
                gvMateriales.Enabled = false;
                btnGuardarP.Visible  = false;
            }
            else
            {
                txtFechaReq.ReadOnly = false;
                txtFechaReq.Attributes.Remove("disabled");
                cboTipoReq.Attributes.Add("disabled", "disabled");
                divBuscar.Visible    = true;
                gvMateriales.Enabled = true;
                btnGuardarP.Visible  = true;
                Utilidades.CargaCombo(ref combobox, AtencionPeluqueriaBuss.BuscarMaterialesGen(cboTipoReq.SelectedValue), "IdMaterial", "Descripcion", true);
            }
        }
        void CargarDataDetalleSector(Int32 idSector, Int32 tipo)
        {
            DataSet Ds = AtencionPeluqueriaBuss.BuscarSectorDetalle(idSector);

            txtCodigoSector.Text = "";
            txtNombreSector.Text = "";
            cboServicioSector.ClearSelection();
            cboEstadoSector.ClearSelection();
            txtObservacionesSector.Text = "";

            if (Ds.Tables[0].Rows.Count > 0)
            {
                txtCodigoSector.Text            = Ds.Tables[0].Rows[0]["CodigoSector"].ToString();
                txtNombreSector.Text            = Ds.Tables[0].Rows[0]["NombreSector"].ToString();
                cboServicioSector.SelectedValue = Ds.Tables[0].Rows[0]["ServicioSector"].ToString();
                cboEstadoSector.SelectedValue   = Ds.Tables[0].Rows[0]["EstadoSector"].ToString();
                txtObservacionesSector.Text     = Ds.Tables[0].Rows[0]["ObservacionesSector"].ToString();
            }

            if (tipo == 0)
            {
                divCodigoSector.Visible = false;
                cboEstadoSector.Attributes.Remove("disabled");
                cboServicioSector.Attributes.Remove("disabled");
                txtObservacionesSector.Attributes.Remove("disabled");
                btnGuardarSector.Visible = true;
            }
            else
            {
                divCodigoSector.Visible = true;
                if (tipo == 3)
                {
                    cboEstadoSector.Attributes.Add("disabled", "disabled");
                    cboServicioSector.Attributes.Add("disabled", "disabled");
                    txtObservacionesSector.Attributes.Add("disabled", "disabled");
                    btnGuardarSector.Visible = false;
                }
                else
                {
                    cboEstadoSector.Attributes.Remove("disabled");
                    cboServicioSector.Attributes.Remove("disabled");
                    txtObservacionesSector.Attributes.Remove("disabled");
                    btnGuardarSector.Visible = true;
                }
            }
        }
 protected void cboTipoReq_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         Utilidades.CargaCombo(ref combobox, AtencionPeluqueriaBuss.BuscarMaterialesGen(cboTipoReq.SelectedValue), "IdMaterial", "Descripcion", true);
         upModalP.Update();
     }
     catch (Exception ex)
     {
         lblmsg.Text = "Error interno en el sistema contacte a su administrador " + " Detalle:" + ex.Message;
         msgError.Clear();
         msgError.AppendLine("Fecha:" + DateTime.Now.ToString());
         msgError.AppendLine("Descripción:" + ex.Message);
         msgError.AppendLine("Detalle:" + ex.StackTrace);
         log.Error(msgError.ToString());
     }
 }
        protected void btnBuscar_Click(object sender, EventArgs e)
        {
            Cita obj = new Cita();

            obj.CodigoCita    = txtCodigoCita.Text;
            obj.CodigoMascota = txtCodigoMascotaMasc.Text;
            obj.FechaInicial  = txtFechaInicioCita.Text;
            obj.FechaFinal    = txtFechaFinCita.Text;
            obj.CodigoEstado  = cboEstado.SelectedValue;
            obj.Tipo          = 2;


            DataTable data = AtencionPeluqueriaBuss.BuscarCita(obj);


            this.grvresultado.DataSource = data;
            this.grvresultado.DataBind();
        }
        protected void btnBuscarCitaMasc_Click(object sender, EventArgs e)
        {
            Cita obj = new Cita();

            obj.CodigoCliente = txtCodigoClienteMasc.Text;
            obj.Cliente       = txtnombreclienteMasc.Text;
            obj.CodigoMascota = txtCodigoMascotaMasc.Text;
            obj.Mascota       = txtnombreMascotaMasc.Text;
            obj.Tipo          = 2;
            DataTable data = AtencionPeluqueriaBuss.BuscarCita(obj);


            this.grvResultadoMascPopup.DataSource = data;
            this.grvResultadoMascPopup.DataBind();
            lblModalTitleMasc.Text = "Buscar Mascota";
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModalMasc", "$('#myModalMasc').modal();", true);
            upModalMasc.Update();
        }
Beispiel #29
0
        protected void btnbuscarcita_Click(object sender, EventArgs e)
        {
            try
            {
                int idcita = Utilidades.ToInt(txtcodigocita.Text);
                if (idcita > 0)
                {
                    DataSet data = AtencionPeluqueriaBuss.GetDatosCita(idcita);


                    if (data.Tables[0].Rows.Count > 0)
                    {
                        txtcodigocliente.Text  = data.Tables[0].Rows[0]["idcliente"].ToString();
                        txtnombrecliente.Text  = data.Tables[0].Rows[0]["NombreCliente"].ToString();
                        txtcodigomascota.Text  = data.Tables[0].Rows[0]["idMascota"].ToString();
                        txtnombremascota.Text  = data.Tables[0].Rows[0]["nombreMascota"].ToString();
                        txtespeciemascota.Text = data.Tables[0].Rows[0]["descripcionEspecie"].ToString();
                        txtedadmascota.Text    = data.Tables[0].Rows[0]["Edad"].ToString();
                        txtsexomascota.Text    = data.Tables[0].Rows[0]["DscSexoMascota"].ToString();
                        txttamañomascota.Text  = data.Tables[0].Rows[0]["tamaño"].ToString();

                        //detalle

                        this.grvresultado.DataSource = data.Tables[1];
                        this.grvresultado.DataBind();
                    }
                    else
                    {
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "alert('La cita para el código ingresado no existe, o no esta pendiente.')", true);
                    }
                }
                else
                {
                    lblModalTitle.Text = "Buscar Cita";
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "myModal", "$('#myModal').modal();", true);
                    upModal.Update();
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "$.growl.warning({ title: 'Mensaje Sistema', message: 'Error interno del sistema.'});", true);
            }
        }
Beispiel #30
0
        protected void btnbuscarcitapopup_Click(object sender, EventArgs e)
        {
            try
            {
                Cita cita = new Cita();
                cita.FechaInicial = txtfechainicita.Text;
                cita.FechaFinal   = txtfechafincita.Text;
                cita.Cliente      = txtnombreclicita.Text;

                DataTable citas = AtencionPeluqueriaBuss.BusquedaCita(cita);

                this.grvResultadoPopup.DataSource = citas;
                this.grvResultadoPopup.DataBind();
                this.upModal.Update();
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "Mensaje", "$.growl.warning({ title: 'Mensaje Sistema', message: 'Error interno del sistema.'});", true);
            }
        }