Пример #1
0
        private void bindingSourceSupplierCategory_CurrentChanged(object sender, EventArgs e)
        {
            this.supplierCategory = this.bindingSourceSupplierCategory.Current as Model.SupplierCategory;

            this.bindingSource1.DataSource = this.supplierManager.Select(supplierCategory);
            this.gridControl1.RefreshDataSource();
        }
Пример #2
0
 public EditForm(Model.SupplierCategory SupplierCategory)
     : this()
 {
     this._supplier = new Book.Model.Supplier();
     this._supplier.SupplierCategory = SupplierCategory;
     this.flag = 1;
 }
Пример #3
0
        public bool ExistsExcept(Model.SupplierCategory e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.SupplierCategoryId).Id);
            return(sqlmapper.QueryForObject <bool>("SupplierCategory.existsexcept", paras));
        }
Пример #4
0
        public void MyClick(ref ChooseItem item)
        {
            ChooseSupplierCategoryForm f = new ChooseSupplierCategoryForm();

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Model.SupplierCategory supplierCategory = f.SelectedItem as Model.SupplierCategory;
                item = new ChooseItem(supplierCategory, supplierCategory.Id, supplierCategory.SupplierCategoryName);
            }
        }
Пример #5
0
        protected override void MoveNext()
        {
            Model.SupplierCategory unitGroup = this.supplierCategoryManager.GetNext(this._supplierCategory);
            if (unitGroup == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }

            this._supplierCategory = unitGroup;
        }
Пример #6
0
        //protected override string GetInvoiceKind()
        //{
        //    return "SupplierCategory";
        //}

        //protected override string GetSettingId()
        //{
        //    return "SupplierCategoryRule";
        //}
        private void Validate(Model.SupplierCategory supplierCategory)
        {
            if (string.IsNullOrEmpty(supplierCategory.Id))
            {
                throw new Helper.RequireValueException(Model.SupplierCategory.PROPERTY_ID);
            }
            if (string.IsNullOrEmpty(supplierCategory.SupplierCategoryName))
            {
                throw new Helper.RequireValueException(Model.SupplierCategory.PROPERTY_SUPPLIERCATEGORYNAME);
            }
        }
Пример #7
0
        /// <summary>
        /// Update a SupplierCategory.
        /// </summary>
        public void Update(Model.SupplierCategory supplierCategory)
        {
            //
            // todo: add other logic here.
            //
            Validate(supplierCategory);

            if (this.ExistsExcept(supplierCategory))
            {
                throw new Helper.InvalidValueException(Model.SupplierCategory.PROPERTY_ID);
            }
            accessor.Update(supplierCategory);
        }
Пример #8
0
        //public IList<Model.Supplier> Select(string SupplierStart, string SupplierEnd, DateTime dateStart, DateTime dateEnd)
        //{
        //    return accessor.Select( SupplierStart,  SupplierEnd,  dateStart,  dateEnd);
        //}
        //protected override string GetInvoiceKind()
        //{
        //    return "Supplier";
        //}

        //protected override string GetSettingId()
        //{
        //    return "CompanyNumberRuleOfSUPPLIER";
        //}
        public string GetNewId(Model.SupplierCategory supplierCategory)
        {
            // this.Validate(product);
            string sequencekey = supplierCategory.Id;

            // SequenceManager.Increment(sequencekey);
            //  string str=
            // SequenceManager.IncrementVal(sequencekey,);
            string a           = "suppliercategory" + sequencekey;
            int    sequenceval = SequenceManager.GetCurrentVal(a) + 1;

            return(string.Format("{0}{1:d4}", sequencekey, sequenceval));
        }
Пример #9
0
        /// <summary>
        /// Insert a SupplierCategory.
        /// </summary>
        public void Insert(Model.SupplierCategory supplierCategory)
        {
            //
            // todo:add other logic here
            //
            Validate(supplierCategory);

            if (this.Exists(supplierCategory.Id))
            {
                throw new Helper.InvalidValueException(Model.SupplierCategory.PROPERTY_ID);
            }
            supplierCategory.SupplierCategoryId = Guid.NewGuid().ToString();
            accessor.Insert(supplierCategory);
        }
Пример #10
0
 public void MyLeave(ref ChooseItem item)
 {
     BL.SupplierCategoryManager manager          = new Book.BL.SupplierCategoryManager();
     Model.SupplierCategory     supplierCategory = manager.GetById(item.ButtonText);
     if (supplierCategory != null)
     {
         item.EditValue  = supplierCategory;
         item.LabelText  = supplierCategory.SupplierCategoryName;
         item.ButtonText = supplierCategory.Id;
     }
     else
     {
         item.ErrorMessage = "供应商类别错误";
     }
 }
Пример #11
0
        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.SupplierCategory supplier = this.bindingSourceSupplierCategory.Current as Model.SupplierCategory;
                if (supplier != null)
                {
                    this._supplierCategory = supplier;
                    this.action            = "view";
                    this.Refresh();
                }
            }
        }
Пример #12
0
 protected override void Delete()
 {
     if (this._supplierCategory == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     this.supplierCategoryManager.Delete(this._supplierCategory.SupplierCategoryId);
     this._supplierCategory = this.supplierCategoryManager.GetNext(this._supplierCategory);
     if (this._supplierCategory == null)
     {
         this._supplierCategory = this.supplierCategoryManager.GetLast();
     }
 }
Пример #13
0
        public override void Refresh()
        {
            if (this._supplierCategory == null)
            {
                this._supplierCategory = new Book.Model.SupplierCategory();
                this.action            = "insert";
            }

            this.bindingSourceSupplierCategory.DataSource = this.supplierCategoryManager.Select();
            this.textEditId.Text = (string.IsNullOrEmpty(this._supplierCategory.Id)?this._supplierCategory.SupplierCategoryId:this._supplierCategory.Id);
            this.textEditSupplierCategoryName.EditValue   = this._supplierCategory.SupplierCategoryName;
            this.memoEditSupplierCategoryDescription.Text = this._supplierCategory.SupplierCategoryDescription;

            switch (this.action)
            {
            case "insert":
                this.textEditId.Properties.ReadOnly = false;
                this.textEditSupplierCategoryName.Properties.ReadOnly        = false;
                this.memoEditSupplierCategoryDescription.Properties.ReadOnly = false;
                break;

            case "update":
                this.textEditId.Properties.ReadOnly = false;
                this.textEditSupplierCategoryName.Properties.ReadOnly        = false;
                this.memoEditSupplierCategoryDescription.Properties.ReadOnly = false;
                break;

            case "view":
                this.textEditId.Properties.ReadOnly = true;
                this.textEditSupplierCategoryName.Properties.ReadOnly        = true;
                this.memoEditSupplierCategoryDescription.Properties.ReadOnly = true;
                break;

            default:
                break;
            }
            base.Refresh();
        }
Пример #14
0
 public Model.SupplierCategory GetNext(Model.SupplierCategory e)
 {
     return(sqlmapper.QueryForObject <Model.SupplierCategory>("SupplierCategory.get_next", e));
 }
Пример #15
0
 protected override void AddNew()
 {
     this._supplierCategory = new Model.SupplierCategory();
     //this._supplierCategory.SupplierCategoryId = this.supplierCategoryManager.GetId();
 }
Пример #16
0
 public bool HasRowsAfter(Model.SupplierCategory e)
 {
     return(accessor.HasRowsAfter(e));
 }
Пример #17
0
 public Model.SupplierCategory GetPrev(Model.SupplierCategory e)
 {
     return(accessor.GetPrev(e));
 }
Пример #18
0
 public void Insert(Model.SupplierCategory e)
 {
     this.Insert <Model.SupplierCategory>(e);
 }
Пример #19
0
 public Model.SupplierCategory GetNext(Model.SupplierCategory e)
 {
     return(accessor.GetNext(e));
 }
Пример #20
0
 public void Update(Model.SupplierCategory e)
 {
     this.Update <Model.SupplierCategory>(e);
 }
Пример #21
0
        //public void Update(Book.Model.Supplier supplier, string newId)
        //{
        //    Hashtable pars = new Hashtable();
        //    pars.Add("supplier", supplier);
        //    pars.Add("newId", newId);
        //    sqlmapper.Update("Supplier.newupdate", pars);
        //    supplier.SupplierId = newId;
        //}
        //public  IList<Model.Supplier> Select(string SupplierStart, string SupplierEnd, DateTime dateStart, DateTime dateEnd)
        // {
        //     Hashtable pars = new Hashtable();
        //     pars.Add("SupplierStart", SupplierStart);
        //     pars.Add("SupplierEnd", SupplierEnd);
        //     pars.Add("dateStart", dateStart);
        //     pars.Add("dateEnd", dateEnd);
        //     return sqlmapper.QueryForList<Model.Supplier>("Supplier.select_byQujianDate", pars);

        // }
        public IList <Book.Model.Supplier> Select(Model.SupplierCategory supplierCategory)
        {
            return(sqlmapper.QueryForList <Model.Supplier>("Supplier.select_bySupplierCategoryId", supplierCategory.SupplierCategoryId));
        }
Пример #22
0
 public IList <Book.Model.Supplier> Select(Model.SupplierCategory supplierCategory)
 {
     return(accessor.Select(supplierCategory));
 }
Пример #23
0
 public bool HasRowsBefore(Model.SupplierCategory e)
 {
     return(sqlmapper.QueryForObject <bool>("SupplierCategory.has_rows_before", e));
 }
Пример #24
0
 public bool HasRowsBefore(Model.SupplierCategory e)
 {
     return(accessor.HasRowsBefore(e));
 }
Пример #25
0
 protected override void MoveLast()
 {
     this._supplierCategory = this.supplierCategoryManager.GetLast();
 }
Пример #26
0
 public bool HasRowsAfter(Model.SupplierCategory e)
 {
     return(sqlmapper.QueryForObject <bool>("SupplierCategory.has_rows_after", e));
 }
Пример #27
0
 public Model.SupplierCategory GetPrev(Model.SupplierCategory e)
 {
     return(sqlmapper.QueryForObject <Model.SupplierCategory>("SupplierCategory.get_prev", e));
 }
Пример #28
0
 public bool ExistsExcept(Model.SupplierCategory e)
 {
     return(accessor.ExistsExcept(e));
 }