Exemple #1
0
        /// <summary>
        /// 删除
        /// </summary>
        protected override void Delete()
        {
            if (this.productEpiboly == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            try
            {
                this.productEpibolyManager.Delete(this.productEpiboly.ProductEpibolyId);
                this.productEpiboly = this.productEpibolyManager.GetNext(this.productEpiboly);
                if (this.productEpiboly == null)
                {
                    this.productEpiboly = this.productEpibolyManager.GetLast();
                }
            }
            catch
            {
                throw new Exception("");
            }

            return;
        }
        public bool ExistsExcept(Model.ProductEpiboly e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.ProductEpibolyId).Id);
            return(sqlmapper.QueryForObject <bool>("ProductEpiboly.existsexcept", paras));
        }
 /// <summary>
 /// Update a ProductEpiboly.
 /// </summary>
 public void Update(Model.ProductEpiboly productEpiboly)
 {
     //
     // todo: add other logic here.
     //
     Validate(productEpiboly);
     productEpiboly.UpdateTime = DateTime.Now;
     accessor.Update(productEpiboly);
 }
Exemple #4
0
        protected override void MoveNext()
        {
            Model.ProductEpiboly productEpiboly = this.productEpibolyManager.GetNext(this.productEpiboly);
            if (productEpiboly == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }

            this.productEpiboly = productEpiboly;
        }
 /// <summary>
 /// Insert a ProductEpiboly.
 /// </summary>
 public void Insert(Model.ProductEpiboly productEpiboly)
 {
     //
     // todo:add other logic here
     //
     Validate(productEpiboly);
     productEpiboly.InsertTime = DateTime.Now;
     productEpiboly.ProductEpibolyId = Guid.NewGuid().ToString();
     accessor.Insert(productEpiboly);
 }
 private void Validate(Model.ProductEpiboly productEpiboly)
 {
     if (string.IsNullOrEmpty(productEpiboly.ProductId))
     {
         throw new Helper.RequireValueException(Model.ProductEpiboly.PROPERTY_PRODUCTID);
     }
     if (string.IsNullOrEmpty(productEpiboly.SupplierId))
     {
         throw new Helper.RequireValueException(Model.ProductEpiboly.PROPERTY_SUPPLIERID);
     }
 }
Exemple #7
0
        /// <summary>
        /// gridview单击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridView1_Click(object sender, EventArgs e)
        {
            GridView    view    = sender as GridView;
            GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Cursor.Position));

            if (hitInfo.InRow && !view.IsGroupRow(hitInfo.RowHandle))
            {
                Model.ProductEpiboly productEpiboly = this.bindingSource1.Current as Model.ProductEpiboly;
                if (productEpiboly != null)
                {
                    this.productEpiboly = productEpiboly;
                    this.action         = "view";
                    this.Refresh();
                }
            }
        }
Exemple #8
0
        public override void Refresh()
        {
            if (this.productEpiboly == null)
            {
                this.productEpiboly = new Book.Model.ProductEpiboly();
                this.action         = "insert";
            }
            this.bindingSource1.DataSource = this.productEpibolyManager.Select();
            if (this.productEpiboly.Product != null)
            {
                this.newChooseProductId.EditValue = this.productEpiboly.Product as Model.Product;;
            }
            if (this.productEpiboly.Supplier != null)
            {
                this.newChooseSupplierId.EditValue = this.productEpiboly.Supplier as Model.Supplier;
            }
            switch (this.action)
            {
            case "insert":
                this.newChooseProductId.ShowButton      = true;
                this.newChooseProductId.ButtonReadOnly  = false;
                this.newChooseSupplierId.ShowButton     = true;
                this.newChooseSupplierId.ButtonReadOnly = false;

                break;

            case "update":
                this.newChooseProductId.ShowButton      = true;
                this.newChooseProductId.ButtonReadOnly  = false;
                this.newChooseSupplierId.ShowButton     = true;
                this.newChooseSupplierId.ButtonReadOnly = false;
                break;

            case "view":
                this.newChooseProductId.ShowButton      = false;
                this.newChooseProductId.ButtonReadOnly  = true;
                this.newChooseSupplierId.ShowButton     = false;
                this.newChooseSupplierId.ButtonReadOnly = true;
                break;

            default:
                break;
            }
            base.Refresh();
        }
 public bool HasRowsAfter(Model.ProductEpiboly e)
 {
     return(accessor.HasRowsAfter(e));
 }
 public bool HasRowsAfter(Model.ProductEpiboly e)
 {
     return(sqlmapper.QueryForObject <bool>("ProductEpiboly.has_rows_after", e));
 }
 public Model.ProductEpiboly GetPrev(Model.ProductEpiboly e)
 {
     return(accessor.GetPrev(e));
 }
Exemple #12
0
 protected override void MoveLast()
 {
     this.productEpiboly = this.productEpibolyManager.GetLast();
 }
 public void Insert(Model.ProductEpiboly e)
 {
     this.Insert <Model.ProductEpiboly>(e);
 }
 public Model.ProductEpiboly GetNext(Model.ProductEpiboly e)
 {
     return(accessor.GetNext(e));
 }
 public void Update(Model.ProductEpiboly e)
 {
     this.Update <Model.ProductEpiboly>(e);
 }
 public bool HasRowsBefore(Model.ProductEpiboly e)
 {
     return(accessor.HasRowsBefore(e));
 }
Exemple #17
0
 protected override void AddNew()
 {
     this.productEpiboly = new Model.ProductEpiboly();
 }
Exemple #18
0
 public EditForm(Model.ProductEpiboly productEpiboly)
 {
     this.productEpiboly = productEpiboly;
     this.action         = "update";
 }
 public bool HasRowsBefore(Model.ProductEpiboly e)
 {
     return(sqlmapper.QueryForObject <bool>("ProductEpiboly.has_rows_before", e));
 }
Exemple #20
0
 public EditForm(Model.ProductEpiboly productEpiboly, string action)
 {
     this.productEpiboly = productEpiboly;
     this.action         = action;
 }
 public Model.ProductEpiboly GetNext(Model.ProductEpiboly e)
 {
     return(sqlmapper.QueryForObject <Model.ProductEpiboly>("ProductEpiboly.get_next", e));
 }
 public Model.ProductEpiboly GetPrev(Model.ProductEpiboly e)
 {
     return(sqlmapper.QueryForObject <Model.ProductEpiboly>("ProductEpiboly.get_prev", e));
 }
 public bool ExistsExcept(Model.ProductEpiboly e)
 {
     return(accessor.ExistsExcept(e));
 }