示例#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();
        }
示例#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));
        }
示例#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);
 }
示例#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();
     }
 }
示例#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);
     }
 }
示例#6
0
 public bool HasRowsAfter(Model.PronoteMachine e)
 {
     return(sqlmapper.QueryForObject <bool>("PronoteMachine.has_rows_after", e));
 }
示例#7
0
 protected override void MoveLast()
 {
     this.pronoteMachine = this.pronoteMachineManager.Get(this.pronoteMachineManager.GetLast() == null ? "" : this.pronoteMachineManager.GetLast().PronoteMachineId);
 }
示例#8
0
 /// <summary>
 /// Update a PronoteMachine.
 /// </summary>
 public void Update(Model.PronoteMachine pronoteMachine)
 {
     validate(pronoteMachine);
     accessor.Update(pronoteMachine);
 }
示例#9
0
 /// <summary>
 /// Insert a PronoteMachine.
 /// </summary>
 public void Insert(Model.PronoteMachine pronoteMachine)
 {
     pronoteMachine.PronoteMachineId = Guid.NewGuid().ToString();
     validate(pronoteMachine);
     accessor.Insert(pronoteMachine);
 }
示例#10
0
 public bool HasRowsBefore(Model.PronoteMachine e)
 {
     return(accessor.HasRowsBefore(e));
 }
示例#11
0
 public Model.PronoteMachine GetPrev(Model.PronoteMachine e)
 {
     return(sqlmapper.QueryForObject <Model.PronoteMachine>("PronoteMachine.get_prev", e));
 }
示例#12
0
 public bool HasRowsBefore(Model.PronoteMachine e)
 {
     return(sqlmapper.QueryForObject <bool>("PronoteMachine.has_rows_before", e));
 }
示例#13
0
 protected override void AddNew()
 {
     this.pronoteMachine = new Book.Model.PronoteMachine();
 }
示例#14
0
 public void Update(Model.PronoteMachine e)
 {
     this.Update <Model.PronoteMachine>(e);
 }
示例#15
0
 public void Insert(Model.PronoteMachine e)
 {
     this.Insert <Model.PronoteMachine>(e);
 }
示例#16
0
 public bool HasRowsAfter(Model.PronoteMachine e)
 {
     return(accessor.HasRowsAfter(e));
 }
示例#17
0
 public Model.PronoteMachine GetNext(Model.PronoteMachine e)
 {
     return(accessor.GetNext(e));
 }
示例#18
0
 public Model.PronoteMachine GetPrev(Model.PronoteMachine e)
 {
     return(accessor.GetPrev(e));
 }
示例#19
0
 public Model.PronoteMachine GetNext(Model.PronoteMachine e)
 {
     return(sqlmapper.QueryForObject <Model.PronoteMachine>("PronoteMachine.get_next", e));
 }
示例#20
0
 public bool ExistsExcept(Model.PronoteMachine e)
 {
     return(accessor.ExistsExcept(e));
 }