Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
 private void gridView1_Click(object sender, EventArgs e)
 {
     this.pronoteMachine = this.bindingSource1.Current as Model.PronoteMachine;
     if (pronoteMachine != null)
     {
         this.action = "view";
         this.Refresh();
     }
 }
Esempio n. 5
0
 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);
     }
 }
Esempio n. 6
0
 public bool HasRowsAfter(Model.PronoteMachine e)
 {
     return(sqlmapper.QueryForObject <bool>("PronoteMachine.has_rows_after", e));
 }
Esempio n. 7
0
 protected override void MoveLast()
 {
     this.pronoteMachine = this.pronoteMachineManager.Get(this.pronoteMachineManager.GetLast() == null ? "" : this.pronoteMachineManager.GetLast().PronoteMachineId);
 }
Esempio n. 8
0
 /// <summary>
 /// Update a PronoteMachine.
 /// </summary>
 public void Update(Model.PronoteMachine pronoteMachine)
 {
     validate(pronoteMachine);
     accessor.Update(pronoteMachine);
 }
Esempio n. 9
0
 /// <summary>
 /// Insert a PronoteMachine.
 /// </summary>
 public void Insert(Model.PronoteMachine pronoteMachine)
 {
     pronoteMachine.PronoteMachineId = Guid.NewGuid().ToString();
     validate(pronoteMachine);
     accessor.Insert(pronoteMachine);
 }
Esempio n. 10
0
 public bool HasRowsBefore(Model.PronoteMachine e)
 {
     return(accessor.HasRowsBefore(e));
 }
Esempio n. 11
0
 public Model.PronoteMachine GetPrev(Model.PronoteMachine e)
 {
     return(sqlmapper.QueryForObject <Model.PronoteMachine>("PronoteMachine.get_prev", e));
 }
Esempio n. 12
0
 public bool HasRowsBefore(Model.PronoteMachine e)
 {
     return(sqlmapper.QueryForObject <bool>("PronoteMachine.has_rows_before", e));
 }
Esempio n. 13
0
 protected override void AddNew()
 {
     this.pronoteMachine = new Book.Model.PronoteMachine();
 }
Esempio n. 14
0
 public void Update(Model.PronoteMachine e)
 {
     this.Update <Model.PronoteMachine>(e);
 }
Esempio n. 15
0
 public void Insert(Model.PronoteMachine e)
 {
     this.Insert <Model.PronoteMachine>(e);
 }
Esempio n. 16
0
 public bool HasRowsAfter(Model.PronoteMachine e)
 {
     return(accessor.HasRowsAfter(e));
 }
Esempio n. 17
0
 public Model.PronoteMachine GetNext(Model.PronoteMachine e)
 {
     return(accessor.GetNext(e));
 }
Esempio n. 18
0
 public Model.PronoteMachine GetPrev(Model.PronoteMachine e)
 {
     return(accessor.GetPrev(e));
 }
Esempio n. 19
0
 public Model.PronoteMachine GetNext(Model.PronoteMachine e)
 {
     return(sqlmapper.QueryForObject <Model.PronoteMachine>("PronoteMachine.get_next", e));
 }
Esempio n. 20
0
 public bool ExistsExcept(Model.PronoteMachine e)
 {
     return(accessor.ExistsExcept(e));
 }