/// <summary>
 /// Update a ProduceMaterialExitDetail.
 /// </summary>
 public void Update(Model.ProduceMaterialExitDetail produceMaterialExitDetail)
 {
     //
     // todo: add other logic here.
     //
     accessor.Update(produceMaterialExitDetail);
 }
Пример #2
0
        private void gridView1_CellValueChanging_1(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            Model.ProduceMaterialExitDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.ProduceMaterialExitDetail;

            if (e.Column == this.ColProductId)
            {
                if (detail != null)
                {
                    Model.Product p = productManager.Get(e.Value.ToString());
                    detail.ProduceMaterialExitDetailId = Guid.NewGuid().ToString();
                    detail.ProduceQuantity             = 0;
                    // detail.ProduceAllUserQuantity = 0;
                    detail.Product      = p;
                    detail.ProductStock = p.StocksQuantity;
                    detail.ProductId    = p.ProductId;
                    //  detail.DepotPosition = null;
                    this.bindingSourceDetails.Position = this.bindingSourceDetails.IndexOf(detail);
                }
                this.gridControl1.RefreshDataSource();
            }
            //if (e.Column == this.gridColumnDepot)
            //{
            //    detail.DepotPosition = null;
            //}
        }
 /// <summary>
 /// Insert a ProduceMaterialExitDetail.
 /// </summary>
 public void Insert(Model.ProduceMaterialExitDetail produceMaterialExitDetail)
 {
     //
     // todo:add other logic here
     //
     accessor.Insert(produceMaterialExitDetail);
 }
Пример #4
0
        private void simpleButtonExit_Click(object sender, EventArgs e)
        {
            produceManager.ProduceMaterialExit.ChooseProduceMaterialExit form = new produceManager.ProduceMaterialExit.ChooseProduceMaterialExit();
            if (form.ShowDialog(this) == DialogResult.OK)
            {
                if (form.key != null && form.key.Count > 0)
                {
                    if (this._depotIn.Details.Count > 0 && string.IsNullOrEmpty(this._depotIn.Details[0].ProductId))
                    {
                        this._depotIn.Details.RemoveAt(0);
                    }
                    //string[] str = (from x in xo.Details select "'" + x.ProductId + "'").Distinct().ToArray();
                    //this.bindingSourceProduct.DataSource = this.productManager.SelectByProductIds(str.Aggregate<string>((a, b) => a + "," + b));
                    //this.gridControl1.RefreshDataSource();

                    //Model.ProduceMaterialExitDetail xo = this.produceMaterialExitDetailManager.Get(form.key[0]);
                    ////invoice.InvoiceXO = xo;
                    //invoice.InvoiceXOId = xo.InvoiceId;

                    //invoice.Customer = xo.Invoice.Customer;
                    //invoice.CustomerId = xo.Invoice.CustomerId;
                    ////invoice.CustomerInvoiceXOId = xo.CustomerInvoiceXOId;
                    //invoice.XSCustomer = xo.Invoice.xocustomer;
                    //if (xo.Invoice.xocustomer != null)
                    //    invoice.XSCustomerId = xo.Invoice.xocustomer.CustomerId;

                    //invoice.InvoiceAbstract = xo.Invoice.InvoiceAbstract;
                    //invoice.InvoiceNote = xo.Invoice.InvoiceNote;
                    //invoice.Customer = xo.Customer;
                    //invoice.XSCustomer = xo.xocustomer;
                    //   textEditiInvoiceXOId.Text = xo.InvoiceId;
                    Model.DepotInDetail detail;
                    foreach (string keyid in form.key)
                    {
                        Model.ProduceMaterialExitDetail ExitDetail = this.produceMaterialExitDetailManager.Get(keyid);
                        detail = new Book.Model.DepotInDetail();
                        detail.DepotInDetailId = Guid.NewGuid().ToString();
                        detail.Inumber         = this._depotIn.Details.Count + 1;
                        // detaill.DepotInQuantity = ExitDetail.ProduceQuantity;
                        detail.Product         = ExitDetail.Product;
                        detail.ProductId       = ExitDetail.ProductId;
                        detail.DepotInQuantity = ExitDetail.ProduceQuantity;
                        detail.ProductUnit     = ExitDetail.ProductUnit;
                        // detaill.ProductUnit = ExitDetail.ProductUnit;
                        detail.InvoiceId         = ExitDetail.ProduceMaterialExitId;
                        detail.InvoiceDetailId   = ExitDetail.ProduceMaterialExitDetailId;
                        detail.HandbookId        = ExitDetail.HandbookId;
                        detail.HandbookProductId = ExitDetail.HandbookProductId;

                        this._depotIn.Details.Add(detail);
                    }
                    this.gridControl1.RefreshDataSource();
                }
                form.Dispose();
                GC.Collect();
            }
        }
Пример #5
0
        protected override Book.UI.Settings.BasicData.BaseEditForm GetEditForm(object[] args)
        {
            Model.ProduceMaterialExitDetail detail = args[0] as Model.ProduceMaterialExitDetail;
            if (detail != null)
            {
                args[0] = detail.ProduceMaterialExit;
            }

            Type type = typeof(EditForm);

            return((EditForm)type.Assembly.CreateInstance(type.FullName, false, System.Reflection.BindingFlags.CreateInstance, null, args, null, null));
        }
Пример #6
0
        private void simpleButtonAppend_Click(object sender, EventArgs e)
        {
            ChooseProductForm f = new ChooseProductForm();

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                if (this._produceMaterialExit.Detail.Count > 0 && string.IsNullOrEmpty(this._produceMaterialExit.Detail[0].ProductId))
                {
                    this._produceMaterialExit.Detail.RemoveAt(0);
                }
                Model.ProduceMaterialExitDetail detail = null;
                if (ChooseProductForm.ProductList != null || ChooseProductForm.ProductList.Count > 0)
                {
                    foreach (Model.Product product in ChooseProductForm.ProductList)
                    {
                        detail = new Book.Model.ProduceMaterialExitDetail();
                        detail.ProduceMaterialExitDetailId = Guid.NewGuid().ToString();
                        detail.Inumber   = this._produceMaterialExit.Detail.Count + 1;
                        detail.Product   = product;
                        detail.ProductId = product.ProductId;
                        //detail.ProduceAllUserQuantity = 0;
                        detail.ProduceQuantity = 0;
                        //  detail.ProductStock = product.StocksQuantity;
                        detail.ProductUnit = detail.Product.ProduceUnit == null ? null : detail.Product.ProduceUnit.CnName;
                        //detail.ProductSpecification = (f.SelectedItem as Model.Product).ProductSpecification;
                        this._produceMaterialExit.Detail.Add(detail);
                    }
                }
                if (ChooseProductForm.ProductList == null || ChooseProductForm.ProductList.Count == 0)
                {
                    detail         = new Book.Model.ProduceMaterialExitDetail();
                    detail.Inumber = this._produceMaterialExit.Detail.Count + 1;
                    Model.Product product = f.SelectedItem as Model.Product;
                    detail.ProduceMaterialExitDetailId = Guid.NewGuid().ToString();
                    detail.Product   = f.SelectedItem as Model.Product;
                    detail.ProductId = (f.SelectedItem as Model.Product).ProductId;
                    // detail.ProduceAllUserQuantity = 0;
                    detail.ProduceQuantity = 0;
                    detail.ProductUnit     = detail.Product.ProduceUnit == null ? null : detail.Product.ProduceUnit.CnName;
                    //   detail.ProductStock = (f.SelectedItem as Model.Product).StocksQuantity;
                    //detail. = detail.Product.MainUnit == null ? null : detail.Product.MainUnit.CnName;
                    //detail.ProductSpecification = (f.SelectedItem as Model.Product).ProductSpecification;
                    this._produceMaterialExit.Detail.Add(detail);
                }
                this.bindingSourceDetails.Position = this.bindingSourceDetails.IndexOf(detail);
                this.gridControl1.RefreshDataSource();
                // this.bindingSourceProductId.DataSource = productManager.Select();
            }
        }
Пример #7
0
        private void btn_EndPMEId_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            ChooseProduceMaterialExit form = new ChooseProduceMaterialExit();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                if (form.detailList != null)
                {
                    Model.ProduceMaterialExitDetail detail = form.detailList.FirstOrDefault(D => D.IsChecked == true);
                    if (detail != null)
                    {
                        this.btn_EndPMEId.EditValue = detail.ProduceMaterialExitId;
                    }
                }
            }
        }
Пример #8
0
        private void gridView2_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            if (e.Column.Name == "gridColumnCheck")
            {
                Model.ProduceMaterialExitDetail detail = this.gridView2.GetRow(e.RowHandle) as Model.ProduceMaterialExitDetail;

                if ((bool)e.Value)
                {
                    key.Add(detail.ProduceMaterialExitDetailId);
                    //  MrsDetails.Add(this.mRSdetailsManager.Get(detail.MRSdetailsId));
                }
                if (!(bool)e.Value)
                {
                    key.Remove(detail.ProduceMaterialExitDetailId);
                    //  MrsDetails.Remove(this.mRSdetailsManager.Get(detail.MRSdetailsId));
                }
            }
        }
Пример #9
0
        private void simpleButtonRemove_Click(object sender, EventArgs e)
        {
            if (this.bindingSourceDetails.Current != null)
            {
                this._produceMaterialExit.Detail.Remove(this.bindingSourceDetails.Current as Book.Model.ProduceMaterialExitDetail);

                if (this._produceMaterialExit.Detail.Count == 0)
                {
                    Model.ProduceMaterialExitDetail detail = new Model.ProduceMaterialExitDetail();
                    detail.ProduceMaterialExitDetailId = Guid.NewGuid().ToString();
                    //detail.MPSheaderId = null;
                    detail.ProduceQuantity = 0;
                    detail.ProductStock    = 0;
                    detail.Product         = new Book.Model.Product();

                    this._produceMaterialExit.Detail.Add(detail);
                    this.bindingSourceDetails.Position = this.bindingSourceDetails.IndexOf(detail);
                }
                this.gridControl1.RefreshDataSource();
            }
        }
Пример #10
0
 public void Update(Model.ProduceMaterialExitDetail e)
 {
     this.Update <Model.ProduceMaterialExitDetail>(e);
 }
Пример #11
0
 public void Insert(Model.ProduceMaterialExitDetail e)
 {
     this.Insert <Model.ProduceMaterialExitDetail>(e);
 }