protected void Brn_Cita_Click(object sender, EventArgs e)
 {
     if (Txt_Codigo.Text.Trim() == "")
     {
         LblMensaje.Text = "El codigo es requerido";
         Txt_Codigo.Focus();
     }
     else
     {
         LblMensaje.Text = "";
         DataSet ds = new DataSet();
         ds = objcita.concultar_cita(Txt_Codigo.Text);
         if (ds.Tables[0].Rows.Count == 0)
         {
             LblMensaje.Text         = "Cita no encontrada";
             Txt_Fecha.Text          = System.DateTime.Now.ToShortDateString();
             Txt_Hora.Text           = System.DateTime.Now.ToShortTimeString();
             Txt_Hora.Enabled        = true;
             Txt_Fecha.Enabled       = true;
             Ddl_Consultorio.Enabled = true;
             Txt_Paciente.Enabled    = true;
             Btn_Paciente.Enabled    = true;
             Txt_Paciente.Focus();
         }
         else
         {
             if (Convert.ToBoolean(ds.Tables[0].Rows[0]["activo"].ToString()) == false)
             {
                 LblMensaje.Text = "Registro Existe Pero Esta Anulado";
             }
             else
             {
                 LblMensaje.Text           = "Cita ya existe";
                 Txt_Fecha.Text            = ds.Tables[0].Rows[0]["Fecha"].ToString();
                 Txt_Hora.Text             = ds.Tables[0].Rows[0]["Hora"].ToString();
                 Ddl_Consultorio.Text      = ds.Tables[0].Rows[0]["Consultorio"].ToString();
                 Txt_Hora.Text             = ds.Tables[0].Rows[0]["Hora"].ToString();
                 Txt_Paciente.Text         = ds.Tables[0].Rows[0]["Id_Paciente"].ToString();
                 LblNomPaciente.Text       = ds.Tables[1].Rows[0]["Nom_paciente"].ToString();
                 LblTelPaciente.Text       = ds.Tables[1].Rows[0]["tel_paciente"].ToString();
                 Txt_Medico.Text           = ds.Tables[0].Rows[0]["Id_Medico"].ToString();
                 LblNomMedico.Text         = ds.Tables[2].Rows[0]["Nom_Medico"].ToString();
                 LblEspMedico.Text         = ds.Tables[2].Rows[0]["Especialidad"].ToString();
                 Txt_Valor.Text            = ds.Tables[0].Rows[0]["Valor"].ToString();
                 Txt_Observaciones.Text    = ds.Tables[0].Rows[0]["Observaciones"].ToString();
                 Txt_Hora.Enabled          = true;
                 Txt_Fecha.Enabled         = true;
                 Ddl_Consultorio.Enabled   = true;
                 Txt_Paciente.Enabled      = true;
                 Btn_Paciente.Enabled      = true;
                 Txt_Medico.Enabled        = true;
                 Txt_Valor.Enabled         = true;
                 Txt_Observaciones.Enabled = true;
                 Btn_Guardar.Enabled       = true;
                 Btn_Anular.Enabled        = true;
                 Btn_medico.Enabled        = true;
             }
         }
     }
 }
예제 #2
0
 private void Fun_LimpiarAct()
 {
     comboBox1.SelectedIndex = -1;
     Txt_Codigo.Clear();
     Txt_RangoInicial.Clear();
     Text_Mensualidad.Clear();
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Txt_Codigo.Focus();
     }
 }
예제 #4
0
        private void Btn_Guardar_Click(object sender, EventArgs e)
        {
            if (Txt_Cedula.Text.Trim() == "")
            {
                MessageBox.Show("Proporcione la cédula");
                Txt_Cedula.Focus();
                return;
            }
            if (Txt_Cliente.Text.Trim() == "")
            {
                MessageBox.Show("Proporcione el cliente");
                Txt_Cliente.Focus();
                return;
            }
            if (detallesProductos.Count == 0)
            {
                MessageBox.Show("Debe de agregar productos al listado");
                Txt_Codigo.Focus();
                return;
            }
            decimal total = 0;

            decimal.TryParse(Txt_Total.Text.Replace(",", ""), out total);
            if (total <= 0)
            {
                MessageBox.Show("El importe total no puede ser cero ni menor que cero");
                Txt_Codigo.Focus();
                return;
            }

            Alta_Factura();
        }
예제 #5
0
        private void Calcular()
        {
            //Pegando os valores do código e da quantidade.

            Codigo = Txt_Codigo.Text;

            Quantidade = short.Parse(Txt_Quantidade.Text);



            //Metodo  de verificar valor foto e outro.

            Verificar();


            if (Verificador == true)  //Verificar se o código foi achado.
            {
                //Calculos do valor total * quantidade.

                Acumulador = Valor_Unitario * Quantidade;


                Valor_Total += Acumulador;

                //Mandando os Valores.
                Lbl_ValorUni.Text = Convert.ToString(Valor_Unitario);
                Lbl_Troco.Text    = "0,00";
                Lbl_Total.Text    = Convert.ToString(Valor_Total);
                Lbl_NomeProd.Text = Nome_Produto;


                Txt_NotaFiscal.Text += "\n\r                \r\n";

                Txt_NotaFiscal.Text += Nome_Produto;



                //Limpando os TextBox.

                Txt_Codigo.Text     = null;
                Txt_Quantidade.Text = "1";
                Txt_ValorPago.Text  = "0,00";
            }
            else
            {
                Txt_Codigo.Clear();

                MessageBox.Show("Erro Verifique o Código");
            }
        }
 protected void Desactivar_Campos()
 {
     Txt_Valor.Enabled         = false;
     Txt_Paciente.Enabled      = false;
     Txt_Observaciones.Enabled = false;
     Txt_Medico.Enabled        = false;
     Txt_Hora.Enabled          = false;
     Txt_Fecha.Enabled         = false;
     Btn_Anular.Enabled        = false;
     Btn_Guardar.Enabled       = false;
     Btn_medico.Enabled        = false;
     Btn_Paciente.Enabled      = false;
     Ddl_Consultorio.Enabled   = false;
     Txt_Codigo.Focus();
 }
예제 #7
0
        private void Btn_Buscar_Producto_Click(object sender, EventArgs e)
        {
            FrmFacturacionProductosBusqueda frm = new FrmFacturacionProductosBusqueda();

            frm.ShowDialog();
            if (frm._existenCambios)
            {
                if (frm._existenCambios)
                {
                    Boolean encontroProducto = false;
                    int     indexProducto    = 0;

                    foreach (var item in detallesProductos)
                    {
                        if (item.Producto_ID == frm._productoID)
                        {
                            encontroProducto = true;
                            break;
                        }
                        indexProducto += 1;
                    }

                    if (!encontroProducto)
                    {
                        detallesProductos.Add(new typeDetalles {
                            Producto_ID = frm._productoID, Codigo = frm._codigo, Nombre = frm._nombre, Precio = frm._precio, Cantidad = 1, Importe = frm._precio
                        });
                    }
                    else
                    {
                        var item = detallesProductos[indexProducto];
                        item.Cantidad += 1;
                        item.Importe   = item.Cantidad * item.Precio;
                    }

                    Grid_Productos.DataSource = null;
                    Grid_Productos.DataSource = detallesProductos;

                    Calcula_Totales();

                    Txt_Codigo.Text = "";
                    Txt_Codigo.Focus();
                }
            }
        }
예제 #8
0
        private void Btn_Guardar_Click(object sender, EventArgs e)
        {
            if (Txt_Codigo.Text == "")
            {
                MessageBox.Show("Proporcione el código");
                Txt_Codigo.Focus();
                return;
            }
            else
            {
                Regex regexObj = new Regex(@"^[A-Za-z]*(?:\d[A-Za-z]*){3,3}$", RegexOptions.IgnoreCase | RegexOptions.Multiline);
                if (!regexObj.IsMatch(Txt_Codigo.Text))
                {
                    MessageBox.Show("Código inválido");
                    Txt_Codigo.Focus();
                    return;
                }
            }
            if (Txt_Nombre.Text == "")
            {
                MessageBox.Show("Proporcione el nombre");
                Txt_Nombre.Focus();
                return;
            }
            if (Txt_Precio.Value <= 0)
            {
                MessageBox.Show("Proporcione el precio");
                Txt_Precio.Focus();
                return;
            }

            if (_productoID == 0)
            {
                Agrega_Producto();
            }
            else
            {
                Edita_Producto();
            }
        }
예제 #9
0
        private void Btn_Eliminar_Click(object sender, EventArgs e)
        {
            if (Grid_Productos.CurrentCell == null)
            {
                return;
            }

            if (MessageBox.Show(this, "¿Esta seguro de eliminar la partida?", "LogoSoft", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                if (Grid_Productos.CurrentCell.RowIndex >= 0)
                {
                    detallesProductos.RemoveAt(Grid_Productos.CurrentCell.RowIndex);

                    Grid_Productos.DataSource = null;
                    Grid_Productos.DataSource = detallesProductos;

                    Calcula_Totales();

                    Txt_Codigo.Text = "";
                    Txt_Codigo.Focus();
                }
            }
        }
예제 #10
0
        private async void Buscar_Producto_Codigo()
        {
            Boolean encontroProducto = false;
            int     indexProducto    = 0;

            if (Txt_Codigo.Text.Trim() == "")
            {
                return;
            }

            this.Cursor = Cursors.WaitCursor;

            using (var client = new HttpClient())
            {
                using (var response = await client.GetAsync(Globales.Url_API + "productos/consultaproductocodigo/" + Txt_Codigo.Text.Trim()))
                {
                    if (response.IsSuccessStatusCode)
                    {
                        var jsonString = await response.Content.ReadAsStringAsync();

                        var          productoJson = JsonConvert.DeserializeObject <typeProducto[]>(jsonString);
                        typeProducto producto     = productoJson.FirstOrDefault();
                        if (producto != null)
                        {
                            foreach (var item in detallesProductos)
                            {
                                if (item.Producto_ID == producto.Producto_ID)
                                {
                                    encontroProducto = true;
                                    break;
                                }
                                indexProducto += 1;
                            }

                            if (!encontroProducto)
                            {
                                detallesProductos.Add(new typeDetalles {
                                    Producto_ID = producto.Producto_ID, Codigo = producto.Codigo, Nombre = producto.Nombre, Precio = producto.Precio, Cantidad = 1, Importe = producto.Precio
                                });
                            }
                            else
                            {
                                var item = detallesProductos[indexProducto];
                                item.Cantidad += 1;
                                item.Importe   = item.Cantidad * item.Precio;
                            }

                            Grid_Productos.DataSource = null;
                            Grid_Productos.DataSource = detallesProductos;

                            Calcula_Totales();
                        }
                        else
                        {
                            this.Cursor = Cursors.Default;
                            MessageBox.Show("Producto no encontrado");
                        }
                        Txt_Codigo.Text = "";
                        Txt_Codigo.Focus();
                    }
                    else
                    {
                        this.Cursor = Cursors.Default;
                        var contents = await response.Content.ReadAsStringAsync();

                        MessageBox.Show(contents);
                    }
                }
            }

            this.Cursor = Cursors.Default;
        }