Example #1
0
        protected override void Delete()
        {
            if (this._manprocedure == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            try
            {
                this.manProceductManager.Delete(this._manprocedure.ManProcedureId);
                this._manprocedure = this.manProceductManager.GetNext(this._manprocedure);
                if (this._manprocedure == null)
                {
                    this._manprocedure = this.manProceductManager.GetLast();
                }
            }
            catch
            {
                throw new Exception("");
            }

            return;
        }
Example #2
0
 protected override void MoveLast()
 {
     this._manprocedure = this.manProceductManager.GetLast();
     if (this._manprocedure != null)
     {
         this._manprocedure.detail = new BL.ProceduresManager().Select(this._manprocedure.Bom);
     }
 }
Example #3
0
 /// <summary>
 /// Update a ManProcedure.
 /// </summary>
 public void Update(Model.ManProcedure manProcedure)
 {
     //
     // todo: add other logic here.
     //
     manProcedure.UpdateTime = DateTime.Now;
     this.Delete(manProcedure.Bom);
     this.Insert(manProcedure);
 }
Example #4
0
 private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e)
 {
     if (this.bindingSourceTechonlogyLeft.Current != null)
     {
         this._manprocedure = this.bindingSourceTechonlogyLeft.Current as Model.ManProcedure;
         this.action        = "view";
         this.Refresh();
     }
 }
Example #5
0
        protected override void MoveNext()
        {
            Model.ManProcedure ManProcedure = this.manProceductManager.GetNext(this._manprocedure);
            if (ManProcedure == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }

            this._manprocedure = ManProcedure;
        }
Example #6
0
 /// <summary>
 /// Insert a ManProcedure.
 /// </summary>
 public void Insert(Model.ManProcedure manProcedure)
 {
     //
     // todo:add other logic here
     //
     if (string.IsNullOrEmpty(manProcedure.BomId))
     {
         throw new Helper.RequireValueException(Model.ManProcedure.PRO_BomId);
     }
     manProcedure.ManProcedureId = Guid.NewGuid().ToString();
     manProcedure.InsertTime     = DateTime.Now;
     accessor.Insert(manProcedure);
 }
Example #7
0
 protected override void MoveFirst()
 {
     this._manprocedure = this.manProceductManager.GetFirst();
 }
Example #8
0
        public override void Refresh()
        {
            if (this._manprocedure == null)
            {
                this._manprocedure = new Book.Model.ManProcedure();
                this.action        = "insert";
            }
            if (this._manprocedure.Bom != null)
            {
                if (string.IsNullOrEmpty(this._manprocedure.Bom.Product.CustomerProductName))
                {
                    this.textEditProductName.EditValue = this._manprocedure.Bom.Product.ProductName;
                }
                else
                {
                    this.textEditProductName.EditValue = this._manprocedure.Bom.Product.ProductName + "{" + this._manprocedure.Bom.Product.CustomerProductName + "}";
                }
                this.buttonEditProduct.EditValue = this._manprocedure.Bom.Product.Id;
                this.textEditBOMID.EditValue     = this._manprocedure.Bom.Id;
                //this.textEditBOMType.EditValue = this._manprocedure.Bom.MaterialType;
                if (!string.IsNullOrEmpty(this._manprocedure.Bom.Product.CustomerProductName))
                {
                    this.textEditCustomerPro.Text = this._manprocedure.Bom.Product.CustomerProductName;
                }
                else
                {
                    this.textEditCustomerPro.Text = string.Empty;
                }
                ;
                // this.textEditCustomProduct.EditValue = this._manprocedure.Bom.Product.CustomerProductName; ;
                if (this._manprocedure.TechonlogyHeader != null)
                {
                    this.buttonEditTechonlogyHeaderid.EditValue = this._manprocedure.TechonlogyHeader.TechonlogyHeadername;
                }
                if (this._manprocedure.MadeProduct != null)
                {
                    this.buttonEditMadeProduct.EditValue = string.IsNullOrEmpty(this._manprocedure.MadeProduct.CustomerProductName) ? this._manprocedure.MadeProduct.ProductName : this._manprocedure.MadeProduct.ProductName + "{" + this._manprocedure.MadeProduct.CustomerProductName + "}";
                }
                else
                {
                    this.buttonEditMadeProduct.EditValue = null;
                }
                this.bindingSource1.DataSource = this.technologydetailsManager.Select(this._manprocedure.TechonlogyHeader);
            }
            else
            {
                this.textEditProductName.EditValue = null;
                this.buttonEditProduct.EditValue   = null;
                this.textEditBOMID.EditValue       = null;
                // this.textEditBOMType.EditValue = null;
                this.textEditCustomerPro.EditValue = null;
                // this.textEditCustomProduct.EditValue = null;
                this.bindingSource1.DataSource = null;
                this.buttonEditTechonlogyHeaderid.EditValue = null;
                this.buttonEditMadeProduct.EditValue        = null;
            }
            this.newChooseContorlCustomer.EditValue = this._manprocedure.Customer;
            if (this._manprocedure.TechonlogyHeader != null)
            {
                this.bindingSource1.DataSource = this.technologydetailsManager.Select(this._manprocedure.TechonlogyHeader);
            }

            //string sql = "SELECT productid,id,productname FROM ManProcedure WHERE (IsProcee IS null OR IsProcee=0) AND (IsCustomerProduct IS NULL OR IsCustomerProduct =0)";
            //this.bindingSourceTechonlogyLeft.DataSource = this.productManager.DataReaderBind<Model.Product>(sql);
            this.bindingSourceTechonlogyLeft.DataSource = this.manProceductManager.Select();
            base.Refresh();
            switch (this.action)
            {
            case "insert":
                //this.buttonEditProduct.Properties.Buttons[0].Enabled = true;
                //this.buttonEditProduct.Properties.ReadOnly = false;
                //this.buttonEditTechonlogyHeaderid.Properties.Buttons[0].Enabled = true;
                //this.buttonEditTechonlogyHeaderid.Properties.ReadOnly = false;
                this.textEditBOMID.Properties.ReadOnly = true;
                //this.textEditBOMType.Properties.ReadOnly=true;
                //this.textEditCustomProduct.Properties.ReadOnly=true;
                this.textEditCustomerPro.Properties.ReadOnly = true;
                this.textEditProductName.Properties.ReadOnly = true;
                break;

            case "update":
                //this.buttonEditProduct.Properties.Buttons[0].Enabled = true;
                //this.buttonEditProduct.Properties.ReadOnly = false;
                //this.buttonEditTechonlogyHeaderid.Properties.Buttons[0].Enabled = true;
                //this.buttonEditTechonlogyHeaderid.Properties.ReadOnly = false;
                this.textEditBOMID.Properties.ReadOnly = true;
                //this.textEditBOMType.Properties.ReadOnly=true;
                //this.textEditCustomProduct.Properties.ReadOnly=true;
                this.textEditCustomerPro.Properties.ReadOnly = true;
                this.textEditProductName.Properties.ReadOnly = true;
                break;

            case "view":
                //this.buttonEditProduct.Properties.Buttons[0].Enabled = false;
                //this.buttonEditProduct.Properties.ReadOnly = true;
                //this.buttonEditTechonlogyHeaderid.Properties.Buttons[0].Enabled = false;
                //this.buttonEditTechonlogyHeaderid.Properties.ReadOnly = true;
                this.textEditBOMID.Properties.ReadOnly = true;
                //this.textEditBOMType.Properties.ReadOnly=true;
                //this.textEditCustomProduct.Properties.ReadOnly=true;
                this.textEditCustomerPro.Properties.ReadOnly = true;
                this.textEditProductName.Properties.ReadOnly = true;
                break;

            default:
                break;
            }
        }
Example #9
0
 protected override void AddNew()
 {
     this._manprocedure = new Model.ManProcedure();
 }
Example #10
0
 public Model.ManProcedure GetNext(Model.ManProcedure e)
 {
     return(accessor.GetNext(e));
 }
Example #11
0
 public Model.ManProcedure GetPrev(Model.ManProcedure e)
 {
     return(accessor.GetPrev(e));
 }
Example #12
0
 public bool HasRowsAfter(Model.ManProcedure e)
 {
     return(accessor.HasRowsAfter(e));
 }
Example #13
0
 public bool HasRowsBefore(Model.ManProcedure e)
 {
     return(accessor.HasRowsBefore(e));
 }