public EditForm(Model.QualityTestPlan qualitytextplan, string action) : this() { //if (custom == null) // throw new ArithmeticException(); this.qualityTextPlan = qualitytextplan; this.action = action; }
public bool ExistsExcept(Model.QualityTestPlan e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.QualityTestPlanId).Id); return(sqlmapper.QueryForObject <bool>("QualityTestPlan.existsexcept", paras)); }
protected override void MovePrev() { Model.QualityTestPlan qualitytestplan = this.qualityTextPlanManager.GetPrev(this.qualityTextPlan); if (qualitytestplan == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.qualityTextPlan = qualitytestplan; }
public void MyClick(ref ChooseItem item) { ChooseQualityTestPlanForm f = new ChooseQualityTestPlanForm(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.QualityTestPlan qualitytestplan = f.SelectedItem as Model.QualityTestPlan; item = new ChooseItem(qualitytestplan, qualitytestplan.Id, qualitytestplan.QualityTestPlanName); } }
public EditForm(Model.QualityTestPlan qualitytextplan) : this() { //if (custom == null) // throw new ArithmeticException(); //this.invalidValueExceptions.Add(Model.CustomInspectionRule.PROPERTY_CUSTOMINSPECTIONRULEID, new AA("已有相同编号的项存在", this.CustomInspectionRuleIdTextEdit)); this.qualityTextPlan = qualitytextplan; this.action = "update"; }
public override void Refresh() { if (this.qualityTextPlan == null) { this.qualityTextPlan = new Book.Model.QualityTestPlan(); this.action = "insert"; } this.textEditId.Text = (string.IsNullOrEmpty(this.qualityTextPlan.Id)? this.qualityTextPlan.QualityTestPlanId:this.qualityTextPlan.Id); this.QualityTestPlanNametextEdit.Text = this.qualityTextPlan.QualityTestPlanName; this.QualityTestPlanCodetextEdit.Text = this.qualityTextPlan.QualityTestCode; this.QualityTestStandardCodetextEdit.Text = this.qualityTextPlan.QualityTestStandardCode; this.CreateMantextEdit.Text = this.qualityTextPlan.CreateMan; this.ChangeMantextEdit.Text = this.qualityTextPlan.ChangeMan; this.EnterMantextEdit.Text = this.qualityTextPlan.EnterMan; switch (this.action) { case "insert": this.textEditId.Properties.ReadOnly = false; this.QualityTestPlanNametextEdit.Properties.ReadOnly = false; this.QualityTestPlanCodetextEdit.Properties.ReadOnly = false; this.QualityTestStandardCodetextEdit.Properties.ReadOnly = false; this.CreateMantextEdit.Properties.ReadOnly = false; this.ChangeMantextEdit.Properties.ReadOnly = false; this.EnterMantextEdit.Properties.ReadOnly = false; break; case "update": this.textEditId.Properties.ReadOnly = false; this.QualityTestPlanNametextEdit.Properties.ReadOnly = false; this.QualityTestPlanCodetextEdit.Properties.ReadOnly = false; this.QualityTestStandardCodetextEdit.Properties.ReadOnly = false; this.CreateMantextEdit.Properties.ReadOnly = false; this.ChangeMantextEdit.Properties.ReadOnly = false; this.EnterMantextEdit.Properties.ReadOnly = false; break; case "view": this.textEditId.Properties.ReadOnly = true; this.QualityTestPlanNametextEdit.Properties.ReadOnly = true; this.QualityTestPlanCodetextEdit.Properties.ReadOnly = true; this.QualityTestStandardCodetextEdit.Properties.ReadOnly = true; this.CreateMantextEdit.Properties.ReadOnly = true; this.ChangeMantextEdit.Properties.ReadOnly = true; this.EnterMantextEdit.Properties.ReadOnly = true; break; default: break; } base.Refresh(); }
public void MyLeave(ref ChooseItem item) { BL.QualityTestPlanManager manager = new Book.BL.QualityTestPlanManager(); Model.QualityTestPlan qualitytestplan = manager.GetById(item.ButtonText); if (qualitytestplan != null) { item.EditValue = qualitytestplan; item.LabelText = qualitytestplan.QualityTestPlanName; item.ButtonText = qualitytestplan.Id; } }
/// <summary> /// Update a QualityTestPlan. /// </summary> public void Update(Model.QualityTestPlan qualityTestPlan) { // // todo: add other logic here. // this.Validate(qualityTestPlan); if (this.ExistsExcept(qualityTestPlan)) { throw new Helper.InvalidValueException(Model.QualityTestPlan.PROPERTY_ID); } accessor.Update(qualityTestPlan); }
/// <summary> /// Insert a QualityTestPlan. /// </summary> public void Insert(Model.QualityTestPlan qualityTestPlan) { // // todo:add other logic here // this.Validate(qualityTestPlan); if (this.Exists(qualityTestPlan.Id)) { throw new Helper.InvalidValueException(Model.QualityTestPlan.PROPERTY_ID); } if (this.hasRowsName(qualityTestPlan.QualityTestPlanName)) { throw new Helper.InvalidValueException(Model.QualityTestPlan.PROPERTY_QUALITYTESTPLANNAME); } qualityTestPlan.QualityTestPlanId = Guid.NewGuid().ToString(); accessor.Insert(qualityTestPlan); }
private void Validate(Model.QualityTestPlan qualitytextplan) { if (string.IsNullOrEmpty(qualitytextplan.Id)) { throw new Helper.RequireValueException(Model.QualityTestPlan.PROPERTY_ID); } if (string.IsNullOrEmpty(qualitytextplan.QualityTestPlanName)) { throw new Helper.RequireValueException(Model.QualityTestPlan.PROPERTY_QUALITYTESTPLANNAME); } if (string.IsNullOrEmpty(qualitytextplan.QualityTestCode)) { throw new Helper.RequireValueException(Model.QualityTestPlan.PROPERTY_QUALITYTESTCODE); } if (string.IsNullOrEmpty(qualitytextplan.QualityTestStandardCode)) { throw new Helper.RequireValueException(Model.QualityTestPlan.PROPERTY_QUALITYTESTSTANDARDCODE); } }
public void Update(Model.QualityTestPlan e) { this.Update <Model.QualityTestPlan>(e); }
public void Insert(Model.QualityTestPlan e) { this.Insert <Model.QualityTestPlan>(e); }
public bool ExistsExcept(Model.QualityTestPlan e) { return(accessor.ExistsExcept(e)); }
public bool HasRowsBefore(Model.QualityTestPlan e) { return(accessor.HasRowsBefore(e)); }
public Model.QualityTestPlan GetPrev(Model.QualityTestPlan e) { return(accessor.GetPrev(e)); }
public Model.QualityTestPlan GetNext(Model.QualityTestPlan e) { return(sqlmapper.QueryForObject <Model.QualityTestPlan>("QualityTestPlan.get_next", e)); }
protected override void AddNew() { this.qualityTextPlan = new Model.QualityTestPlan(); //this.qualityTextPlan.QualityTestPlanId = this.qualityTextPlanManager.GetId(); }
public void Delete(Model.QualityTestPlan qualitytextplan) { accessor.Delete(qualitytextplan.QualityTestPlanId); }
public Model.QualityTestPlan GetNext(Model.QualityTestPlan e) { return(accessor.GetNext(e)); }
public bool HasRowsBefore(Model.QualityTestPlan e) { return(sqlmapper.QueryForObject <bool>("QualityTestPlan.has_rows_before", e)); }
public bool HasRowsAfter(Model.QualityTestPlan e) { return(sqlmapper.QueryForObject <bool>("QualityTestPlan.has_rows_after", e)); }
protected override void MoveLast() { this.qualityTextPlan = this.qualityTextPlanManager.GetLast(); }
public Model.QualityTestPlan GetPrev(Model.QualityTestPlan e) { return(sqlmapper.QueryForObject <Model.QualityTestPlan>("QualityTestPlan.get_prev", e)); }
public bool HasRowsAfter(Model.QualityTestPlan e) { return(accessor.HasRowsAfter(e)); }