Exemplo n.º 1
0
 public void Update(EProductType eProductType)
 {
     eProductType.Validar();
     dProductType.Update(eProductType);
     eProductType.Audit.TypeEvent = "Update";
     bAudit.Insert(eProductType.Audit);
 }
Exemplo n.º 2
0
        public void Delete(EProductType eProductType)
        {
            DaCommand command = new DaCommand("ProductTypeDelete");

            command.AddInParameter("@CodeProductType", DbType.String, eProductType.CodeProductType);
            ExecuteNonQuery(command);
        }
Exemplo n.º 3
0
        SetType(
            EProductType type)
        {
            lock (TypeGuard)
            {
                if (this.Type == type)
                {
                    return;
                }

                if (this.Type != EProductType.NA)
                {
                    // exception: if there is a multi-config build, and collation modules have been executed on one configuration
                    // prior to linking on another
                    if (EProductType.Executable == type && this.Type == EProductType.ApplicationBundle)
                    {
                        return;
                    }

                    throw new Bam.Core.Exception("Product type has already been set to {0}. Cannot change it to {1}",
                                                 this.Type.ToString(),
                                                 type.ToString());
                }

                this.Type = type;
            }
        }
Exemplo n.º 4
0
 public Product orderProduct(EProductType type, IAbstractFactroy abstractFactroy)
 {
     Product product = createProduct(type);
     product.abstractFactroy = abstractFactroy;
     product.start();
     return product;
 }
Exemplo n.º 5
0
        public DataRow Select(EProductType eProductType)
        {
            DaCommand command = new DaCommand("ProductTypeSelect");

            command.AddInParameter("@CodeProductType", DbType.String, eProductType.CodeProductType);
            return(ExecuteDataRow(command));
        }
Exemplo n.º 6
0
 public Product(int id, string name, double price, EProductType type)
 {
     Id    = id;
     Name  = name;
     Price = price;
     Type  = type;
 }
Exemplo n.º 7
0
        public int Load(string file)
        {
            int           rows         = 0;
            EProductType  eProductType = null;
            BProductType  bProductType = new BProductType();
            List <string> columns      = new List <string>();
            DataTable     table        = Epplus.ToDataTable(file);

            if (table != null)
            {
                table.Columns["Código"].ColumnName       = "CodeProductType";
                table.Columns["Descripción"].ColumnName  = "Description";
                table.Columns["Código Sunat"].ColumnName = "CodeSunatExistence";
                table.Columns["Estado"].ColumnName       = "State";

                columns = table.GetColumns();

                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    foreach (DataRow datarow in table.Rows)
                    {
                        eProductType = new EProductType(datarow, columns);
                        eProductType.Audit.UserRegister = "User Load";
                        bProductType.Insert(eProductType);

                        rows++;
                    }
                    ts.Complete();
                }
            }
            return(rows);
        }
 public OrderProductDto(Guid orderId, Guid productId, decimal value, int quantity, EProductType eProductType)
 {
     OrderId     = orderId;
     ProductId   = productId;
     Value       = value;
     Quantity    = quantity;
     ProductType = eProductType;
 }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
0
 public void Delete(EProductType eProductType)
 {
     dProductType.Delete(eProductType);
     if (dProductType.ExistsReference())
     {
         Message = string.Format("El tipo de Producto '{0}' tiene referencias en el Sistema, no se puede eliminar el registro.", eProductType.Description);
         throw new Exception(Message);
     }
     eProductType.Audit.TypeEvent = "Delete";
     bAudit.Insert(eProductType.Audit);
 }
Exemplo n.º 11
0
        public EProductType Select(EProductType eProductType)
        {
            EProductType  eResult = null;
            DataRow       dataRow;
            List <string> listColumns;

            dataRow = dProductType.Select(eProductType);
            if (dataRow != null)
            {
                listColumns = dataRow.GetColumns();
                eResult     = new EProductType(dataRow, listColumns);
            }
            return(eResult);
        }
Exemplo n.º 12
0
 public void Insert(EProductType eProductType)
 {
     eProductType.Validar();
     dProductType.Insert(eProductType);
     if (dProductType.ExistsPrimaryKey())
     {
         Message = string.Format("El código de tipo de producto '{0}' ya existe en el Sistema, no se puede crear el registro.", eProductType.CodeProductType);
         throw new Exception(Message);
     }
     if (dProductType.ExistsReference())
     {
         Message = string.Format("El código de Sunat '{0}' no existe en el Sistema", eProductType.CodeSunatExistence);
         throw new Exception(Message);
     }
     eProductType.Audit.TypeEvent = "Insert";
     bAudit.Insert(eProductType.Audit);
 }
Exemplo n.º 13
0
        public static Product createProduct(EProductType type)
        {
            Product product = null;
            switch (type)
            {
                case EProductType.FEILIAO:
                    {
                        product = new Feiliao();
                        break;
                    }

                case EProductType.FEIXIN:
                    {
                        product = new Feixin();
                        break;
                    }

                default:
                    {
                        break;
                    }
            }
            return product;
        }
Exemplo n.º 14
0
 public Product(string name, string desc, EProductType type)
 {
     title       = name;
     description = desc;
     the_type    = type;
 }
Exemplo n.º 15
0
        private void SetProductType(
            EProductType type)
        {
            if (this.Type == type)
            {
                return;
            }

            if (this.Type != EProductType.NA)
            {
                // exception: if there is a multi-config build, and collation modules have been executed on one configuration
                // prior to linking on another
                if (EProductType.Executable == type && this.Type == EProductType.ApplicationBundle)
                {
                    return;
                }

                throw new Bam.Core.Exception("Product type has already been set to {0}. Cannot change it to {1}",
                    this.Type.ToString(),
                    type.ToString());
            }

            this.Type = type;
        }
Exemplo n.º 16
0
 public override Product createProduct(EProductType type)
 {
     return SimpleFactory.createProduct(type);
 }
Exemplo n.º 17
0
 public abstract Product createProduct(EProductType type);