Ejemplo n.º 1
0
 public EditForm(Model.QualityTestPlan qualitytextplan, string action)
     : this()
 {
     //if (custom == null)
     //    throw new ArithmeticException();
     this.qualityTextPlan = qualitytextplan;
     this.action          = action;
 }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 protected override void MovePrev()
 {
     Model.QualityTestPlan qualitytestplan = this.qualityTextPlanManager.GetPrev(this.qualityTextPlan);
     if (qualitytestplan == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this.qualityTextPlan = qualitytestplan;
 }
Ejemplo n.º 4
0
        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);
            }
        }
Ejemplo n.º 5
0
        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";
        }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
        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;
            }
        }
Ejemplo n.º 8
0
        /// <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);
        }
Ejemplo n.º 9
0
        /// <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);
        }
Ejemplo n.º 10
0
        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);
            }
        }
Ejemplo n.º 11
0
 public void Update(Model.QualityTestPlan e)
 {
     this.Update <Model.QualityTestPlan>(e);
 }
Ejemplo n.º 12
0
 public void Insert(Model.QualityTestPlan e)
 {
     this.Insert <Model.QualityTestPlan>(e);
 }
Ejemplo n.º 13
0
 public bool ExistsExcept(Model.QualityTestPlan e)
 {
     return(accessor.ExistsExcept(e));
 }
Ejemplo n.º 14
0
 public bool HasRowsBefore(Model.QualityTestPlan e)
 {
     return(accessor.HasRowsBefore(e));
 }
Ejemplo n.º 15
0
 public Model.QualityTestPlan GetPrev(Model.QualityTestPlan e)
 {
     return(accessor.GetPrev(e));
 }
Ejemplo n.º 16
0
 public Model.QualityTestPlan GetNext(Model.QualityTestPlan e)
 {
     return(sqlmapper.QueryForObject <Model.QualityTestPlan>("QualityTestPlan.get_next", e));
 }
Ejemplo n.º 17
0
 protected override void AddNew()
 {
     this.qualityTextPlan = new Model.QualityTestPlan();
     //this.qualityTextPlan.QualityTestPlanId = this.qualityTextPlanManager.GetId();
 }
Ejemplo n.º 18
0
 public void Delete(Model.QualityTestPlan qualitytextplan)
 {
     accessor.Delete(qualitytextplan.QualityTestPlanId);
 }
Ejemplo n.º 19
0
 public Model.QualityTestPlan GetNext(Model.QualityTestPlan e)
 {
     return(accessor.GetNext(e));
 }
Ejemplo n.º 20
0
 public bool HasRowsBefore(Model.QualityTestPlan e)
 {
     return(sqlmapper.QueryForObject <bool>("QualityTestPlan.has_rows_before", e));
 }
Ejemplo n.º 21
0
 public bool HasRowsAfter(Model.QualityTestPlan e)
 {
     return(sqlmapper.QueryForObject <bool>("QualityTestPlan.has_rows_after", e));
 }
Ejemplo n.º 22
0
 protected override void MoveLast()
 {
     this.qualityTextPlan = this.qualityTextPlanManager.GetLast();
 }
Ejemplo n.º 23
0
 public Model.QualityTestPlan GetPrev(Model.QualityTestPlan e)
 {
     return(sqlmapper.QueryForObject <Model.QualityTestPlan>("QualityTestPlan.get_prev", e));
 }
Ejemplo n.º 24
0
 public bool HasRowsAfter(Model.QualityTestPlan e)
 {
     return(accessor.HasRowsAfter(e));
 }