public bool ExistsExcept(Model.MouldCategory e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.MouldCategoryId).Id); return(sqlmapper.QueryForObject <bool>("MouldCategory.existsexcept", paras)); }
public bool IsExistId(Model.MouldCategory mould) { Hashtable ht = new Hashtable(); ht.Add("mid", mould.MouldCategoryId == null ? "" : mould.MouldCategoryId); ht.Add("id", mould.Id); return(sqlmapper.QueryForObject <bool>("MouldCategory.IsExistId", ht)); }
/// <summary> /// Insert a MouldCategory. /// </summary> public void Insert(Model.MouldCategory mouldCategory) { validate(mouldCategory); mouldCategory.InsertTime = DateTime.Now; mouldCategory.UpdateTime = DateTime.Now; mouldCategory.MouldCategoryId = Guid.NewGuid().ToString(); accessor.Insert(mouldCategory); }
private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) { this.mouldCategory = this.bindingSource1.Current as Model.MouldCategory; if (mouldCategory != null) { this.action = "view"; this.textEditId.Text = this.mouldCategory.Id; this.textEditMouldCategoryName.Text = this.mouldCategory.MouldCategoryName; this.memoEditMouldCategoryDescription.Text = this.mouldCategory.MouldCategoryDescription; this.Refresh(); } }
protected override void Delete() { //if (this.mouldCategory == null) // return; if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } Model.MouldCategory mouldCategory = this.bindingSource1.Current as Model.MouldCategory; this.mouldCateManager.Delete(mouldCategory.MouldCategoryId); //this.mouldCategory = this.mouldCateManager.GetNext(this.mouldCategory); //if (this.mouldCategory == null) // this.mouldCategory = this.mouldCateManager.GetLast(); }
public override void Refresh() { if (this.mouldCategory == null) { this.AddNew(); this.action = "insert"; } if (this.action == "view") { this.mouldCategory = this.mouldCateManager.Get(this.mouldCategory.MouldCategoryId); } this.textEditId.Text = this.mouldCategory.Id; this.textEditMouldCategoryName.Text = this.mouldCategory.MouldCategoryName; this.memoEditMouldCategoryDescription.Text = this.mouldCategory.MouldCategoryDescription; this.bindingSource1.DataSource = this.mouldCateManager.Select(); base.Refresh(); }
public bool ExistsExcept(Model.MouldCategory e) { return(accessor.ExistsExcept(e)); }
public Model.MouldCategory GetPrev(Model.MouldCategory e) { return(sqlmapper.QueryForObject <Model.MouldCategory>("MouldCategory.get_prev", e)); }
public Model.MouldCategory GetNext(Model.MouldCategory e) { return(sqlmapper.QueryForObject <Model.MouldCategory>("MouldCategory.get_next", e)); }
public bool HasRowsAfter(Model.MouldCategory e) { return(sqlmapper.QueryForObject <bool>("MouldCategory.has_rows_after", e)); }
public bool HasRowsBefore(Model.MouldCategory e) { return(sqlmapper.QueryForObject <bool>("MouldCategory.has_rows_before", e)); }
public bool IsExistId(Model.MouldCategory mould) { return(accessor.IsExistId(mould)); }
public Model.MouldCategory GetPrev(Model.MouldCategory e) { return(accessor.GetPrev(e)); }
protected override void MoveLast() { this.mouldCategory = this.mouldCateManager.GetLast(); }
protected override void AddNew() { this.mouldCategory = new Book.Model.MouldCategory(); this.mouldCategory.MouldCategoryId = Guid.NewGuid().ToString(); }
public bool HasRowsBefore(Model.MouldCategory e) { return(accessor.HasRowsBefore(e)); }
public IList <Model.ProductMould> SelectByDateRage(DateTime StartDate, DateTime EndDate, string MouldId, string MouldName, Model.MouldCategory mouldCategory) { return(accessor.SelectByDateRage(StartDate, EndDate, MouldId, MouldName, mouldCategory)); }
public bool HasRowsAfter(Model.MouldCategory e) { return(accessor.HasRowsAfter(e)); }
/// <summary> /// Update a MouldCategory. /// </summary> public void Update(Model.MouldCategory mouldCategory) { validate(mouldCategory); mouldCategory.UpdateTime = DateTime.Now; accessor.Update(mouldCategory); }
public Model.MouldCategory GetNext(Model.MouldCategory e) { return(accessor.GetNext(e)); }
public void Insert(Model.MouldCategory e) { this.Insert <Model.MouldCategory>(e); }
public void Update(Model.MouldCategory e) { this.Update <Model.MouldCategory>(e); }
public IList <Model.ProductMould> SelectByDateRage(DateTime StartDate, DateTime EndDate, string MouldId, string MouldName, Model.MouldCategory mouldCategory) { Hashtable ht = new Hashtable(); ht.Add("StartDate", StartDate.ToString("yyyy-MM-dd HH:mm:ss")); ht.Add("EndDate", EndDate.ToString("yyyy-MM-dd HH:mm:ss")); StringBuilder sql = new StringBuilder(); if (!string.IsNullOrEmpty(MouldId)) { sql.Append(" And Id='" + MouldId + "'"); } if (!string.IsNullOrEmpty(MouldName)) { sql.Append(" And MouldName='" + MouldName + "'"); } if (mouldCategory != null) { sql.Append(" And MouldCategoryId='" + mouldCategory.MouldCategoryId + "'"); } sql.Append("ORDER BY StartTime DESC"); ht.Add("sql", sql); return(sqlmapper.QueryForList <Model.ProductMould>("ProductMould.SelectByDateRage", ht)); }