private void Validate(Model.CurrencyCategory currencyCategory) { if (string.IsNullOrEmpty(currencyCategory.AtCurrencyCategoryId)) { throw new Helper.RequireValueException(Model.CurrencyCategory.PRO_AtCurrencyCategoryId); } }
/// <summary> /// Update a CurrencyCategory. /// </summary> public void Update(Model.CurrencyCategory currencyCategory) { // // todo: add other logic here. // Validate(currencyCategory); accessor.Update(currencyCategory); }
/// <summary> /// Insert a CurrencyCategory. /// </summary> public void Insert(Model.CurrencyCategory currencyCategory) { // // todo:add other logic here // Validate(currencyCategory); currencyCategory.CurrencyCategoryId = Guid.NewGuid().ToString(); accessor.Insert(currencyCategory); }
protected override void AddNew() { this.CurrencyCategory = new Model.CurrencyCategory(); IList <Model.CurrencyCategory> cc = CurrencyCategoryManager.SelectByEffectDate(); if (cc != null) { if (cc.Count > 0) { this.CurrencyCategory.ExchangeFloat = cc[0].ExchangeFloat; } } }
private void gridView1_Click(object sender, EventArgs e) { GridView view = sender as GridView; GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Cursor.Position)); if (hitInfo.InRow && !view.IsGroupRow(hitInfo.RowHandle)) { Model.CurrencyCategory productEpiboly = this.bindingSource1.Current as Model.CurrencyCategory; if (productEpiboly != null) { this.CurrencyCategory = productEpiboly; this.action = "view"; this.Refresh(); } } }
public override void Refresh() { if (this.CurrencyCategory == null) { this.CurrencyCategory = new Book.Model.CurrencyCategory(); this.action = "insert"; } this.bindingSource1.DataSource = this.CurrencyCategoryManager.Select(); this.newChooseContorlAtCurrencyCategoryId.EditValue = this.CurrencyCategory.AtCurrencyCategory; this.spinEditAdjustExchangeRate.EditValue = this.CurrencyCategory.AdjustExchangeRate; this.spinEditExchangeFloat.EditValue = this.CurrencyCategory.ExchangeFloat; this.spinEditExchangeRate.EditValue = this.CurrencyCategory.ExchangeRate; this.spinEditMaxError.EditValue = this.CurrencyCategory.MaxError; if (global::Helper.DateTimeParse.DateTimeEquls(this.CurrencyCategory.EffectDate, global::Helper.DateTimeParse.NullDate)) { this.dateEditEffectDate.EditValue = null; } else { this.dateEditEffectDate.EditValue = this.CurrencyCategory.EffectDate; } if (this.CurrencyCategory.ConvertModel == 0) { this.radioGroupConvertModel.SelectedIndex = 0; } else { this.radioGroupConvertModel.SelectedIndex = 1; } if (this.CurrencyCategory.ExchangeRateModel == 0) { this.radioGroupExchangeRateModel.SelectedIndex = 0; } else { this.radioGroupExchangeRateModel.SelectedIndex = 1; } switch (this.action) { case "insert": this.newChooseContorlAtCurrencyCategoryId.ShowButton = true; this.newChooseContorlAtCurrencyCategoryId.ButtonReadOnly = false; this.spinEditAdjustExchangeRate.Properties.ReadOnly = false; this.spinEditExchangeFloat.Properties.ReadOnly = false; this.spinEditExchangeRate.Properties.ReadOnly = false; this.spinEditMaxError.Properties.ReadOnly = false; this.dateEditEffectDate.Properties.ReadOnly = false; this.dateEditEffectDate.Properties.Buttons[0].Visible = true; this.radioGroupConvertModel.Properties.ReadOnly = false; this.radioGroupExchangeRateModel.Properties.ReadOnly = false; break; case "update": this.newChooseContorlAtCurrencyCategoryId.ShowButton = true; this.newChooseContorlAtCurrencyCategoryId.ButtonReadOnly = false; this.spinEditAdjustExchangeRate.Properties.ReadOnly = false; this.spinEditExchangeFloat.Properties.ReadOnly = false; this.spinEditExchangeRate.Properties.ReadOnly = false; this.spinEditMaxError.Properties.ReadOnly = false; this.dateEditEffectDate.Properties.ReadOnly = false; this.dateEditEffectDate.Properties.Buttons[0].Visible = true; this.radioGroupConvertModel.Properties.ReadOnly = false; this.radioGroupExchangeRateModel.Properties.ReadOnly = false; break; case "view": this.newChooseContorlAtCurrencyCategoryId.ShowButton = false; this.newChooseContorlAtCurrencyCategoryId.ButtonReadOnly = true; this.spinEditAdjustExchangeRate.Properties.ReadOnly = true; this.spinEditExchangeFloat.Properties.ReadOnly = true; this.spinEditExchangeRate.Properties.ReadOnly = true; this.spinEditMaxError.Properties.ReadOnly = true; this.dateEditEffectDate.Properties.ReadOnly = true; this.dateEditEffectDate.Properties.Buttons[0].Visible = false; this.radioGroupConvertModel.Properties.ReadOnly = true; this.radioGroupExchangeRateModel.Properties.ReadOnly = true; break; default: break; } base.Refresh(); }
public void Update(Model.CurrencyCategory e) { this.Update <Model.CurrencyCategory>(e); }
public void Insert(Model.CurrencyCategory e) { this.Insert <Model.CurrencyCategory>(e); }