Beispiel #1
0
        public DataRow Select(ECorporation corporation)
        {
            DaCommand command = new DaCommand("dbo.CorporationSelect");

            command.AddInParameter("@CodeCorporation", DbType.String, corporation.CodeCorporation);
            return(ExecuteDataRow(command));
        }
Beispiel #2
0
        public DataRow Select(EUser user)
        {
            DaCommand command = new DaCommand("UserSelect");

            command.AddInParameter("@CodeUser", DbType.String, user.CodeUser);
            return(ExecuteDataRow(command));
        }
Beispiel #3
0
        public DataTable SelectByUser(EUser user)
        {
            DaCommand command = new DaCommand("UserCompanySelectByUser");

            command.AddInParameter("@CodeUser", DbType.String, user.CodeUser);
            return(ExecuteDataTable(command));
        }
Beispiel #4
0
        public DataRow Select(EProduct eProduct)
        {
            DaCommand command = new DaCommand("ProductSelect");

            command.AddInParameter("@CodeProduct", DbType.String, eProduct.CodeProduct);
            return(ExecuteDataRow(command));
        }
Beispiel #5
0
        public void Delete(EProduct eProduct)
        {
            DaCommand command = new DaCommand("ProductDelete");

            command.AddInParameter("@CodeProduct", DbType.String, eProduct.CodeProduct);
            ExecuteNonQuery(command);
        }
Beispiel #6
0
        public DataRow Select(ECompany company)
        {
            DaCommand command = new DaCommand("dbo.CompanySelect");

            command.AddInParameter("@CodeCompany", DbType.String, company.CodeCompany);
            return(ExecuteDataRow(command));
        }
Beispiel #7
0
        public void Delete(ESequence sequence)
        {
            DaCommand command = new DaCommand("SequenceDelete");

            command.AddInParameter("@CodeSequence", DbType.String, sequence.CodeSequence);
            ExecuteNonQuery(command);
        }
Beispiel #8
0
        public void Delete(ECorporation corporation)
        {
            DaCommand command = new DaCommand("dbo.CorporationDelete");

            command.AddInParameter("@CodeCorporation", DbType.String, corporation.CodeCorporation);
            ExecuteNonQuery(command);
        }
Beispiel #9
0
        public void Delete(ECompany company)
        {
            DaCommand command = new DaCommand("dbo.CompanyDelete");

            command.AddInParameter("@CodeCompany", DbType.String, company.CodeCompany);
            ExecuteNonQuery(command);
        }
Beispiel #10
0
        public void Delete(EClient eClient)
        {
            DaCommand command = new DaCommand("ClientDelete");

            command.AddInParameter("@CodeClient", DbType.Int32, eClient.CodeClient);
            ExecuteNonQuery(command);
        }
Beispiel #11
0
        public DataTable List()
        {
            DaCommand command = new DaCommand("UserList");
            DataTable table   = ExecuteDataTable(command);

            return(table);
        }
Beispiel #12
0
        public DataRow Select(EClient eClient)
        {
            DaCommand command = new DaCommand("ClientSelect");

            command.AddInParameter("@CodeClient", DbType.Int32, eClient.CodeClient);
            return(ExecuteDataRow(command));
        }
Beispiel #13
0
        public DataRow Select(ESequence sequence)
        {
            DaCommand command = new DaCommand("SequenceSelect");

            command.AddInParameter("@CodeSequence", DbType.String, sequence.CodeSequence);
            return(ExecuteDataRow(command));
        }
Beispiel #14
0
        public void Delete(EUser user)
        {
            DaCommand command = new DaCommand("UserDelete");

            command.AddInParameter("@CodeUser", DbType.String, user.CodeUser);
            ExecuteNonQuery(command);
        }
Beispiel #15
0
        public void Insert(EUserCompany userCompany)
        {
            DaCommand command = new DaCommand("UserCompanyInsert");

            command.AddInParameter("@CodeUser", DbType.String, userCompany.CodeUser);
            command.AddInParameter("@CodeCompany", DbType.String, userCompany.CodeCompany);
            ExecuteNonQuery(command);
        }
Beispiel #16
0
        public void Update(ESequence sequence)
        {
            DaCommand command = new DaCommand("SequenceUpdate");

            command.AddInParameter("@CodeSequence", DbType.String, sequence.CodeSequence);
            command.AddInParameter("@Correlative", DbType.Int32, sequence.Correlative);
            ExecuteNonQuery(command);
        }
Beispiel #17
0
        public void Update(ECorporation corporation)
        {
            DaCommand command = new DaCommand("dbo.CorporationUpdate");

            command.AddInParameter("@CodeCorporation", DbType.String, corporation.CodeCorporation);
            command.AddInParameter("@Name", DbType.String, corporation.Name);
            command.AddInParameter("@State", DbType.Int16, corporation.State);
            ExecuteNonQuery(command);
        }
Beispiel #18
0
        protected SqlCommand GetCommand(DaCommand Command)
        {
            SqlCommand store = new SqlCommand();

            store.CommandText = Command.CommandText;
            store.CommandType = CommandType.StoredProcedure;
            SetParameters(ref store, Command);
            return(store);
        }
Beispiel #19
0
        public DataTable Select(EAudit entity, short top)
        {
            DaCommand command = new DaCommand("AuditSelect");

            command.AddInParameter("@CodeCompany", DbType.String, entity.CodeCompany);
            command.AddInParameter("@CodeEntity", DbType.String, entity.CodeEntity);
            command.AddInParameter("@Code", DbType.String, entity.Code);
            command.AddInParameter("@Top", DbType.Int16, top);
            return(ExecuteDataTable(command));
        }
        public void Update(EProductType eProductType)
        {
            DaCommand command = new DaCommand("ProductTypeUpdate");

            command.AddInParameter("@CodeProductType", DbType.String, eProductType.CodeProductType);
            command.AddInParameter("@Description", DbType.String, eProductType.Description);
            command.AddInParameter("@CodeSunatExistence", DbType.String, eProductType.CodeSunatExistence);
            command.AddInParameter("@State", DbType.Int16, eProductType.State);
            ExecuteNonQuery(command);
        }
Beispiel #21
0
        public void Update(EUser user)
        {
            DaCommand command = new DaCommand("UserUpdate");

            command.AddInParameter("@CodeUser", DbType.String, user.CodeUser);
            command.AddInParameter("@Name", DbType.String, user.Name);
            command.AddInParameter("@Email", DbType.String, user.Email);
            command.AddInParameter("@State", DbType.String, user.State);
            ExecuteNonQuery(command);
        }
Beispiel #22
0
        public void Insert(EUser user)
        {
            DaCommand command = new DaCommand("UserInsert");

            command.AddInParameter("@CodeUser", DbType.String, user.CodeUser);
            command.AddInParameter("@Name", DbType.String, user.Name);
            command.AddInParameter("@Password", DbType.String, user.PasswordHash);
            command.AddInParameter("@Email", DbType.String, user.Email);
            command.AddInParameter("@State", DbType.String, user.State);
            ExecuteNonQuery(command);
        }
Beispiel #23
0
        public void Insert(EAudit entity)
        {
            DaCommand command = new DaCommand("AuditInsert");

            command.AddInParameter("@CodeCompany", DbType.String, entity.CodeCompany);
            command.AddInParameter("@CodeEntity", DbType.String, entity.CodeEntity);
            command.AddInParameter("@Code", DbType.String, entity.Code);
            command.AddInParameter("@Sequence", DbType.String, entity.Sequence);
            command.AddInParameter("@TypeEvent", DbType.String, entity.TypeEvent);
            command.AddInParameter("@UserRegister", DbType.String, entity.UserRegister);
            ExecuteNonQuery(command);
        }
Beispiel #24
0
        public override DataRow ExecuteDataRow(DaCommand Command)
        {
            DataTable table = ExecuteDataTable(Command);

            if (table.Rows.Count > 0)
            {
                return(table.Rows[0]);
            }
            else
            {
                return(null);
            }
        }
Beispiel #25
0
 public override object ExecuteScalar(DaCommand Command)
 {
     try
     {
         SqlCommand store = GetCommand(Command);
         store.Connection = GetConnection();
         return(store.ExecuteScalar());
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         GetConnection().Close();
     }
 }
Beispiel #26
0
 private void SetParameters(ref SqlCommand store, DaCommand command)
 {
     store.Parameters.Clear();
     foreach (var par in command.Parameters)
     {
         SqlParameter parameter = new SqlParameter();
         parameter.ParameterName = par.ParameterName;
         parameter.Direction     = par.Direction;
         parameter.DbType        = par.DbType;
         parameter.Value         = par.Value;
         if (par.DbType == DbType.String && par.Value == null)
         {
             parameter.Value = DBNull.Value;
         }
         store.Parameters.Add(parameter);
     }
 }
Beispiel #27
0
        public void Update(ECompany company)
        {
            DaCommand command = new DaCommand("dbo.CompanyUpdate");

            command.AddInParameter("@CodeCompany", DbType.String, company.CodeCompany);
            command.AddInParameter("@CodeCorporation", DbType.String, company.CodeCorporation);
            command.AddInParameter("@LongName", DbType.String, company.LongName);
            command.AddInParameter("@ShortName", DbType.String, company.ShortName);
            command.AddInParameter("@Ruc", DbType.String, company.Ruc);
            command.AddInParameter("@Address", DbType.String, company.Address);
            command.AddInParameter("@PageWeb", DbType.String, company.PageWeb);
            command.AddInParameter("@Phone", DbType.String, company.Phone);
            command.AddInParameter("@Fax", DbType.String, company.Fax);
            command.AddInParameter("@Logo", DbType.String, company.Logo);
            command.AddInParameter("@State", DbType.Int16, company.State);
            ExecuteNonQuery(command);
        }
Beispiel #28
0
        public void Update(EClient eClient)
        {
            DaCommand command = new DaCommand("ClientUpdate");

            command.AddInParameter("@CodeClient", DbType.Int32, eClient.CodeClient);
            command.AddInParameter("@FirstName", DbType.String, eClient.FirstName);
            command.AddInParameter("@SecondName", DbType.String, eClient.SecondName);
            command.AddInParameter("@FatherLastName", DbType.String, eClient.FatherLastName);
            command.AddInParameter("@MotherLastName", DbType.String, eClient.MotherLastName);
            command.AddInParameter("@LongName", DbType.String, eClient.LongName);
            command.AddInParameter("@ShortName", DbType.String, eClient.ShortName);
            command.AddInParameter("@SearchName", DbType.String, eClient.SearchName);
            command.AddInParameter("@CodeTypeDocumentIdentity", DbType.String, eClient.CodeTypeDocumentIdentity);
            command.AddInParameter("@NumberIdentity", DbType.String, eClient.NumberIdentity);
            command.AddInParameter("@Address", DbType.String, eClient.Address);
            command.AddInParameter("@Phone", DbType.String, eClient.Phone);
            command.AddInParameter("@Fax", DbType.String, eClient.Fax);
            command.AddInParameter("@Email", DbType.String, eClient.Email);
            command.AddInParameter("@State", DbType.String, eClient.State);
            ExecuteNonQuery(command);
        }
Beispiel #29
0
        public void Update(EProduct eProduct)
        {
            DaCommand command = new DaCommand("ProductUpdate");

            command.AddInParameter("@CodeProduct", DbType.String, eProduct.CodeProduct);
            command.AddInParameter("@CodeProductLine", DbType.String, eProduct.CodeProductLine);
            command.AddInParameter("@CodeProductFamily", DbType.String, eProduct.CodeProductFamily);
            command.AddInParameter("@CodeProductSubFamily", DbType.String, eProduct.CodeProductSubFamily);
            command.AddInParameter("@CodeProductLevel", DbType.String, eProduct.CodeProductLevel);
            command.AddInParameter("@CodeProductLevelTwo", DbType.String, eProduct.CodeProductLevelTwo);
            command.AddInParameter("@CodeProductType", DbType.String, eProduct.CodeProductType);
            command.AddInParameter("@CodeProductGroup", DbType.String, eProduct.CodeProductGroup);
            command.AddInParameter("@CodeProductBrand", DbType.String, eProduct.CodeProductBrand);
            command.AddInParameter("@CodeProductUnitMeasure", DbType.String, eProduct.CodeProductUnitMeasure);
            command.AddInParameter("@CodeProductModel", DbType.String, eProduct.CodeProductModel);
            command.AddInParameter("@CodeMoney", DbType.String, eProduct.CodeMoney);
            command.AddInParameter("@CodeProductRecet", DbType.String, eProduct.CodeProductRecet);
            command.AddInParameter("@CodeSunatProductTaxRV", DbType.String, eProduct.CodeSunatProductTaxRV);
            command.AddInParameter("@CodeSunatProductTaxRC", DbType.String, eProduct.CodeSunatProductTaxRC);
            command.AddInParameter("@UseRecet", DbType.Boolean, eProduct.UseRecet);
            command.AddInParameter("@CodeBar", DbType.String, eProduct.CodeBar);
            command.AddInParameter("@CodeIntern", DbType.String, eProduct.CodeIntern);
            command.AddInParameter("@DescriptionForStore", DbType.String, eProduct.DescriptionForStore);
            command.AddInParameter("@DescriptionForSale", DbType.String, eProduct.DescriptionForSale);
            command.AddInParameter("@DescriptionShortForStore", DbType.String, eProduct.DescriptionShortForStore);
            command.AddInParameter("@PriceCostMoneyNational", DbType.Decimal, eProduct.PriceCostMoneyNational);
            command.AddInParameter("@PriceCostMoneyForeign", DbType.Decimal, eProduct.PriceCostMoneyForeign);
            command.AddInParameter("@PriceSaleMoneyNational", DbType.Decimal, eProduct.PriceSaleMoneyNational);
            command.AddInParameter("@PriceSaleMoneyForeign", DbType.Decimal, eProduct.PriceSaleMoneyForeign);
            command.AddInParameter("@PriceCostAverage", DbType.Decimal, eProduct.PriceCostAverage);
            command.AddInParameter("@ActiveForSale", DbType.Boolean, eProduct.ActiveForSale);
            command.AddInParameter("@ActiveForBuy", DbType.Boolean, eProduct.ActiveForBuy);
            command.AddInParameter("@StockMinimun", DbType.Decimal, eProduct.StockMinimun);
            command.AddInParameter("@StockMaximun", DbType.Decimal, eProduct.StockMaximun);
            command.AddInParameter("@ValidateStock", DbType.Boolean, eProduct.ValidateStock);
            command.AddInParameter("@ValidateStock", DbType.Boolean, eProduct.ValidateStock);
            ExecuteNonQuery(command);
        }
Beispiel #30
0
 public override DataTable ExecuteDataTable(DaCommand Command)
 {
     try
     {
         SqlCommand store = GetCommand(Command);
         store.Connection = GetConnection();
         DataTable table = new DataTable();
         using (SqlDataReader reader = store.ExecuteReader())
         {
             table.Load(reader);
             reader.Close();
         }
         return(table);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         GetConnection().Close();
     }
 }