//private void gridView2_Click(object sender, EventArgs e)
        //{
        //    this._mouldattachment = this.bindingSourceDetails.Current as Model.MouldAttachment;
        //}

        private void sbtn_minusDetails_Click(object sender, EventArgs e)
        {
            Model.MouldAttachment mouldAttachment = this.bindingSourceDetails.Current as Model.MouldAttachment;
            this._productMould.Details.Remove(mouldAttachment);
            this.bindingSourceDetails.DataSource = this._productMould.Details;
            //this.gridControl2.RefreshDataSource();
        }
Example #2
0
 /// <summary>
 /// Update a MouldAttachment.
 /// </summary>
 public void Update(Model.MouldAttachment mouldAttachment)
 {
     //
     // todo: add other logic here.
     //
     accessor.Update(mouldAttachment);
 }
Example #3
0
 /// <summary>
 /// Insert a MouldAttachment.
 /// </summary>
 public void Insert(Model.MouldAttachment mouldAttachment)
 {
     //
     // todo:add other logic here
     //
     accessor.Insert(mouldAttachment);
 }
 private void sbtn_last_Click(object sender, EventArgs e)
 {
     if (this._mouldattenachmentManager.HasRowsBefore(this._mouldattachment))
     {
         this._mouldattachment = this._mouldattenachmentManager.GetPrev(this._mouldattachment);
     }
     if (this._mouldattachment == null)
     {
         this._mouldattachment = this._mouldattenachmentManager.GetFirst();
     }
     //if (this._mouldattachment.Picture != null && this._mouldattachment.Picture.Length > 0)
     //    this.pictureEditpic.Image = Image.FromStream(new System.IO.MemoryStream(this._mouldattachment.Picture));
 }
        public override void Refresh()
        {
            if (this._productMould == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            if (this.action == "view")
            {
                this._productMould = this._proMouldManager.Get(this._productMould.MouldId);
                if (this._productMould == null)
                {
                    this.AddNew();
                    this.action = "insert";
                }
            }


            this.textEditId.Text        = this._productMould.Id;
            this.textEditMouldName.Text = this._productMould.MouldName;
            //this.buttonEditProductId.EditValue = this._productMould.Product;
            if (this._productMould.SupplierId != "")
            {
                this.newChooseContorlSupplierId.EditValue = this._productMould.Supplier;
            }
            if (this._productMould.MouldCategoryId != "")
            {
                this.lookUpEditMouldCategoryId.EditValue = this._productMould.MouldCategoryId;
            }
            //this.textEditMachineKind.Text = this._productMould.MachineKind;
            this.textEditMouldSpecification.Text = this._productMould.MouldSpecification;
            //this.textEditProductSpecification.Text = this._productMould.ProductSpecification;

            //if (this._productMould.Employee0Id != null)
            //    this.newChooseContorlEmployee0Id.EditValue = this._productMould.Employee0Id;
            //if (this._productMould.EmployeeId != null)
            //    this.newChooseContorlEmployeeId.EditValue = this._productMould.EmployeeId;
            this.newChooseContorlEmployee0Id.EditValue = this._productMould.Employee0;
            this.newChooseContorlEmployeeId.EditValue  = this._productMould.Employee;

            //this.newChooseContorlKeeper.EditValue = this._productMould.Keeper;
            if (this._productMould.MouldMaterial != null)
            {
                this.lookUpEditMouldMaterial.EditValue = this._productMould.MouldMaterial;
            }
            this.memoEditMouldDescription.Text = this._productMould.MouldDescription;

            //this.textEditpartName.Text = this._productMould.PartName;
            this.spinEditpartWeight.Text   = this._productMould.PartWeight.ToString();
            this.spinEditMouldPrice.Text   = this._productMould.MouldPrice.ToString();
            this.textEditMouldBarCode.Text = this._productMould.MouldBarCode;

            if (this._productMould.CodeIsAotu != null)
            {
                if (this._productMould.CodeIsAotu.Value)
                {
                    this.radioGroup.SelectedIndex = 1;
                }
            }
            else
            {
                this.radioGroup.SelectedIndex = 0;
            }

            if (this._productMould.DoubleCount != null)
            {
                this.spinEditDoubleCount.Text = this._productMould.DoubleCount.Value.ToString();
            }
            else
            {
                this.spinEditDoubleCount.Text = "0";
            }
            //if (this._productMould.StartTime != null && this._productMould.StartTime != new DateTime() && this._productMould.StartTime != global::Helper.DateTimeParse.NullDate)
            //    this.dateEditStartTime.Text = this._productMould.StartTime.ToString();
            //else
            //    this.dateEditStartTime.DateTime = System.DateTime.Now;
            //if (this._productMould.FirstTime != null && this._productMould.FirstTime != new DateTime() && this._productMould.FirstTime != global::Helper.DateTimeParse.NullDate)
            //    this.dateEditFirstTime.Text = this._productMould.FirstTime.ToString();
            //else
            //    this.dateEditFirstTime.Text = "";
            //if (this._productMould.OkTime != null && this._productMould.OkTime != new DateTime() && this._productMould.OkTime != global::Helper.DateTimeParse.NullDate)
            //    this.dateEditOkTime.Text = this._productMould.OkTime.ToString();
            //else
            //    this.dateEditOkTime.DateTime = System.DateTime.Now;
            this.dateEditStartTime.EditValue = this._productMould.StartTime;
            this.dateEditFirstTime.EditValue = this._productMould.FirstTime;
            this.dateEditOkTime.EditValue    = this._productMould.OkTime;

            //this.buttonEdit1.Text = "";
            //this.memoEditDescription.Text = "1";
            //this.pictureEditpic.Image = null;


            this.bindingSource1.DataSource = this._proMouldManager.Select();
            this._productMould.Details     = this._mouldattenachmentManager.SelectByMouldId(this._productMould);
            //this.bindingSourceDetails.DataSource = this._productMould.Details;

            if (this._productMould.Details.Count > 0)
            {
                if (this._mouldattachment == null)
                {
                    this._mouldattachment = this._mouldattenachmentManager.GetFirst();
                }
                //if (this._mouldattachment.Picture != null && this._mouldattachment.Picture.Length > 0)
                //    this.pictureEditpic.Image = Image.FromStream(new System.IO.MemoryStream(this._mouldattachment.Picture));
            }
            //else
            //    this.pictureEditpic.Image = null;

            //获取已上传文件列表
            GetHasUpLoadFiles();

            base.Refresh();
            switch (this.action)
            {
            case "insert":
                break;

            case "update":
                //if (this._productMould.OkTime.HasValue)
                //{
                //    this.dateEditOkTime.Properties.ReadOnly = true;
                //}
                //else
                //{
                //    this.dateEditOkTime.Properties.ReadOnly = false;
                //}
                break;

            case "view":
                break;
            }
        }
Example #6
0
 public Model.MouldAttachment GetNext(Model.MouldAttachment e)
 {
     return(accessor.GetNext(e));
 }
Example #7
0
 public bool HasRowsAfter(Model.MouldAttachment e)
 {
     return(accessor.HasRowsAfter(e));
 }
Example #8
0
 public Model.MouldAttachment GetPrev(Model.MouldAttachment e)
 {
     return(accessor.GetPrev(e));
 }
 public Model.MouldAttachment GetPrev(Model.MouldAttachment e)
 {
     return(sqlmapper.QueryForObject <Model.MouldAttachment>("MouldAttachment.get_prev", e));
 }
Example #10
0
 public bool HasRowsBefore(Model.MouldAttachment e)
 {
     return(accessor.HasRowsBefore(e));
 }
 public Model.MouldAttachment GetNext(Model.MouldAttachment e)
 {
     return(sqlmapper.QueryForObject <Model.MouldAttachment>("MouldAttachment.get_next", e));
 }
 public bool HasRowsAfter(Model.MouldAttachment e)
 {
     return(sqlmapper.QueryForObject <bool>("MouldAttachment.has_rows_after", e));
 }
 public bool HasRowsBefore(Model.MouldAttachment e)
 {
     return(sqlmapper.QueryForObject <bool>("MouldAttachment.has_rows_before", e));
 }
 public void Update(Model.MouldAttachment e)
 {
     this.Update <Model.MouldAttachment>(e);
 }
 public void Insert(Model.MouldAttachment e)
 {
     this.Insert <Model.MouldAttachment>(e);
 }