public void Update(EProductType eProductType) { eProductType.Validar(); dProductType.Update(eProductType); eProductType.Audit.TypeEvent = "Update"; bAudit.Insert(eProductType.Audit); }
public void Delete(EProductType eProductType) { DaCommand command = new DaCommand("ProductTypeDelete"); command.AddInParameter("@CodeProductType", DbType.String, eProductType.CodeProductType); ExecuteNonQuery(command); }
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; } }
public Product orderProduct(EProductType type, IAbstractFactroy abstractFactroy) { Product product = createProduct(type); product.abstractFactroy = abstractFactroy; product.start(); return product; }
public DataRow Select(EProductType eProductType) { DaCommand command = new DaCommand("ProductTypeSelect"); command.AddInParameter("@CodeProductType", DbType.String, eProductType.CodeProductType); return(ExecuteDataRow(command)); }
public Product(int id, string name, double price, EProductType type) { Id = id; Name = name; Price = price; Type = type; }
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; }
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); }
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); }
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); }
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); }
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; }
public Product(string name, string desc, EProductType type) { title = name; description = desc; the_type = type; }
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; }
public override Product createProduct(EProductType type) { return SimpleFactory.createProduct(type); }
public abstract Product createProduct(EProductType type);