public bool ExistsExcept(Model.ProductMaterial e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.ProductMaterialId) == null?null:Get(e.ProductMaterialId).Id);
            return(sqlmapper.QueryForObject <bool>("ProductMaterial.existsexcept", paras));
        }
示例#2
0
 /// <summary>
 /// Insert a ProductMaterial.
 /// </summary>
 public void Insert(Model.ProductMaterial productMaterial)
 {
     validate(productMaterial);
     productMaterial.InsertTime        = DateTime.Now;
     productMaterial.UpdateTime        = DateTime.Now;
     productMaterial.ProductMaterialId = Guid.NewGuid().ToString();
     accessor.Insert(productMaterial);
 }
        public bool IsExistId(Model.ProductMaterial productMateridal)
        {
            Hashtable ht = new Hashtable();

            ht.Add("pid", productMateridal.ProductMaterialId == null ? "" : productMateridal.ProductMaterialId);
            ht.Add("id", productMateridal.Id);
            return(sqlmapper.QueryForObject <bool>("ProductMaterial.IsExistId", ht));
        }
 protected override void MovePrev()
 {
     Model.ProductMaterial pro = this.productMateManager.GetPrev(this.productMaterial);
     if (pro == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this.productMaterial = pro;
 }
 protected override void Delete()
 {
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     Model.ProductMaterial productMaterial = this.bindingSource1.Current as Model.ProductMaterial;
     this.productMateManager.Delete(productMaterial.ProductMaterialId);
 }
 private void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
 {
     this.productMaterial = this.bindingSource1.Current as Model.ProductMaterial;
     if (productMaterial != null)
     {
         this.action          = "view";
         this.textEditId.Text = this.productMaterial.Id;
         this.textEditProductMaterialName.Text        = this.productMaterial.ProductMaterialName;
         this.memoEditProductMaterialDescription.Text = this.productMaterial.ProductMaterialDescription;
         this.Refresh();
     }
 }
 public override void Refresh()
 {
     if (this.productMaterial == null)
     {
         this.AddNew();
         this.action = "insert";
     }
     else
     {
         this.productMaterial = this.productMateManager.Get(this.productMaterial.ProductMaterialId);
         if (this.productMaterial == null)
         {
             this.productMaterial = new Book.Model.ProductMaterial();
         }
     }
     this.textEditId.Text = this.productMaterial.Id;
     this.textEditProductMaterialName.Text        = this.productMaterial.ProductMaterialName;
     this.memoEditProductMaterialDescription.Text = this.productMaterial.ProductMaterialDescription;
     this.bindingSource1.DataSource = this.productMateManager.Select();
     base.Refresh();
 }
 public void Insert(Model.ProductMaterial e)
 {
     this.Insert <Model.ProductMaterial>(e);
 }
 public Model.ProductMaterial GetNext(Model.ProductMaterial e)
 {
     return(accessor.GetNext(e));
 }
示例#10
0
 public Model.ProductMaterial GetPrev(Model.ProductMaterial e)
 {
     return(accessor.GetPrev(e));
 }
示例#11
0
 public bool HasRowsAfter(Model.ProductMaterial e)
 {
     return(accessor.HasRowsAfter(e));
 }
示例#12
0
 public bool HasRowsBefore(Model.ProductMaterial e)
 {
     return(accessor.HasRowsBefore(e));
 }
示例#13
0
 public bool ExistsExcept(Model.ProductMaterial e)
 {
     return(accessor.ExistsExcept(e));
 }
 public Model.ProductMaterial GetPrev(Model.ProductMaterial e)
 {
     return(sqlmapper.QueryForObject <Model.ProductMaterial>("ProductMaterial.get_prev", e));
 }
 public void Update(Model.ProductMaterial e)
 {
     this.Update <Model.ProductMaterial>(e);
 }
 protected override void AddNew()
 {
     this.productMaterial = new Book.Model.ProductMaterial();
     this.productMaterial.ProductMaterialId = Guid.NewGuid().ToString();
 }
 public bool HasRowsBefore(Model.ProductMaterial e)
 {
     return(sqlmapper.QueryForObject <bool>("ProductMaterial.has_rows_before", e));
 }
 protected override void MoveLast()
 {
     this.productMaterial = this.productMateManager.GetLast();
 }
 public bool HasRowsAfter(Model.ProductMaterial e)
 {
     return(sqlmapper.QueryForObject <bool>("ProductMaterial.has_rows_after", e));
 }
示例#20
0
 public void UpdateProductMaterial(Model.ProductMaterial productmaterial)
 {
     Connection.Execute("update  ProductMaterial set MaterialQuantity= @MaterialQuantity where ProductId= @ProductId and MaterialId= @MaterialId", productmaterial, transaction: Transaction);
 }
示例#21
0
 public void AddProductMaterial(Model.ProductMaterial productmaterial)
 {
     Connection.Execute("insert into ProductMaterial(ProductId,MaterialId,MaterialQuantity) values (@ProductId,@MaterialId,@MaterialQuantity)", productmaterial, transaction: Transaction);
 }
示例#22
0
 /// <summary>
 /// Update a ProductMaterial.
 /// </summary>
 public void Update(Model.ProductMaterial productMaterial)
 {
     validate(productMaterial);
     productMaterial.UpdateTime = DateTime.Now;
     accessor.Update(productMaterial);
 }
示例#23
0
 public bool IsExistId(Model.ProductMaterial productMateridal)
 {
     return(accessor.IsExistId(productMateridal));
 }
 public Model.ProductMaterial GetNext(Model.ProductMaterial e)
 {
     return(sqlmapper.QueryForObject <Model.ProductMaterial>("ProductMaterial.get_next", e));
 }