/// <summary> /// 删除 /// </summary> protected override void Delete() { if (this.AtAccountingCategory == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } try { this.AtAccountingCategoryManager.Delete(this.AtAccountingCategory.AccountingCategoryId); this.AtAccountingCategory = this.AtAccountingCategoryManager.GetNext(this.AtAccountingCategory); if (this.AtAccountingCategory == null) { this.AtAccountingCategory = this.AtAccountingCategoryManager.GetLast(); } } catch { throw new Exception(""); } return; }
public bool ExistsExcept(Model.AtAccountingCategory e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.AccountingCategoryId) == null?null:Get(e.AccountingCategoryId).Id); return(sqlmapper.QueryForObject <bool>("AtAccountingCategory.existsexcept", paras)); }
/// <summary> /// Update a AtAccountingCategory. /// </summary> public void Update(Model.AtAccountingCategory atAccountingCategory) { // // todo: add other logic here. // Validate(atAccountingCategory); atAccountingCategory.UpdateTime = DateTime.Now; accessor.Update(atAccountingCategory); }
/// <summary> /// Insert a AtAccountingCategory. /// </summary> public void Insert(Model.AtAccountingCategory atAccountingCategory) { // // todo:add other logic here // Validate(atAccountingCategory); atAccountingCategory.InsertTime = DateTime.Now; atAccountingCategory.AccountingCategoryId = Guid.NewGuid().ToString(); accessor.Insert(atAccountingCategory); }
protected override void MoveNext() { Model.AtAccountingCategory AtAccountingCategory = this.AtAccountingCategoryManager.GetNext(this.AtAccountingCategory); if (AtAccountingCategory == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.AtAccountingCategory = AtAccountingCategory; }
/// <summary> /// /// </summary> /// <param name="item"></param> public void MyClick(ref ChooseItem item) { ChooseAccountingCategoryForm f = new ChooseAccountingCategoryForm(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.AtAccountingCategory AtAccountingCategory = f.SelectedItem as Model.AtAccountingCategory; item = new ChooseItem(AtAccountingCategory, AtAccountingCategory.Id, AtAccountingCategory.AccountingCategoryName); } }
public void MyLeave(ref ChooseItem item) { BL.AtAccountingCategoryManager manager = new Book.BL.AtAccountingCategoryManager(); Model.AtAccountingCategory AtAccountingCategory = manager.GetById(item.ButtonText); if (AtAccountingCategory != null) { item.EditValue = AtAccountingCategory; item.LabelText = AtAccountingCategory.AccountingCategoryName; item.ButtonText = AtAccountingCategory.Id; } else { item.ErrorMessage = "物料類型錯誤"; } }
private void Validate(Model.AtAccountingCategory atAccountingCategory) { if (string.IsNullOrEmpty(atAccountingCategory.Id)) { throw new Helper.RequireValueException(Model.AtAccountingCategory.PRO_Id); } if (string.IsNullOrEmpty(atAccountingCategory.AccountingCategoriesId)) { throw new Helper.RequireValueException(Model.AtAccountingCategory.PRO_AccountingCategoriesId); } if (string.IsNullOrEmpty(atAccountingCategory.AccountingCategoryName)) { throw new Helper.RequireValueException(Model.AtAccountingCategory.PRO_AccountingCategoryName); } }
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.AtAccountingCategory productEpiboly = this.bindingSource1.Current as Model.AtAccountingCategory; if (productEpiboly != null) { this.AtAccountingCategory = productEpiboly; this.action = "view"; this.Refresh(); } } }
public override void Refresh() { if (this.AtAccountingCategory == null) { this.AtAccountingCategory = new Book.Model.AtAccountingCategory(); this.action = "insert"; } this.bindingSource1.DataSource = this.AtAccountingCategoryManager.Select(); this.newChooseContorlAccountingCategoriesId.EditValue = this.AtAccountingCategory.AccountingCategories; this.textEditAccountingCategoryId.Text = this.AtAccountingCategory.Id; this.textEditAccountingCategoryName.Text = this.AtAccountingCategory.AccountingCategoryName; this.textEditEnglishName.Text = this.AtAccountingCategory.EnglishName; switch (this.action) { case "insert": this.newChooseContorlAccountingCategoriesId.ShowButton = true; this.newChooseContorlAccountingCategoriesId.ButtonReadOnly = false; this.textEditAccountingCategoryId.Properties.ReadOnly = false; this.textEditAccountingCategoryName.Properties.ReadOnly = false; this.textEditEnglishName.Properties.ReadOnly = false; break; case "update": this.newChooseContorlAccountingCategoriesId.ShowButton = true; this.newChooseContorlAccountingCategoriesId.ButtonReadOnly = false; this.textEditAccountingCategoryId.Properties.ReadOnly = false; this.textEditAccountingCategoryName.Properties.ReadOnly = false; this.textEditEnglishName.Properties.ReadOnly = false; break; case "view": this.newChooseContorlAccountingCategoriesId.ShowButton = false; this.newChooseContorlAccountingCategoriesId.ButtonReadOnly = true; this.textEditAccountingCategoryId.Properties.ReadOnly = true; this.textEditAccountingCategoryName.Properties.ReadOnly = true; this.textEditEnglishName.Properties.ReadOnly = true; break; default: break; } base.Refresh(); }
public bool HasRowsBefore(Model.AtAccountingCategory e) { return(sqlmapper.QueryForObject <bool>("AtAccountingCategory.has_rows_before", e)); }
protected override void MoveLast() { this.AtAccountingCategory = this.AtAccountingCategoryManager.GetLast(); }
public bool HasRowsAfter(Model.AtAccountingCategory e) { return(accessor.HasRowsAfter(e)); }
public void Insert(Model.AtAccountingCategory e) { this.Insert <Model.AtAccountingCategory>(e); }
public Model.AtAccountingCategory GetNext(Model.AtAccountingCategory e) { return(accessor.GetNext(e)); }
public void Update(Model.AtAccountingCategory e) { this.Update <Model.AtAccountingCategory>(e); }
public Model.AtAccountingCategory GetPrev(Model.AtAccountingCategory e) { return(sqlmapper.QueryForObject <Model.AtAccountingCategory>("AtAccountingCategory.get_prev", e)); }
public Model.AtAccountingCategory GetNext(Model.AtAccountingCategory e) { return(sqlmapper.QueryForObject <Model.AtAccountingCategory>("AtAccountingCategory.get_next", e)); }
public bool HasRowsBefore(Model.AtAccountingCategory e) { return(accessor.HasRowsBefore(e)); }
protected override void AddNew() { this.AtAccountingCategory = new Model.AtAccountingCategory(); }
public bool HasRowsAfter(Model.AtAccountingCategory e) { return(sqlmapper.QueryForObject <bool>("AtAccountingCategory.has_rows_after", e)); }
public bool ExistsExcept(Model.AtAccountingCategory e) { return(accessor.ExistsExcept(e)); }