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(); }
public EditForm(Model.SupplierCategory SupplierCategory) : this() { this._supplier = new Book.Model.Supplier(); this._supplier.SupplierCategory = SupplierCategory; this.flag = 1; }
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)); }
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); } }
protected override void MoveNext() { Model.SupplierCategory unitGroup = this.supplierCategoryManager.GetNext(this._supplierCategory); if (unitGroup == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this._supplierCategory = unitGroup; }
//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); } }
/// <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); }
//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)); }
/// <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); }
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 = "供应商类别错误"; } }
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(); } } }
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(); } }
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(); }
public Model.SupplierCategory GetNext(Model.SupplierCategory e) { return(sqlmapper.QueryForObject <Model.SupplierCategory>("SupplierCategory.get_next", e)); }
protected override void AddNew() { this._supplierCategory = new Model.SupplierCategory(); //this._supplierCategory.SupplierCategoryId = this.supplierCategoryManager.GetId(); }
public bool HasRowsAfter(Model.SupplierCategory e) { return(accessor.HasRowsAfter(e)); }
public Model.SupplierCategory GetPrev(Model.SupplierCategory e) { return(accessor.GetPrev(e)); }
public void Insert(Model.SupplierCategory e) { this.Insert <Model.SupplierCategory>(e); }
public Model.SupplierCategory GetNext(Model.SupplierCategory e) { return(accessor.GetNext(e)); }
public void Update(Model.SupplierCategory e) { this.Update <Model.SupplierCategory>(e); }
//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)); }
public IList <Book.Model.Supplier> Select(Model.SupplierCategory supplierCategory) { return(accessor.Select(supplierCategory)); }
public bool HasRowsBefore(Model.SupplierCategory e) { return(sqlmapper.QueryForObject <bool>("SupplierCategory.has_rows_before", e)); }
public bool HasRowsBefore(Model.SupplierCategory e) { return(accessor.HasRowsBefore(e)); }
protected override void MoveLast() { this._supplierCategory = this.supplierCategoryManager.GetLast(); }
public bool HasRowsAfter(Model.SupplierCategory e) { return(sqlmapper.QueryForObject <bool>("SupplierCategory.has_rows_after", e)); }
public Model.SupplierCategory GetPrev(Model.SupplierCategory e) { return(sqlmapper.QueryForObject <Model.SupplierCategory>("SupplierCategory.get_prev", e)); }
public bool ExistsExcept(Model.SupplierCategory e) { return(accessor.ExistsExcept(e)); }