public override void Refresh() { //if (this.action == "view") //{ // if (this.bindingSource1.Current != null) // this.pronoteMachine = this.bindingSource1.Current as Model.PronoteMachine; //} if (this.pronoteMachine == null) { this.pronoteMachine = new Book.Model.PronoteMachine(); this.action = "insert"; } else { if (this.action != "insert") { this.pronoteMachine = this.pronoteMachineManager.Get(this.pronoteMachine.PronoteMachineId); } } this.txtPronoteMachineId.Text = this.pronoteMachine.Id; this.txtPronoteMachineName.Text = this.pronoteMachine.PronoteMachineName; this.newChooseContorlWorkH.EditValue = this.pronoteMachine.WorkHouse; this.spinEditQuantity.Text = this.pronoteMachine.Quantity.ToString(); this.spinEditMachineTotal.Text = this.pronoteMachine.MachineTotal.ToString(); this.spinEditMachinePower.Text = this.pronoteMachine.MachinePower.ToString(); this.textEditProductUnitId.Text = this.pronoteMachine.ProductUnitId; this.bindingSource1.DataSource = this.pronoteMachineManager.Select(); base.Refresh(); }
public bool ExistsExcept(Model.PronoteMachine e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.PronoteMachineId) == null?null:Get(e.PronoteMachineId).Id); return(sqlmapper.QueryForObject <bool>("PronoteMachine.existsexcept", paras)); }
protected override void Delete() { if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } Model.PronoteMachine pronoteMachine = this.bindingSource1.Current as Model.PronoteMachine; this.pronoteMachineManager.Delete(pronoteMachine.PronoteMachineId); }
private void gridView1_Click(object sender, EventArgs e) { this.pronoteMachine = this.bindingSource1.Current as Model.PronoteMachine; if (pronoteMachine != null) { this.action = "view"; this.Refresh(); } }
private void validate(Model.PronoteMachine pro) { if (string.IsNullOrEmpty(pro.Id)) { throw new Helper.RequireValueException(Model.PronoteMachine.PROPERTY_ID); } if (string.IsNullOrEmpty(pro.PronoteMachineName)) { throw new Helper.RequireValueException(Model.PronoteMachine.PROPERTY_PRONOTEMACHINENAME); } if (accessor.ExistsId(pro.Id, pro.PronoteMachineId)) { throw new Helper.InvalidValueException(Model.PronoteMachine.PROPERTY_ID); } if (accessor.ExistsName(pro.PronoteMachineName, pro.PronoteMachineId)) { throw new Helper.InvalidValueException(Model.PronoteMachine.PROPERTY_PRONOTEMACHINENAME); } if (string.IsNullOrEmpty(pro.WorkHouseId)) { throw new Helper.InvalidValueException(Model.PronoteMachine.PROPERTY_WORKHOUSEID); } }
public bool HasRowsAfter(Model.PronoteMachine e) { return(sqlmapper.QueryForObject <bool>("PronoteMachine.has_rows_after", e)); }
protected override void MoveLast() { this.pronoteMachine = this.pronoteMachineManager.Get(this.pronoteMachineManager.GetLast() == null ? "" : this.pronoteMachineManager.GetLast().PronoteMachineId); }
/// <summary> /// Update a PronoteMachine. /// </summary> public void Update(Model.PronoteMachine pronoteMachine) { validate(pronoteMachine); accessor.Update(pronoteMachine); }
/// <summary> /// Insert a PronoteMachine. /// </summary> public void Insert(Model.PronoteMachine pronoteMachine) { pronoteMachine.PronoteMachineId = Guid.NewGuid().ToString(); validate(pronoteMachine); accessor.Insert(pronoteMachine); }
public bool HasRowsBefore(Model.PronoteMachine e) { return(accessor.HasRowsBefore(e)); }
public Model.PronoteMachine GetPrev(Model.PronoteMachine e) { return(sqlmapper.QueryForObject <Model.PronoteMachine>("PronoteMachine.get_prev", e)); }
public bool HasRowsBefore(Model.PronoteMachine e) { return(sqlmapper.QueryForObject <bool>("PronoteMachine.has_rows_before", e)); }
protected override void AddNew() { this.pronoteMachine = new Book.Model.PronoteMachine(); }
public void Update(Model.PronoteMachine e) { this.Update <Model.PronoteMachine>(e); }
public void Insert(Model.PronoteMachine e) { this.Insert <Model.PronoteMachine>(e); }
public bool HasRowsAfter(Model.PronoteMachine e) { return(accessor.HasRowsAfter(e)); }
public Model.PronoteMachine GetNext(Model.PronoteMachine e) { return(accessor.GetNext(e)); }
public Model.PronoteMachine GetPrev(Model.PronoteMachine e) { return(accessor.GetPrev(e)); }
public Model.PronoteMachine GetNext(Model.PronoteMachine e) { return(sqlmapper.QueryForObject <Model.PronoteMachine>("PronoteMachine.get_next", e)); }
public bool ExistsExcept(Model.PronoteMachine e) { return(accessor.ExistsExcept(e)); }