protected override void MoveLast() { if (this.action == "view") { this._productMouldCategory = this._manage.GetLast(); } }
public bool ExistsExcept(Model.ProductMouldCategory e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.ProductMouldCategoryId) == null?null:Get(e.ProductMouldCategoryId).Id); return(sqlmapper.QueryForObject <bool>("ProductMouldCategory.existsexcept", paras)); }
/// <summary> /// Update a ProductMouldCategory. /// </summary> public void Update(Model.ProductMouldCategory productMouldCategory) { // // todo: add other logic here. // Validate(productMouldCategory); productMouldCategory.UpdateTime = DateTime.Now; accessor.Update(productMouldCategory); }
protected override void MovePrev() { Model.ProductMouldCategory model = this._manage.GetPrev(this._productMouldCategory); if (model == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this._productMouldCategory = model; }
private void Validate(Model.ProductMouldCategory model) { if (string.IsNullOrEmpty(model.Id)) { throw new Helper.InvalidValueException(Model.ProductMouldCategory.PRO_Id); } if (string.IsNullOrEmpty(model.CategoryName)) { throw new Helper.InvalidValueException(Model.ProductMouldCategory.PRO_CategoryName); } }
private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { this._productMouldCategory = this.bindingSource1.Current as Model.ProductMouldCategory; if (this._productMouldCategory != null) { this.action = "view"; this.txt_Id.Text = this._productMouldCategory.Id; this.txt_Name.Text = this._productMouldCategory.CategoryName; this.memoEditDes.Text = this._productMouldCategory.CategoryDes; this.Refresh(); } }
protected override void Delete() { if (this._productMouldCategory == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) { return; } this._manage.Delete(this._productMouldCategory.ProductMouldCategoryId); this._productMouldCategory = this._manage.GetNext(this._productMouldCategory); if (this._productMouldCategory == null) { this._productMouldCategory = this._manage.GetLast(); } }
protected override void AddNew() { this._productMouldCategory = new Book.Model.ProductMouldCategory(); this._productMouldCategory.ProductMouldCategoryId = Guid.NewGuid().ToString(); this.action = "insert"; }
public Model.ProductMouldCategory GetPrev(Model.ProductMouldCategory e) { return(sqlmapper.QueryForObject <Model.ProductMouldCategory>("ProductMouldCategory.get_prev", e)); }
public Model.ProductMouldCategory GetNext(Model.ProductMouldCategory e) { return(sqlmapper.QueryForObject <Model.ProductMouldCategory>("ProductMouldCategory.get_next", e)); }
public bool HasRowsAfter(Model.ProductMouldCategory e) { return(sqlmapper.QueryForObject <bool>("ProductMouldCategory.has_rows_after", e)); }
public bool HasRowsBefore(Model.ProductMouldCategory e) { return(accessor.HasRowsBefore(e)); }
public void Insert(Model.ProductMouldCategory e) { this.Insert <Model.ProductMouldCategory>(e); }
public Model.ProductMouldCategory GetNext(Model.ProductMouldCategory e) { return(accessor.GetNext(e)); }
public bool HasRowsAfter(Model.ProductMouldCategory e) { return(accessor.HasRowsAfter(e)); }
protected override void MoveFirst() { this._productMouldCategory = this._manage.GetFirst(); }
public void Update(Model.ProductMouldCategory e) { this.Update <Model.ProductMouldCategory>(e); }
public bool HasRowsBefore(Model.ProductMouldCategory e) { return(sqlmapper.QueryForObject <bool>("ProductMouldCategory.has_rows_before", e)); }
public bool ExistsExcept(Model.ProductMouldCategory e) { return(accessor.ExistsExcept(e)); }