Exemplo n.º 1
0
 protected override void MoveLast()
 {
     if (this.ProceduresPrice == null)
     {
         this.ProceduresPrice = this.ProceduresPriceManager.GetLast();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Update a ProceduresPrice.
 /// </summary>
 public void Update(Model.ProceduresPrice proceduresPrice)
 {
     //
     // todo: add other logic here.
     //
     Validate(proceduresPrice);
     proceduresPrice.UpdateTime = DateTime.Now;
     accessor.Update(proceduresPrice);
 }
Exemplo n.º 3
0
 protected override void MoveNext()
 {
     Model.ProceduresPrice ProceduresPrice = this.ProceduresPriceManager.GetNext(this.ProceduresPrice);
     if (ProceduresPrice == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this.ProceduresPrice = ProceduresPrice;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Insert a ProceduresPrice.
 /// </summary>
 public void Insert(Model.ProceduresPrice proceduresPrice)
 {
     //
     // todo:add other logic here
     //
     Validate(proceduresPrice);
     proceduresPrice.InsertTime        = DateTime.Now;
     proceduresPrice.ProceduresPriceId = Guid.NewGuid().ToString();
     accessor.Insert(proceduresPrice);
 }
Exemplo n.º 5
0
 private void Validate(Model.ProceduresPrice proceduresPrice)
 {
     if (string.IsNullOrEmpty(proceduresPrice.SupplierId))
     {
         throw new Helper.RequireValueException(Model.ProceduresPrice.PRO_SupplierId);
     }
     if (string.IsNullOrEmpty(proceduresPrice.BomId))
     {
         throw new Helper.RequireValueException(Model.ProceduresPrice.PRO_BomId);
     }
     if (string.IsNullOrEmpty(proceduresPrice.ProceduresId))
     {
         throw new Helper.RequireValueException(Model.ProceduresPrice.PRO_ProceduresId);
     }
 }
Exemplo n.º 6
0
 protected override void Delete()
 {
     if (this.ProceduresPrice == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     this.ProceduresPriceManager.Delete(this.ProceduresPrice.ProceduresPriceId);
     this.ProceduresPrice = this.ProceduresPriceManager.GetNext(this.ProceduresPrice);
     if (this.ProceduresPrice == null)
     {
         this.ProceduresPrice = this.ProceduresPriceManager.GetLast();
     }
 }
Exemplo n.º 7
0
 public ProceduresPriceEditForm(Model.ProceduresPrice ProceduresPrice, string action)
     : this()
 {
     this.ProceduresPrice = ProceduresPrice;
     this.action          = action;
 }
Exemplo n.º 8
0
 public ProceduresPriceEditForm(Model.ProceduresPrice ProceduresPrice)
     : this()
 {
     this.ProceduresPrice = ProceduresPrice;
     this.action          = "update";
 }
Exemplo n.º 9
0
        public override void Refresh()
        {
            if (this.ProceduresPrice == null)
            {
                this.ProceduresPrice = new Book.Model.ProceduresPrice();
                this.action          = "insert";
            }
            this.newChooseContorlSupplierId.EditValue = this.ProceduresPrice.Supplier;
            //this.newChooseContorlPriceUnit.EditValue=
            if (this.ProceduresPrice.Bom != null)
            {
                this.buttonEditBom.EditValue = this.ProceduresPrice.Bom;
                if (this.ProceduresPrice.Bom.Product != null)
                {
                    this.textEditBom.Text     = this.ProceduresPrice.Bom.Product.ProductName;
                    this.textEditBomCode.Text = this.ProceduresPrice.Bom.Product.Id;
                    this.textEdit4.Text       = this.ProceduresPrice.Bom.Product.ProductSpecification;
                }
            }
            if (this.ProceduresPrice.Procedures != null)
            {
                this.buttonEditProcedure.Text = this.ProceduresPrice.Procedures.Id;
                this.richTextBox1.Rtf         = this.ProceduresPrice.Procedures.Procedurename;
            }
            this.comboBoxEditUnit.EditValue                    = this.ProceduresPrice.ProductUnit;
            this.comboBoxEditPriceUnit.EditValue               = this.ProceduresPrice.PriceUnit;
            this.spinEditConversionRate.EditValue              = this.ProceduresPrice.ConversionRate;
            this.spinEditChargePrice.EditValue                 = this.ProceduresPrice.ChargePrice;
            this.spinEditTaxRate.EditValue                     = this.ProceduresPrice.TaxRate;
            this.comboBoxEditPriceTag.SelectedIndex            = this.ProceduresPrice.PriceTag == null ? -1 : this.ProceduresPrice.PriceTag.Value;
            this.comboBoxEditObsolescenceDoMode.SelectedIndex  = this.ProceduresPrice.ObsolescenceDoMode == null?-1:this.ProceduresPrice.ObsolescenceDoMode.Value;
            this.comboBoxEditWasteDoMode.SelectedIndex         = this.ProceduresPrice.WasteDoMode == null?-1:this.ProceduresPrice.WasteDoMode.Value;
            this.comboBoxEditNotReasonLossDoMode.SelectedIndex = this.ProceduresPrice.NotReasonLossDoMode == null?-1:this.ProceduresPrice.NotReasonLossDoMode.Value;
            this.spinEditObsolescencePrice.EditValue           = this.ProceduresPrice.ObsolescencePrice;
            this.spinEditWastePrice.EditValue                  = this.ProceduresPrice.WastePrice;
            this.spinEditNotReasonLossPrice.EditValue          = this.ProceduresPrice.NotReasonLossPrice;
            if (global::Helper.DateTimeParse.DateTimeEquls(this.ProceduresPrice.StartDate, global::Helper.DateTimeParse.NullDate))
            {
                this.dateEditStartDate.EditValue = null;
            }
            else
            {
                this.dateEditStartDate.EditValue = this.ProceduresPrice.StartDate;
            }
            if (global::Helper.DateTimeParse.DateTimeEquls(this.ProceduresPrice.EndDate, global::Helper.DateTimeParse.NullDate))
            {
                this.dateEditEndDate.EditValue = null;
            }
            else
            {
                this.dateEditEndDate.EditValue = this.ProceduresPrice.EndDate;
            }
            this.memoEditDescription.Text = this.ProceduresPrice.Description;
            switch (this.action)
            {
            case "insert":

                break;

            case "update":

                break;

            case "view":


                break;

            default:
                break;
            }
            base.Refresh();
        }
Exemplo n.º 10
0
 protected override void MoveFirst()
 {
     this.ProceduresPrice = this.ProceduresPriceManager.GetFirst();
 }
Exemplo n.º 11
0
 protected override void AddNew()
 {
     this.ProceduresPrice = new Model.ProceduresPrice();
 }
Exemplo n.º 12
0
 public Model.ProceduresPrice GetNext(Model.ProceduresPrice e)
 {
     return(accessor.GetNext(e));
 }
Exemplo n.º 13
0
 public Model.ProceduresPrice GetPrev(Model.ProceduresPrice e)
 {
     return(accessor.GetPrev(e));
 }
Exemplo n.º 14
0
 public bool HasRowsAfter(Model.ProceduresPrice e)
 {
     return(accessor.HasRowsAfter(e));
 }
Exemplo n.º 15
0
 public bool HasRowsBefore(Model.ProceduresPrice e)
 {
     return(accessor.HasRowsBefore(e));
 }