/// <summary> /// Update a AtCurrencyCategory. /// </summary> public void Update(Model.AtCurrencyCategory atCurrencyCategory) { // // todo: add other logic here. // Validate(atCurrencyCategory); accessor.Update(atCurrencyCategory); }
public bool ExistsExcept(Model.AtCurrencyCategory e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.AtCurrencyCategoryId) == null?null:Get(e.AtCurrencyCategoryId).Id); return(sqlmapper.QueryForObject <bool>("AtCurrencyCategory.existsexcept", paras)); }
/// <summary> /// Insert a AtCurrencyCategory. /// </summary> public void Insert(Model.AtCurrencyCategory atCurrencyCategory) { // // todo:add other logic here // Validate(atCurrencyCategory); atCurrencyCategory.AtCurrencyCategoryId = Guid.NewGuid().ToString(); accessor.Insert(atCurrencyCategory); }
/// <summary> /// /// </summary> /// <param name="item"></param> public void MyClick(ref ChooseItem item) { ChooseAtCurrencyCategoryForm f = new ChooseAtCurrencyCategoryForm(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.AtCurrencyCategory AtCurrencyCategory = f.SelectedItem as Model.AtCurrencyCategory; item = new ChooseItem(AtCurrencyCategory, AtCurrencyCategory.Id, AtCurrencyCategory.AtCurrencyName); } }
private void Validate(Model.AtCurrencyCategory atCurrencyCategory) { if (string.IsNullOrEmpty(atCurrencyCategory.Id)) { throw new Helper.RequireValueException(Model.AtCurrencyCategory.PRO_Id); } if (string.IsNullOrEmpty(atCurrencyCategory.AtCurrencyName)) { throw new Helper.RequireValueException(Model.AtCurrencyCategory.PRO_AtCurrencyName); } }
public void MyLeave(ref ChooseItem item) { BL.AtCurrencyCategoryManager manager = new Book.BL.AtCurrencyCategoryManager(); Model.AtCurrencyCategory AtCurrencyCategory = manager.GetById(item.ButtonText); if (AtCurrencyCategory != null) { item.EditValue = AtCurrencyCategory; item.LabelText = AtCurrencyCategory.AtCurrencyName; item.ButtonText = AtCurrencyCategory.Id; } else { item.ErrorMessage = "物料類型錯誤"; } }
private void gridView1_Click_1(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.AtCurrencyCategory productEpiboly = this.bindingSource1.Current as Model.AtCurrencyCategory; if (productEpiboly != null) { this.AtCurrencyCategory = productEpiboly; this.action = "view"; this.Refresh(); } } }
public override void Refresh() { if (this.AtCurrencyCategory == null) { this.AtCurrencyCategory = new Book.Model.AtCurrencyCategory(); this.action = "insert"; } this.bindingSource1.DataSource = this.AtCurrencyCategoryManager.Select(); this.textEditId.Text = this.AtCurrencyCategory.Id; this.textEditName.Text = this.AtCurrencyCategory.AtCurrencyName; this.textEditEnglishName.Text = this.AtCurrencyCategory.EnglishName; switch (this.action) { case "insert": this.textEditId.Properties.ReadOnly = false; this.textEditName.Properties.ReadOnly = false; this.textEditEnglishName.Properties.ReadOnly = false; break; case "update": this.textEditId.Properties.ReadOnly = false; this.textEditName.Properties.ReadOnly = false; this.textEditEnglishName.Properties.ReadOnly = false; break; case "view": this.textEditId.Properties.ReadOnly = true; this.textEditName.Properties.ReadOnly = true; this.textEditEnglishName.Properties.ReadOnly = true; break; default: break; } base.Refresh(); }
protected override void AddNew() { this.AtCurrencyCategory = new Model.AtCurrencyCategory(); }
public void Update(Model.AtCurrencyCategory e) { this.Update <Model.AtCurrencyCategory>(e); }
public void Insert(Model.AtCurrencyCategory e) { this.Insert <Model.AtCurrencyCategory>(e); }
public bool ExistsExcept(Model.AtCurrencyCategory e) { return(accessor.ExistsExcept(e)); }