예제 #1
0
        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));
        }
예제 #2
0
        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));
        }
예제 #3
0
 /// <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);
 }
예제 #4
0
 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();
     }
 }
예제 #5
0
 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();
 }
예제 #6
0
        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();
        }
예제 #7
0
 public bool ExistsExcept(Model.MouldCategory e)
 {
     return(accessor.ExistsExcept(e));
 }
예제 #8
0
 public Model.MouldCategory GetPrev(Model.MouldCategory e)
 {
     return(sqlmapper.QueryForObject <Model.MouldCategory>("MouldCategory.get_prev", e));
 }
예제 #9
0
 public Model.MouldCategory GetNext(Model.MouldCategory e)
 {
     return(sqlmapper.QueryForObject <Model.MouldCategory>("MouldCategory.get_next", e));
 }
예제 #10
0
 public bool HasRowsAfter(Model.MouldCategory e)
 {
     return(sqlmapper.QueryForObject <bool>("MouldCategory.has_rows_after", e));
 }
예제 #11
0
 public bool HasRowsBefore(Model.MouldCategory e)
 {
     return(sqlmapper.QueryForObject <bool>("MouldCategory.has_rows_before", e));
 }
예제 #12
0
 public bool IsExistId(Model.MouldCategory mould)
 {
     return(accessor.IsExistId(mould));
 }
예제 #13
0
 public Model.MouldCategory GetPrev(Model.MouldCategory e)
 {
     return(accessor.GetPrev(e));
 }
예제 #14
0
 protected override void MoveLast()
 {
     this.mouldCategory = this.mouldCateManager.GetLast();
 }
예제 #15
0
 protected override void AddNew()
 {
     this.mouldCategory = new Book.Model.MouldCategory();
     this.mouldCategory.MouldCategoryId = Guid.NewGuid().ToString();
 }
예제 #16
0
 public bool HasRowsBefore(Model.MouldCategory e)
 {
     return(accessor.HasRowsBefore(e));
 }
예제 #17
0
 public IList <Model.ProductMould> SelectByDateRage(DateTime StartDate, DateTime EndDate, string MouldId, string MouldName, Model.MouldCategory mouldCategory)
 {
     return(accessor.SelectByDateRage(StartDate, EndDate, MouldId, MouldName, mouldCategory));
 }
예제 #18
0
 public bool HasRowsAfter(Model.MouldCategory e)
 {
     return(accessor.HasRowsAfter(e));
 }
예제 #19
0
 /// <summary>
 /// Update a MouldCategory.
 /// </summary>
 public void Update(Model.MouldCategory mouldCategory)
 {
     validate(mouldCategory);
     mouldCategory.UpdateTime = DateTime.Now;
     accessor.Update(mouldCategory);
 }
예제 #20
0
 public Model.MouldCategory GetNext(Model.MouldCategory e)
 {
     return(accessor.GetNext(e));
 }
예제 #21
0
 public void Insert(Model.MouldCategory e)
 {
     this.Insert <Model.MouldCategory>(e);
 }
예제 #22
0
 public void Update(Model.MouldCategory e)
 {
     this.Update <Model.MouldCategory>(e);
 }
예제 #23
0
        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));
        }