private void setBehaviorFromOperation(DbActionsEnum operation) { if (operation == DbActionsEnum.Show) { this.Text = "Datos del producto"; this.tbProductId.Text = this.originalProduct.Id.ToString(); this.tbProductCode.Text = this.originalProduct.Code.ToString(); this.tbProductName.Text = this.originalProduct.Name; this.cbProductStockable.Checked = this.originalProduct.Stockable; this.tbProductId.ReadOnly = true; this.tbProductCode.ReadOnly = true; this.tbProductName.ReadOnly = true; this.cbProductStockable.Enabled = true; this.bAccept.Visible = false; this.bCancel.Text = "Cerrar"; } else if (operation == DbActionsEnum.Create) { this.tbProductId.Enabled = false; this.Text = "Nuevo producto"; this.bAccept.Text = "Crear"; } else if (operation == DbActionsEnum.Update) { this.Text = "Modificar producto"; this.tbProductId.ReadOnly = true; this.tbProductId.Text = this.originalProduct.Id.ToString(); this.tbProductCode.Text = this.originalProduct.Code.ToString(); this.tbProductName.Text = this.originalProduct.Name; this.cbProductStockable.Checked = this.originalProduct.Stockable; this.bAccept.Text = "Modificar"; } }
private void setBehaviorFromOperation(DbActionsEnum operation) { if (operation == DbActionsEnum.Show) { this.Text = "Datos del teléfono"; this.tbPhone.Text = this.originalPhone.Phone; this.tbDescription.Text = this.originalPhone.Description; this.tbPhone.ReadOnly = true; this.tbDescription.ReadOnly = true; this.bAccept.Visible = false; this.bCancel.Text = "Cerrar"; } else if (operation == DbActionsEnum.Create) { this.Text = "Nuevo teléfono"; this.bAccept.Text = "Crear"; } else if (operation == DbActionsEnum.Update) { this.Text = "Modificar teléfono"; this.tbPhone.Text = this.originalPhone.Phone; this.tbDescription.Text = this.originalPhone.Description; this.bAccept.Text = "Modificar"; } }
public DialogResult ShowDialog(decimal data, DbActionsEnum operation) { this.originalData = data; if (operation != DbActionsEnum.Create) { this.nudQuantity.Value = data; } return(this.ShowDialog()); }
public DialogResult ShowDialog(decimal data, DbActionsEnum operation) { this.originalData = data; if (operation != DbActionsEnum.Create) { this.nudQuantity.Value = data; } return this.ShowDialog(); }
public DialogResult ShowDialog(QuantityUnitPrice data, DbActionsEnum operation) { this.originalData = data; if (operation != DbActionsEnum.Create) { this.nudQuantity.Value = data.Quantity; this.nudUnitPrice.Value = data.UnitPrice; } return(this.ShowDialog()); }
public DialogResult ShowDialog(QuantityUnitPrice data, DbActionsEnum operation) { this.originalData = data; if (operation != DbActionsEnum.Create) { this.nudQuantity.Value = data.Quantity; this.nudUnitPrice.Value = data.UnitPrice; } return this.ShowDialog(); }
public DialogResult ShowDialog(ProductDB product, DbActionsEnum operation) { if (operation == DbActionsEnum.Create) { this.originalProduct = null; } else { this.originalProduct = product; } this.setBehaviorFromOperation(operation); return this.ShowDialog(); }
public DialogResult ShowDialog(ProductDB product, DbActionsEnum operation) { if (operation == DbActionsEnum.Create) { this.originalProduct = null; } else { this.originalProduct = product; } this.setBehaviorFromOperation(operation); return(this.ShowDialog()); }
public DialogResult ShowDialog(ProviderPhoneDB providerPhone, DbActionsEnum operation) { if (operation == DbActionsEnum.Create) { this.originalPhone = null; } else { this.originalPhone = providerPhone; } this.setBehaviorFromOperation(operation); return this.ShowDialog(); }
public DialogResult ShowDialog(ProviderPhoneDB providerPhone, DbActionsEnum operation) { if (operation == DbActionsEnum.Create) { this.originalPhone = null; } else { this.originalPhone = providerPhone; } this.setBehaviorFromOperation(operation); return(this.ShowDialog()); }
public DialogResult ShowDialog(ProviderDB provider, DbActionsEnum operation) { this.operation = operation; if (operation != DbActionsEnum.Create) { this.originalProvider = provider; this.phones = new BindingList<ProviderPhoneDB>(DbValidation.Instance.searchProviderPhonesByProviderId((int)provider.Id)); } else { this.originalProvider = null; this.phones = new BindingList<ProviderPhoneDB>(); } this.updatePhones(); this.setBehaviorFromOperation(operation); return this.ShowDialog(); }
public DialogResult ShowDialog(ProviderDB provider, DbActionsEnum operation) { this.operation = operation; if (operation != DbActionsEnum.Create) { this.originalProvider = provider; this.phones = new BindingList <ProviderPhoneDB>(DbValidation.Instance.searchProviderPhonesByProviderId((int)provider.Id)); } else { this.originalProvider = null; this.phones = new BindingList <ProviderPhoneDB>(); } this.updatePhones(); this.setBehaviorFromOperation(operation); return(this.ShowDialog()); }
private void setBehaviorFromOperation(DbActionsEnum operation) { if (operation == DbActionsEnum.Show) { this.tbProviderId.Text = this.originalProvider.Id.ToString(); this.tbProviderName.Text = this.originalProvider.Name; this.tbProviderAddress.Text = this.originalProvider.Address; this.bPhoneShow.Enabled = false; this.bPhoneAdd.Enabled = false; this.bPhoneEdit.Enabled = false; this.bPhoneDelete.Enabled = false; this.tbProviderId.ReadOnly = true; this.tbProviderName.ReadOnly = true; this.tbProviderAddress.ReadOnly = true; this.Text = String.Format("Datos del proveedor {0}", this.originalProvider.Name); } else if (operation == DbActionsEnum.Create) { this.tbProviderId.Enabled = false; this.bPhoneShow.Enabled = false; this.bPhoneAdd.Enabled = true; this.bPhoneEdit.Enabled = false; this.bPhoneDelete.Enabled = false; this.Text = "Nuevo proveedor"; } else if (operation == DbActionsEnum.Update) { this.tbProviderId.Text = this.originalProvider.Id.ToString(); this.tbProviderName.Text = this.originalProvider.Name; this.tbProviderAddress.Text = this.originalProvider.Address; this.bPhoneShow.Enabled = false; this.bPhoneAdd.Enabled = true; this.bPhoneEdit.Enabled = false; this.bPhoneDelete.Enabled = false; this.tbProviderId.ReadOnly = true; this.Text = String.Format("Modificando proveedor {0}", this.originalProvider.Name); } }