//---Metodo para consultar el nombre del empleado y la contraseña que en este caso es el No de documento---\\ public Empleado IsConsultar(string Nombre_em, string Contraseña) { CNXE = Con.Conectar(); if (string.IsNullOrEmpty(Nombre_em) || string.IsNullOrEmpty(Contraseña)) { return(null); } SqlCommand CMD = new SqlCommand("select * from Empleado Where No_Documento_em = " + Contraseña + " and Nombre_em = '" + Nombre_em + "'", CNXE); SqlDataReader Consultar = CMD.ExecuteReader(); DataTable table = new DataTable(); table.Load(Consultar); CNXE.Close(); if (table.HasRows()) { return new Empleado { Nombre_cargo = (TipoCargo)Enum.Parse(typeof(TipoCargo), table.Rows[0]["Nombre_cargo"].ToString()), Apellido_em = table.Rows[0]["Apellido_em"].ToString(), Nombre_em = table.Rows[0]["Nombre_em"].ToString(), No_Documento_em = Convert.ToInt64(table.Rows[0]["No_Documento_em"].ToString()) } } ; else { return(null); } }
//---Metodo para obtener Materia Prima por medio de su ID---\\ public static Inventario ObtenerMateriaPrima(Int64 Id_pz) { Conexión Con = new Conexión(); using (SqlConnection Connn = Con.Conectar()) { Inventario PInventario = new Inventario(); SqlCommand CmdeI = new SqlCommand(string.Format( "select Tipo_de_pieza,Descripcion,Tamaño,Cantidad_Existente,Valor_Proveedor,Empresa,Id_pz,Id_Prov from Inventario where Id_Pz={0}", Id_pz), Connn); SqlDataReader LeeerI = CmdeI.ExecuteReader(); while (LeeerI.Read()) { PInventario.Tipo_de_pieza = LeeerI.GetString(0); PInventario.Descripcion = LeeerI.GetString(1); PInventario.Tamaño = LeeerI.GetString(2); PInventario.Cantidad_Existente = LeeerI.GetInt64(3); PInventario.Valor_Proveedor = LeeerI.GetDecimal(4); PInventario.Empresa = LeeerI.GetString(5); PInventario.Id_pz = LeeerI.GetInt64(6); PInventario.Id_Prov = LeeerI.GetInt64(7); } Connn.Close(); return(PInventario); { } } }
//---Metodo para consultar Materia Prima---\\ public static List <Inventario> ConsultarMateriaPrima(string PTipo_de_pieza) { Conexión Con = new Conexión(); List <Inventario> ListaI = new List <Inventario>(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand CmdemP = new SqlCommand(string.Format( "Consultar_Materia_Prima '{0}'", PTipo_de_pieza), Connn); SqlDataReader LeeerI = CmdemP.ExecuteReader(); while (LeeerI.Read()) { Inventario PInventario = new Inventario(); PInventario.Tipo_de_pieza = LeeerI.GetString(0); PInventario.Descripcion = LeeerI.GetString(1); PInventario.Tamaño = LeeerI.GetString(2); PInventario.Cantidad_Existente = LeeerI.GetInt64(3); PInventario.Valor_Proveedor = LeeerI.GetDecimal(4); PInventario.Empresa = LeeerI.GetString(5); PInventario.Id_pz = LeeerI.GetInt64(6); PInventario.Id_Prov = LeeerI.GetInt64(7); ListaI.Add(PInventario); } Connn.Close(); return(ListaI); } }
public static List <PedidoComInvPro> ConsultarComInvPro(string PIdPCIV) { Conexión Con = new Conexión(); List <PedidoComInvPro> ListaPCIV = new List <PedidoComInvPro>(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand CmdemP = new SqlCommand(string.Format( "Select IdPCIV, Id_Pc,Inventario.Id_Pz, CantidadPedido, ValorTotalProv,Proveedor.Empresa,Proveedor.Id_Prov,Inventario.Tipo_de_pieza,Inventario.Tamaño,Inventario.Valor_Proveedor,Inventario.Descripcion from Pedido_Comp_Inv_Prov Inner Join Inventario on Pedido_Comp_Inv_Prov.Id_pz = Inventario.Id_pz Inner Join Proveedor on Pedido_Comp_Inv_Prov.Id_Prov =Proveedor.Id_Prov where Id_Pc Like'%{0}%'", PIdPCIV), Connn); SqlDataReader LeeerI = CmdemP.ExecuteReader(); while (LeeerI.Read()) { PedidoComInvPro PPedido_PCIV = new PedidoComInvPro(); Inventario PInv = new Inventario(); PPedido_PCIV.IdPCIV = LeeerI.GetInt64(0); PPedido_PCIV.Id_Pc = LeeerI.GetInt64(1); PPedido_PCIV.Id_pz = LeeerI.GetInt64(2); PPedido_PCIV.CantidadPedido = LeeerI.GetInt64(3); PPedido_PCIV.ValorTotalProv = LeeerI.GetDecimal(4); PPedido_PCIV.Empresa = LeeerI.GetString(5); PPedido_PCIV.Id_Prov = LeeerI.GetInt64(6); PPedido_PCIV.Tipo_de_pieza = LeeerI.GetString(7); PPedido_PCIV.Tamaño = LeeerI.GetString(8); PPedido_PCIV.Valor_Proveedor = LeeerI.GetDecimal(9); PPedido_PCIV.Descripcion = LeeerI.GetString(10); ListaPCIV.Add(PPedido_PCIV); } Connn.Close(); return(ListaPCIV); } }
public static List <PedidoCliente_Inv> ConsultarPedidoCliente_Inv(string PIdPCIV) { Conexión Con = new Conexión(); List <PedidoCliente_Inv> ListaPCIV = new List <PedidoCliente_Inv>(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand CmdemP = new SqlCommand(string.Format( "Select Id_PeInv, Id_Pcli,Produccion.Id_Produccion, Nombre_Producto, Descripcion, Cantidad_PeInv, Valor_Total_PeInv from PedidoCliente_Produc Inner Join Produccion on PedidoCliente_Produc.Id_Produccion = Produccion.Id_Produccion where Id_Pcli Like'%{0}%'", PIdPCIV), Connn); SqlDataReader LeeerI = CmdemP.ExecuteReader(); while (LeeerI.Read()) { PedidoCliente_Inv PPedidoCliente_Inv = new PedidoCliente_Inv(); Inventario PInv = new Inventario(); PPedidoCliente_Inv.Id_PeInv = LeeerI.GetInt64(0); PPedidoCliente_Inv.Id_Pcli = LeeerI.GetInt64(1); PPedidoCliente_Inv.Id_Produccion = LeeerI.GetInt64(2); PPedidoCliente_Inv.Nombre_Producto = LeeerI.GetString(3); PPedidoCliente_Inv.Descripcion = LeeerI.GetString(4); PPedidoCliente_Inv.Cantidad_PeInv = LeeerI.GetInt64(5); PPedidoCliente_Inv.Valor_Total_PeInv = LeeerI.GetDecimal(6); ListaPCIV.Add(PPedidoCliente_Inv); } Connn.Close(); return(ListaPCIV); } }
//---Metodo para obtener Maquinaria por medio de su ID---\\ public static Maquinaria ObtenerMaquinaria(Int64 Id_Ma) { Conexión Con = new Conexión(); using (SqlConnection Connn = Con.Conectar()) { Maquinaria PMaquinaria = new Maquinaria(); SqlCommand Cmdem = new SqlCommand(string.Format( "select Id_Ma,Tipo_Ma,Garantia,NumeroReparacion,Mantenimiento,Estado_Ma from Maquinaria where Id_Ma={0}", Id_Ma), Connn); SqlDataReader Leeer = Cmdem.ExecuteReader(); while (Leeer.Read()) { PMaquinaria.Id_Ma = Leeer.GetInt64(0); PMaquinaria.Tipo_Ma = Leeer.GetString(1); PMaquinaria.Garantia = Leeer.GetString(2); PMaquinaria.NumeroReparacion = Leeer.GetInt64(3); PMaquinaria.Mantenimiento = Leeer.GetString(4); PMaquinaria.Estado_Ma = Leeer.GetString(5); } Connn.Close(); return(PMaquinaria); { } } }
//---Metodo para consultar Maquinaria---\\ public static List <Maquinaria> ConsultarMaquinaria(string PTipo_Ma) { Conexión Con = new Conexión(); List <Maquinaria> ListaM = new List <Maquinaria>(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmdem = new SqlCommand(string.Format( "Consultar_Maquinaria '%{0}%'", PTipo_Ma), Connn); SqlDataReader Leeer = Cmdem.ExecuteReader(); while (Leeer.Read()) { Maquinaria PMaquinaria = new Maquinaria(); PMaquinaria.Id_Ma = Leeer.GetInt64(0); PMaquinaria.Tipo_Ma = Leeer.GetString(1); PMaquinaria.Garantia = Leeer.GetString(2); PMaquinaria.NumeroReparacion = Leeer.GetInt64(3); PMaquinaria.Mantenimiento = Leeer.GetString(4); PMaquinaria.Estado_Ma = Leeer.GetString(5); ListaM.Add(PMaquinaria); } Connn.Close(); return(ListaM); } }
public static List <Proveedor> ConsultarProveedor(string Empresa) { Conexión Con = new Conexión(); List <Proveedor> ListaP = new List <Proveedor>(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand CmdemP = new SqlCommand(string.Format( "Consultar_Proveedor '{0}'", Empresa), Connn); SqlDataReader LeeerP = CmdemP.ExecuteReader(); while (LeeerP.Read()) { Proveedor PProveedor = new Proveedor(); PProveedor.Id_Prov = LeeerP.GetInt64(0); PProveedor.Empresa = LeeerP.GetString(1); PProveedor.Telefono_Prov = LeeerP.GetInt64(2); PProveedor.Nit_Prov = LeeerP.GetInt64(3); PProveedor.Correo_Prov = LeeerP.GetString(4); PProveedor.Estado_Prov = LeeerP.GetString(5); ListaP.Add(PProveedor); } Connn.Close(); return(ListaP); } }
public static Proveedor ObtenerProveedor(Int64 Id_Prov) { Conexión Con = new Conexión(); using (SqlConnection Connn = Con.Conectar()) { Proveedor PProveedor = new Proveedor(); SqlCommand Cmdem = new SqlCommand(string.Format( "select Id_Prov,Empresa,Telefono_Prov,Nit_Prov,Correo_Prov,Estado_Prov from Proveedor where Id_Prov={0}", Id_Prov), Connn); SqlDataReader Leeer = Cmdem.ExecuteReader(); while (Leeer.Read()) { PProveedor.Id_Prov = Leeer.GetInt64(0); PProveedor.Empresa = Leeer.GetString(1); PProveedor.Telefono_Prov = Leeer.GetInt64(2); PProveedor.Nit_Prov = Leeer.GetInt64(3); PProveedor.Correo_Prov = Leeer.GetString(4); PProveedor.Estado_Prov = Leeer.GetString(5); } Connn.Close(); return(PProveedor); { } } }
public Login() { InitializeComponent(); mConexion = new Conexión(); mConexion.Conectar("MySQL ODBC 5.2w Driver", "localhost", "equipos", "root", ""); }
//---Metodo para obtener un Pedido de Compra por medio de su ID---\\ public static Pedido_Compra ObtenerPedidoCompra(Int64 Id_Pc) { Conexión Con = new Conexión(); using (SqlConnection Connn = Con.Conectar()) { Pedido_Compra PPedido_Compra = new Pedido_Compra(); SqlCommand CmdeI = new SqlCommand(string.Format( "select CONVERT(VARCHAR(50),Fecha_Realizacion_Pc,120), CONVERT(VARCHAR(50),Fecha_Entrega_Pc,120),Valor_Total_Pc,Empresa,Id_Pc,Id_Prov,Subtotal_Pc,Estado_Pc,Iva_Pc from Pedido_Compra where Id_Pc={0}", Id_Pc), Connn); SqlDataReader LeeerI = CmdeI.ExecuteReader(); while (LeeerI.Read()) { PPedido_Compra.Fecha_Realizacion_Pc = LeeerI.GetString(0); PPedido_Compra.Fecha_Entrega_Pc = LeeerI.GetString(1); PPedido_Compra.Valor_Total_Pc = LeeerI.GetInt64(2); PPedido_Compra.Empresa = LeeerI.GetString(3); PPedido_Compra.Id_Pc = LeeerI.GetInt64(4); PPedido_Compra.Id_Prov = LeeerI.GetInt64(5); PPedido_Compra.Subtotal_Pc = LeeerI.GetInt64(6); PPedido_Compra.Estado_Pc = LeeerI.GetString(7); PPedido_Compra.Iva_Pc = LeeerI.GetInt64(8); } Connn.Close(); return(PPedido_Compra); { } } }
public static List <Produccioon> ConsultarProduccion(string PId) { Conexión Con = new Conexión(); List <Produccioon> ListaPC = new List <Produccioon>(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand CmdemP = new SqlCommand(string.Format( "select Id_Produccion,Id_Ma,Tipo_Ma,Nombre_Producto, Valor_Producto,Tamaño,Descripcion,Empresa from Produccion where Id_Produccion Like'%{0}%' and Valor_Producto >0 ", PId), Connn); SqlDataReader LeeerI = CmdemP.ExecuteReader(); while (LeeerI.Read()) { Produccioon PProduccion = new Produccioon(); PProduccion.Id_Produccion = LeeerI.GetInt64(0); PProduccion.Id_Ma = LeeerI.GetInt64(1); PProduccion.Tipo_Ma = LeeerI.GetString(2); PProduccion.Nombre_Producto = LeeerI.GetString(3); PProduccion.Valor_Producto = LeeerI.GetInt64(4); PProduccion.Tamaño = LeeerI.GetString(5); PProduccion.Descripcion = LeeerI.GetString(6); PProduccion.Empresa = LeeerI.GetString(7); ListaPC.Add(PProduccion); } Connn.Close(); return(ListaPC); } }
public static List <Produc_Invent> ConsultarProduccTT(string PId) { Conexión Con = new Conexión(); List <Produc_Invent> ListaPC = new List <Produc_Invent>(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand CmdemP = new SqlCommand(string.Format( "select Id_PROINV, Id_pz, Tipo_de_pieza, Cantidad_Necesitada,Id_Produccion from Produc_Invent where Id_Produccion Like'%{0}%' ", PId), Connn); SqlDataReader LeeerI = CmdemP.ExecuteReader(); while (LeeerI.Read()) { Produc_Invent PProducInvent = new Produc_Invent(); PProducInvent.Id_PROINV = LeeerI.GetInt64(0); PProducInvent.Id_pz = LeeerI.GetInt64(1); PProducInvent.Tipo_de_pieza = LeeerI.GetString(2); PProducInvent.Cantidad_Necesitada = LeeerI.GetInt64(3); PProducInvent.Id_Produccion = LeeerI.GetInt64(4); ListaPC.Add(PProducInvent); } Connn.Close(); return(ListaPC); } }
public void EmpresaSelect(DataTable Empresas) { Conexión Con = new Conexión(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand CmdeI = new SqlCommand("select Empresa from Proveedor where Estado_Prov='Activo'", Connn); SqlDataAdapter LeeerIE = new SqlDataAdapter(CmdeI); LeeerIE.Fill(Empresas); Connn.Close(); } }
//---Metodo para consultar un Pedido de Compra por medio de su fecha de realización, o de entrega (If) y por medio de su ID, o Empresa---\\ public static List <Pedido_Compra> ConsultarPedido_Compra(string PId_Pc) { Conexión Con = new Conexión(); List <Pedido_Compra> ListaPC = new List <Pedido_Compra>(); using (SqlConnection Connn = Con.Conectar()) { if (PId_Pc.Contains("-") | PId_Pc.Contains("/")) { SqlCommand CmdemP = new SqlCommand(string.Format( "Consultar_Fecha_Pedido_Compra '{0}'", PId_Pc), Connn); SqlDataReader LeeerI = CmdemP.ExecuteReader(); while (LeeerI.Read()) { Pedido_Compra PPedido_Compra = new Pedido_Compra(); PPedido_Compra.Id_Pc = LeeerI.GetInt64(0); PPedido_Compra.Fecha_Realizacion_Pc = Convert.ToString(LeeerI.GetDateTime(1)); PPedido_Compra.Fecha_Entrega_Pc = Convert.ToString(LeeerI.GetDateTime(2)); PPedido_Compra.Valor_Total_Pc = LeeerI.GetInt64(3); PPedido_Compra.Subtotal_Pc = LeeerI.GetInt64(4); PPedido_Compra.Iva_Pc = LeeerI.GetInt64(5); PPedido_Compra.Id_Prov = LeeerI.GetInt64(6); PPedido_Compra.Empresa = LeeerI.GetString(7); PPedido_Compra.Estado_Pc = LeeerI.GetString(8); ListaPC.Add(PPedido_Compra); } } else { SqlCommand CmdemP = new SqlCommand(string.Format( "Consultar_Pedido_Compra '{0}'", PId_Pc), Connn); SqlDataReader LeeerI = CmdemP.ExecuteReader(); while (LeeerI.Read()) { Pedido_Compra PPedido_Compra = new Pedido_Compra(); PPedido_Compra.Id_Pc = LeeerI.GetInt64(0); PPedido_Compra.Fecha_Realizacion_Pc = Convert.ToString(LeeerI.GetDateTime(1)); PPedido_Compra.Fecha_Entrega_Pc = Convert.ToString(LeeerI.GetDateTime(2)); PPedido_Compra.Valor_Total_Pc = LeeerI.GetInt64(3); PPedido_Compra.Subtotal_Pc = LeeerI.GetInt64(4); PPedido_Compra.Iva_Pc = LeeerI.GetInt64(5); PPedido_Compra.Id_Prov = LeeerI.GetInt64(6); PPedido_Compra.Empresa = LeeerI.GetString(7); PPedido_Compra.Estado_Pc = LeeerI.GetString(8); ListaPC.Add(PPedido_Compra); } } Connn.Close(); return(ListaPC); } }
public static int EliminarProduc(Int64 Id_PeInv) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format("delete from PedidoCliente_Produc where Id_PeInv={0}", Id_PeInv), Connn); Retorno = Cmd.ExecuteNonQuery(); Connn.Close(); } return(Retorno); }
public static int EliminarCompraa(Int64 IdPC) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format("delete from Pedido_Compra where Id_Pc={0}", IdPC), Connn); Retorno = Cmd.ExecuteNonQuery(); Connn.Close(); } return(Retorno); }
public static int EliminarPCli(Int64 zee) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format("begin delete PedidoCliente_Produc from PedidoCliente_Produc inner join Pedido_Cliente on PedidoCliente_Produc.Id_Pcli=Pedido_Cliente.Id_Pcli where Pedido_Cliente.Valor_Total_Pcli = {0} Delete from Pedido_Cliente where Subtotal_Pcli = {0} end", zee), Connn); Retorno = Cmd.ExecuteNonQuery(); Connn.Close(); } return(Retorno); }
//---Eliminar todos los Pedidos de Compra que tengan campos vacios---\\ public static int EliminarPC(Int64 zee) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format("begin delete Pedido_Comp_Inv_Prov from Pedido_Comp_Inv_Prov inner join Pedido_Compra on Pedido_Comp_Inv_Prov.Id_pc=Pedido_Compra.Id_pc where Pedido_Compra.Valor_Total_Pc = {0} Delete from Pedido_Compra where subtotal_pc = {0} end", zee), Connn); Retorno = Cmd.ExecuteNonQuery(); Connn.Close(); } return(Retorno); }
//---Metodo para actualizar Materia Prima---\\ public static int ActualizarMateriaPrima(Inventario PInventario) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Actualizar_Materia_Prima'{0}','{1}','{2}',{3} ,{4},'{5}','{6}',{7}", PInventario.Tipo_de_pieza, PInventario.Descripcion, PInventario.Tamaño, PInventario.Cantidad_Existente, PInventario.Valor_Proveedor, PInventario.Empresa, PInventario.Id_Prov, PInventario.Id_pz), Connn); Retorno = Cmd.ExecuteNonQuery(); } return(Retorno); }
//---Metodo para Actualizar Maquinaria---\\ public static int ActualizarMaquinaria(Maquinaria PMaquinaria) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Actualizar_Maquinaria '{0}','{1}',{2},'{3}','{4}',{5}", PMaquinaria.Tipo_Ma, PMaquinaria.Garantia, PMaquinaria.NumeroReparacion, PMaquinaria.Mantenimiento, PMaquinaria.Estado_Ma, PMaquinaria.Id_Ma), Connn); Retorno = Cmd.ExecuteNonQuery(); } return(Retorno); }
//---Metodo para actualizar Empleado---\\ public static int ActualizarEmpleado(Empleado PEmpleado) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Actualizar_Empleado {0},'{1}','{2}',{3},{4},'{5}','{6}','{7}','{8}',{9}", PEmpleado.No_Documento_em, PEmpleado.Nombre_em, PEmpleado.Apellido_em, PEmpleado.Celular_em, PEmpleado.Telefono_em, PEmpleado.Direccion_em, PEmpleado.Correo_em, PEmpleado.Estado_em, PEmpleado.Nombre_cargo, PEmpleado.Id_em), Connn); Retorno = Cmd.ExecuteNonQuery(); } return(Retorno); }
//---Metodo para actualizar un Pedido de Compra---\\ public static int ActualizarPedidoCompra(Pedido_Compra PPedido_Compra) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Actualizar_Pedido_Compra '{0}','{1}',{2},{3},{4},'{5}',{6},'{7}',{8}", PPedido_Compra.Fecha_Realizacion_Pc, PPedido_Compra.Fecha_Entrega_Pc, PPedido_Compra.Valor_Total_Pc, PPedido_Compra.Subtotal_Pc, PPedido_Compra.Iva_Pc, PPedido_Compra.Empresa, PPedido_Compra.Id_Prov, PPedido_Compra.Estado_Pc, PPedido_Compra.Id_Pc), Connn); Retorno = Cmd.ExecuteNonQuery(); } return(Retorno); }
public static int ActualizarProduccion(Produccioon PProduccion) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Registrar_Produccion {0},'{1}' ,'{2}',{3},'{4}','{5}','{6}',{7}", PProduccion.Id_Ma, PProduccion.Tipo_Ma, PProduccion.Nombre_Producto, PProduccion.Valor_Producto, PProduccion.Tamaño, PProduccion.Descripcion, PProduccion.Empresa, PProduccion.Id_Produccion), Connn); Retorno = Cmd.ExecuteNonQuery(); } return(Retorno); }
public static int ActualizarProveedor(Proveedor PProveedor) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Actualizar_Proveedor {0},'{1}','{2}',{3}", PProveedor.Telefono_Prov, PProveedor.Correo_Prov, PProveedor.Estado_Prov, PProveedor.Id_Prov), Connn); Retorno = Cmd.ExecuteNonQuery(); } return(Retorno); }
public static int ActualizarPedidoCliente(PedidoCliente PPedido_Cliente) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Update Pedido_Cliente set Fecha_Realizacion_Pcli='{0}',Fecha_Entrega_Pcli='{1}',Observaciones='{2}',Iva_Pcli={3},Subtotal_Pcli={4},Valor_Total_Pcli={5},No_Documento_em={6},Nombre_em='{7}',Apellido_em='{8}',No_Documento_Cl={9},Nombre_Cl='{10}',Apellido_Cl='{11}',Abono_Pcli={12},Saldo_Pcli={13},Estado_Pcli='{14}' where Id_Pcli={15}", PPedido_Cliente.Fecha_Realizacion_Pcli, PPedido_Cliente.Fecha_Entrega_Pcli, PPedido_Cliente.Observaciones, PPedido_Cliente.Iva_Pcli, PPedido_Cliente.Subtotal_Pcli, PPedido_Cliente.Valor_Total_Pcli, PPedido_Cliente.No_Documento_em, PPedido_Cliente.Nombre_em, PPedido_Cliente.Apellido_em, PPedido_Cliente.No_Documento_Cl, PPedido_Cliente.Nombre_Cl, PPedido_Cliente.Apellido_Cl, PPedido_Cliente.Abono_Pcli, PPedido_Cliente.Saldo_Pcli, PPedido_Cliente.Estado_Pcli, PPedido_Cliente.Id_Pcli), Connn); Retorno = Cmd.ExecuteNonQuery(); } return(Retorno); }
public static int ActualizarPedidoCompraDos(Pedido_Compra PPedido_Compra) { Conexión Con = new Conexión(); int Retorno = 0; using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Actualizar_Pedido_Compra_Dos '{0}',{1}", PPedido_Compra.Estado_Pc, PPedido_Compra.Id_Pc), Connn); Retorno = Cmd.ExecuteNonQuery(); } return(Retorno); }
//---Metodo para registrar un Pedido de Compra---\\ public static int RegistrarPedidoCompra(Pedido_Compra PPedido_Compra) { int RetornR = 0; Conexión Con = new Conexión(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Registrar_Pedido_Compra {0},'{1}','{2}',{3},{4}, {5},{6},'{7}','{8}' ", PPedido_Compra.Id_Pc, PPedido_Compra.Fecha_Realizacion_Pc, PPedido_Compra.Fecha_Entrega_Pc, PPedido_Compra.Valor_Total_Pc, PPedido_Compra.Subtotal_Pc, PPedido_Compra.Iva_Pc, PPedido_Compra.Id_Prov, PPedido_Compra.Empresa, PPedido_Compra.Estado_Pc), Connn); RetornR = Cmd.ExecuteNonQuery(); Connn.Close(); } return(RetornR); }
//---Metodo para registrar la informacion del Cliente---\\ public static int RegistrarCliente(Cliente PCliente) { int RetornR = 0; Conexión Con = new Conexión(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand Cmd = new SqlCommand(string.Format( "Registrar_Cliente {0},'{1}' ,'{2}','{3}',{4},'{5}','{6}'", PCliente.No_Documento_Cl, PCliente.Tipo_Identificacion_Cl, PCliente.Nombre_Cl, PCliente.Apellido_Cl, PCliente.Celular_Cl, PCliente.Direccion_Cl, PCliente.Correo_Cl), Connn); RetornR = Cmd.ExecuteNonQuery(); Connn.Close(); } return(RetornR); }
//---Metodo para llenar el Combobox con todas las identificaciones del Cliente---\\ public void IndentiSelectCli(ComboBox CajaIndenti) { Conexión Con = new Conexión(); using (SqlConnection Connn = Con.Conectar()) { SqlCommand CmdeI = new SqlCommand("select No_Documento_Cl from Cliente ", Connn); SqlDataReader LeeerIE = CmdeI.ExecuteReader(); while (LeeerIE.Read()) { CajaIndenti.Items.Add(LeeerIE["No_Documento_Cl"].ToString()); } LeeerIE.Close(); Connn.Close(); } }