public ContractCollateralForm(CollateralProduct product) { this.product = product; contractCollateral = new ContractCollateral(); myProperties = new CustomClass(); collections = new CollectionList(); InitializeComponent(); FillCollateralProperties(); }
private void FillCollateralPropertyValues(ContractCollateral contractCollateral) { foreach (CollateralPropertyValue propertyValue in contractCollateral.PropertyValues) { CustomProperty myProp = null; if (propertyValue.Property.Type == OCollateralPropertyTypes.Number) { myProp = new CustomProperty(propertyValue.Property.Name, propertyValue.Property.Description, Converter.CustomFieldValueToDecimal(propertyValue.Value), typeof(decimal), false, true); } else if (propertyValue.Property.Type == OCollateralPropertyTypes.String) { myProp = new CustomProperty(propertyValue.Property.Name, propertyValue.Property.Description, propertyValue.Value, typeof(string), false, true); } else if (propertyValue.Property.Type == OCollateralPropertyTypes.Date) { myProp = new CustomProperty(propertyValue.Property.Name, propertyValue.Property.Description, Converter.CustomFieldValueToDate(propertyValue.Value), typeof(DateTime), false, true); } else if (propertyValue.Property.Type == OCollateralPropertyTypes.Collection) { if (propertyValue.Value != null) { Collection.Items = propertyValue.Property.Collection; collections.Add(propertyValue.Property.Name, propertyValue.Property.Collection); myProp = new CustomProperty(propertyValue.Property.Name, propertyValue.Property.Description, Collection.Items[int.Parse(propertyValue.Value)], typeof(CollectionType), false, true); } else { Collection.Items = propertyValue.Property.Collection; collections.Add(propertyValue.Property.Name, propertyValue.Property.Collection); myProp = new CustomProperty(propertyValue.Property.Name, propertyValue.Property.Description, string.Empty, typeof(CollectionType), false, true); } } else if (propertyValue.Property.Type == OCollateralPropertyTypes.Owner) { if (propertyValue.Value != null) { Person client = (Person)ServicesProvider.GetInstance().GetClientServices().FindTiers(int.Parse(propertyValue.Value), OClientTypes.Person); myProp = new CustomProperty(propertyValue.Property.Name, propertyValue.Property.Description, client, typeof(Person), false, true); } else { myProp = new CustomProperty(propertyValue.Property.Name, propertyValue.Property.Description, string.Empty, typeof(Person), false, true); } } myProperties.Add(myProp); } propertyGrid.Refresh(); }
public ContractCollateralForm(CollateralProduct product, ContractCollateral contractCollateral, bool isView) { this.product = product; this.contractCollateral = contractCollateral; myProperties = new CustomClass(); collections = new CollectionList(); InitializeComponent(); FillCollateralPropertyValues(contractCollateral); if (isView) { propertyGrid.Enabled = false; groupBoxOwnerDetails.Enabled = false; buttonSave.Enabled = false; } }
public ContractCollateralForm(CollateralProduct product, bool isView, IApplicationController applicationController) { _applicationController = applicationController; this.product = product; contractCollateral = new ContractCollateral(); myProperties = new CustomClass(); collections = new CollectionList(); InitializeComponent(); FillCollateralProperties(); if (isView) { propertyGrid.Enabled = false; groupBoxOwnerDetails.Enabled = false; buttonSave.Enabled = false; } }
private void buttonCancel_Click(object sender, EventArgs e) { contractCollateral = null; Close(); }