Example #1
0
 protected override void MoveLast()
 {
     if (this.action == "view")
     {
         this._productMouldCategory = this._manage.GetLast();
     }
 }
Example #2
0
        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));
        }
Example #3
0
 /// <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);
 }
Example #4
0
 protected override void MovePrev()
 {
     Model.ProductMouldCategory model = this._manage.GetPrev(this._productMouldCategory);
     if (model == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._productMouldCategory = model;
 }
Example #5
0
 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);
     }
 }
Example #6
0
 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();
     }
 }
Example #7
0
 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();
     }
 }
Example #8
0
 protected override void AddNew()
 {
     this._productMouldCategory = new Book.Model.ProductMouldCategory();
     this._productMouldCategory.ProductMouldCategoryId = Guid.NewGuid().ToString();
     this.action = "insert";
 }
Example #9
0
 public Model.ProductMouldCategory GetPrev(Model.ProductMouldCategory e)
 {
     return(sqlmapper.QueryForObject <Model.ProductMouldCategory>("ProductMouldCategory.get_prev", e));
 }
Example #10
0
 public Model.ProductMouldCategory GetNext(Model.ProductMouldCategory e)
 {
     return(sqlmapper.QueryForObject <Model.ProductMouldCategory>("ProductMouldCategory.get_next", e));
 }
Example #11
0
 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));
 }
Example #13
0
 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));
 }
Example #16
0
 protected override void MoveFirst()
 {
     this._productMouldCategory = this._manage.GetFirst();
 }
Example #17
0
 public void Update(Model.ProductMouldCategory e)
 {
     this.Update <Model.ProductMouldCategory>(e);
 }
Example #18
0
 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));
 }