public override void Refresh() { this._detail = AtAccountingCategoriesManager.Select(); this.bindingSource1.DataSource = this._detail; if (this.action == "insert") { Model.AtAccountingCategories pc = new Model.AtAccountingCategories(); this._detail.Add(pc); this.bindingSource1.DataSource = this._detail; this.bindingSource1.Position = this.bindingSource1.IndexOf(pc); this.gridControl1.RefreshDataSource(); } switch (this.action) { case "insert": this.gridView1.OptionsBehavior.Editable = true; break; case "update": this.gridView1.OptionsBehavior.Editable = true; break; case "view": this.gridView1.OptionsBehavior.Editable = false; break; default: break; } base.Refresh(); }
/// <summary> /// Insert a AtAccountingCategories. /// </summary> public void Insert(Model.AtAccountingCategories atAccountingCategories) { // // todo:add other logic here // atAccountingCategories.AccountingCategoriesId = Guid.NewGuid().ToString(); accessor.Insert(atAccountingCategories); }
public bool ExistsExcept(Model.AtAccountingCategories e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.AccountingCategoriesId) == null?null:Get(e.AccountingCategoriesId).Id); return(sqlmapper.QueryForObject <bool>("AtAccountingCategories.existsexcept", paras)); }
/// <summary> /// /// </summary> /// <param name="item"></param> public void MyClick(ref ChooseItem item) { ChooseAccountCategoriesForm f = new ChooseAccountCategoriesForm(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.AtAccountingCategories AtAccountingCategories = f.SelectedItem as Model.AtAccountingCategories; item = new ChooseItem(AtAccountingCategories, AtAccountingCategories.Id, AtAccountingCategories.AccountingCategoriesName); } }
public void MyLeave(ref ChooseItem item) { BL.AtAccountingCategoriesManager manager = new Book.BL.AtAccountingCategoriesManager(); Model.AtAccountingCategories AtAccountingCategories = manager.GetById(item.ButtonText); if (AtAccountingCategories != null) { item.EditValue = AtAccountingCategories; item.LabelText = AtAccountingCategories.AccountingCategoriesName; item.ButtonText = AtAccountingCategories.Id; } else { item.ErrorMessage = "物料類型錯誤"; } }
private void gridView1_KeyDown(object sender, KeyEventArgs e) { if (this.action == "insert" || this.action == "update") { if (e.KeyData == Keys.Enter) { Model.AtAccountingCategories pc = new Model.AtAccountingCategories(); this._detail.Add(pc); this.bindingSource1.Position = this.bindingSource1.IndexOf(pc); } if (e.KeyData == Keys.Delete) { this._detail.Remove(this.bindingSource1.Current as Model.AtAccountingCategories); } this.gridControl1.RefreshDataSource(); } }
public void Delete(Model.AtAccountingCategories atAccountingCategories) { this.Delete(atAccountingCategories.AccountingCategoriesId); }
public Model.AtAccountingCategories GetPrev(Model.AtAccountingCategories e) { return(sqlmapper.QueryForObject <Model.AtAccountingCategories>("AtAccountingCategories.get_prev", e)); }
public bool HasRowsAfter(Model.AtAccountingCategories e) { return(sqlmapper.QueryForObject <bool>("AtAccountingCategories.has_rows_after", e)); }
public bool HasRowsBefore(Model.AtAccountingCategories e) { return(sqlmapper.QueryForObject <bool>("AtAccountingCategories.has_rows_before", e)); }
public void Update(Model.AtAccountingCategories e) { this.Update <Model.AtAccountingCategories>(e); }
public void Insert(Model.AtAccountingCategories e) { this.Insert <Model.AtAccountingCategories>(e); }
public Model.AtAccountingCategories GetNext(Model.AtAccountingCategories e) { return(accessor.GetNext(e)); }
public bool HasRowsAfter(Model.AtAccountingCategories e) { return(accessor.HasRowsAfter(e)); }
public bool HasRowsBefore(Model.AtAccountingCategories e) { return(accessor.HasRowsBefore(e)); }
public bool ExistsExcept(Model.AtAccountingCategories e) { return(accessor.ExistsExcept(e)); }