Exemple #1
0
        public static Struct_Cliente GetClient(int IdCliente, int IdUser)
        {
            Connection.D_Clientes CL = new Connection.D_Clientes();
            DataRow DR = CL.GetClient(IdCliente, IdUser);

            if (DR != null)
            {
                return(new Struct_Cliente(DR));
            }
            else
            {
                return(null);
            }
        }
Exemple #2
0
        public static List <Struct_Cliente> SearchClient(string searchstring, int IdUser)
        {
            Connection.D_Clientes C  = new Connection.D_Clientes();
            DataTable             DT = C.Search_Cliente(searchstring, IdUser);

            if (DT != null && DT.Rows.Count > 0)
            {
                List <Struct_Cliente> SCL = new List <Struct_Cliente>();
                for (int a = 0; a < DT.Rows.Count; a++)
                {
                    SCL.Add(new Struct_Cliente(DT.Rows[a]));
                }
                return(SCL);
            }
            else
            {
                return(null);
            }
        }
Exemple #3
0
        public List <Struct_DetalleCuentaCorriente> GetDetalleCC()
        {
            Connection.D_Clientes Connection = new Connection.D_Clientes();
            DataTable             DT         = Connection.Get_MovimientosCliente(ID);

            if (DT != null)
            {
                List <Struct_DetalleCuentaCorriente> ListDCC = new List <Struct_DetalleCuentaCorriente>();
                for (int a = 0; a < DT.Rows.Count; a++)
                {
                    ListDCC.Add(new Struct_DetalleCuentaCorriente(DT.Rows[a], IDUSER));
                }
                ListDCC = ListDCC.OrderBy(p => p.Fecha).ToList();
                return(ListDCC);
            }
            else
            {
                return(null);
            }
        }
Exemple #4
0
        public bool Guardar()
        {
            Data2.Connection.D_Clientes C = new Connection.D_Clientes();
            if (ID == 0)
            {
                int reg = C.insertarCliente(RS, DNI, PAIS, PROVINCIA, LOCALIDAD, DOMICILIO, OBSERVACIONES, TIPOIVA, DESCUENTO, EMAIL, IDUSER, LIMITEDECREDITO, SUSPENDIDA);
                ID = reg;
            }
            else
            {
                C.actualizarCliente(RS, DNI, PAIS, PROVINCIA, LOCALIDAD, DOMICILIO, OBSERVACIONES, TIPOIVA, DESCUENTO, EMAIL, IDUSER, ID, LIMITEDECREDITO, SUSPENDIDA);
            }

            if (ID != 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }