Ejemplo n.º 1
0
        //组装加工
        private void smp_PronoteHeader_Click(object sender, EventArgs e)
        {
            produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm f = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm();
            if (f.ShowDialog(this) == DialogResult.OK)
            {
                this._depotIn.Details.Clear();
                foreach (var item in produceManager.PronoteHeader.ChoosePronoteHeaderDetailsForm._pronoteHeaderList)
                {
                    this._depotInDetail = new Book.Model.DepotInDetail();
                    this._depotInDetail.DepotInDetailId = Guid.NewGuid().ToString();
                    _depotInDetail.Inumber = this._depotIn.Details.Count + 1;
                    //   this._depotInDetail.DepotInPrice = item.ProduceInDepotPrice.Value;
                    this._depotInDetail.DepotInQuantity = item.DetailsSum;
                    // this._depotInDetail.DepotInTotal = item.ProduceMoney.Value;
                    //this._depotInDetail.DepotPositionId = item.DepotPositionId;
                    //this._depotInDetail.DepotPosition = item.DepotPosition;
                    this._depotInDetail.ProductId   = item.ProductId;
                    this._depotInDetail.ProductUnit = item.ProductUnit;

                    //if(item.ProductProce!=null)
                    //this._depotInDetail.Product = item.ProductProce;
                    //else
                    this._depotInDetail.Product         = item.Product;
                    this._depotInDetail.PronoteHeaderId = item.PronoteHeaderID;
                    // this._depotInDetail.ProduceInDepotDetailId = item.ProduceInDepotDetailId;
                    // this._depotInDetail.Description=item.de
                    this._depotIn.Details.Add(this._depotInDetail);
                }
                this.gridControl1.RefreshDataSource();
            }
        }
Ejemplo n.º 2
0
 private void simpleButton1_Click(object sender, EventArgs e)
 {
     produceManager.ProduceInDepot.SelectInDepotForm form = new produceManager.ProduceInDepot.SelectInDepotForm();
     if (form.ShowDialog(this) == DialogResult.OK)
     {
         //this.produceInDepot = new Model.ProduceInDepot();
         // this.produceInDepot = produceManager.ProduceInDepot.SelectInDepotForm._produceInDepotDetail;
         this._depotIn.Details.Clear();
         foreach (var item in produceManager.ProduceInDepot.SelectInDepotForm._produceInDepotDetail)
         {
             this._depotInDetail = new Book.Model.DepotInDetail();
             this._depotInDetail.DepotInDetailId = Guid.NewGuid().ToString();
             _depotInDetail.Inumber = this._depotIn.Details.Count + 1;
             //   this._depotInDetail.DepotInPrice = item.ProduceInDepotPrice.Value;
             this._depotInDetail.DepotInQuantity = item.ProduceQuantity.Value;
             // this._depotInDetail.DepotInTotal = item.ProduceMoney.Value;
             this._depotInDetail.DepotPositionId = item.DepotPositionId;
             this._depotInDetail.DepotPosition   = item.DepotPosition;
             this._depotInDetail.ProductId       = item.ProductId;
             this._depotInDetail.ProductUnit     = item.ProductUnit;
             _depotInDetail.HandbookId           = item.HandbookId;
             _depotInDetail.HandbookProductId    = item.HandbookProductId;
             //if(item.ProductProce!=null)
             //this._depotInDetail.Product = item.ProductProce;
             //else
             this._depotInDetail.Product         = item.Product;
             this._depotInDetail.PronoteHeaderId = item.PronoteHeaderId;
             // this._depotInDetail.ProduceInDepotDetailId = item.ProduceInDepotDetailId;
             // this._depotInDetail.Description=item.de
             this._depotIn.Details.Add(this._depotInDetail);
         }
         this.gridControl1.RefreshDataSource();
     }
 }
Ejemplo n.º 3
0
        private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
        {
            if (e.ListSourceRowIndex < 0)
            {
                return;
            }
            IList <Model.DepotInDetail> details = this.bindingSourceDetail.DataSource as IList <Model.DepotInDetail>;

            if (details == null || details.Count < 1)
            {
                return;
            }
            Model.DepotInDetail detail = details[e.ListSourceRowIndex];

            switch (e.Column.Name)
            {
            case "gridColumnCusXOId":
                Model.PronoteHeader pronoteHeader = this.pronoteHeaderManager.Get(detail.PronoteHeaderId);
                if (pronoteHeader == null)
                {
                    return;
                }
                Model.InvoiceXO invoiceXO = this.invoiceXOManager.Get(pronoteHeader.InvoiceXOId);
                e.DisplayText = invoiceXO == null ? string.Empty : invoiceXO.CustomerInvoiceXOId;
                break;
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Update a DepotInDetail.
 /// </summary>
 public void Update(Model.DepotInDetail depotInDetail)
 {
     //
     // todo: add other logic here.
     //
     accessor.Update(depotInDetail);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Insert a DepotInDetail.
 /// </summary>
 public void Insert(Model.DepotInDetail depotInDetail)
 {
     //
     // todo:add other logic here
     //
     accessor.Insert(depotInDetail);
 }
Ejemplo n.º 6
0
        private void repositoryItemLookUpEdit5_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (this.bindingSourceDetail.Current != null && e.Button.Index == 1)
            {
                Model.DepotInDetail detail = this.bindingSourceDetail.Current as Model.DepotInDetail;

                detail.HandbookId        = null;
                detail.HandbookProductId = null;

                this.gridView1.PostEditor();
                this.gridView1.UpdateCurrentRow();
            }
        }
Ejemplo n.º 7
0
 protected override void AddNew()
 {
     this._depotIn                       = new Book.Model.DepotIn();
     this._depotIn.DepotInId             = this._depotInManager.GetId(DateTime.Now.Date);
     this._depotIn.DepotId               = null;
     this._depotIn.Details               = new List <Model.DepotInDetail>();
     this._depotIn.Employee              = BL.V.ActiveOperator.Employee;
     this._depotInDetail                 = new Book.Model.DepotInDetail();
     this._depotInDetail.DepotInDetailId = Guid.NewGuid().ToString();
     this._depotInDetail.Inumber         = this._depotIn.Details.Count + 1;
     this._depotIn.Details.Add(this._depotInDetail);
     this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(this._depotInDetail);
 }
Ejemplo n.º 8
0
        private void simpleButton_Appent_Click(object sender, EventArgs e)
        {
            ChooseProductForm f = new ChooseProductForm();

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                if (this._depotIn.Details.Count > 0 && string.IsNullOrEmpty(this._depotIn.Details[0].ProductId))
                {
                    this._depotIn.Details.RemoveAt(0);
                }
                Model.DepotInDetail detail = null;
                if (ChooseProductForm.ProductList != null || ChooseProductForm.ProductList.Count > 0)
                {
                    foreach (Model.Product product in ChooseProductForm.ProductList)
                    {
                        detail = new Book.Model.DepotInDetail();
                        detail.DepotInDetailId = Guid.NewGuid().ToString();
                        detail.Inumber         = this._depotIn.Details.Count + 1;
                        detail.DepotInId       = this._depotIn.DepotInId;
                        detail.Product         = product;
                        detail.ProductId       = product.ProductId;
                        detail.ProductUnit     = product.DepotUnit == null ? "" : product.DepotUnit.CnName;
                        detail.Description     = product.ProductDescription;
                        this._depotIn.Details.Add(detail);
                    }
                }
                if (ChooseProductForm.ProductList == null || ChooseProductForm.ProductList.Count == 0)
                {
                    detail = new Book.Model.DepotInDetail();
                    detail.DepotInDetailId = Guid.NewGuid().ToString();
                    detail.Inumber         = this._depotIn.Details.Count + 1;
                    detail.DepotInId       = this._depotIn.DepotInId;
                    detail.Product         = f.SelectedItem as Model.Product;
                    detail.ProductId       = (f.SelectedItem as Model.Product).ProductId;
                    detail.ProductUnit     = (f.SelectedItem as Model.Product).DepotUnit == null ? "" : (f.SelectedItem as Model.Product).DepotUnit.CnName;
                    detail.Description     = (f.SelectedItem as Model.Product).ProductDescription;
                    this._depotIn.Details.Add(detail);
                }
                this.gridControl1.RefreshDataSource();
                this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail);
            }
            f.Dispose();
            System.GC.Collect();
        }
Ejemplo n.º 9
0
 private void gridView1_KeyDown(object sender, KeyEventArgs e)
 {
     if (this.action == "insert" || this.action == "update")
     {
         if (e.KeyData == Keys.Enter)
         {
             Model.DepotInDetail detail = new Model.DepotInDetail();
             detail.DepotInDetailId = Guid.NewGuid().ToString();
             detail.Inumber         = this._depotIn.Details.Count + 1;
             detail.DepotInId       = this._depotIn.DepotInId;
             detail.DepotInPrice    = null;
             detail.Description     = "";
             detail.DepotInTotal    = null;
             detail.ProductUnit     = "";
             detail.Product         = new Book.Model.Product();
             this._depotIn.Details.Add(detail);
             this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail);
         }
         if (e.KeyData == Keys.Delete)
         {
             if (this.bindingSourceDetail.Current != null)
             {
                 this._depotIn.Details.Remove(this.bindingSourceDetail.Current as Book.Model.DepotInDetail);
                 if (this._depotIn.Details.Count == 0)
                 {
                     Model.DepotInDetail detail = new Model.DepotInDetail();
                     detail.DepotInDetailId = Guid.NewGuid().ToString();
                     detail.Inumber         = this._depotIn.Details.Count + 1;
                     detail.DepotInId       = this._depotIn.DepotInId;
                     detail.DepotInPrice    = null;
                     detail.Description     = "";
                     detail.DepotInTotal    = null;
                     detail.ProductUnit     = "";
                     detail.Product         = new Book.Model.Product();
                     this._depotIn.Details.Add(detail);
                     this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail);
                 }
             }
         }
         this.gridControl1.RefreshDataSource();
     }
 }
Ejemplo n.º 10
0
        private void simpleButton_remove_Click(object sender, EventArgs e)
        {
            if (this.bindingSourceDetail.Current != null)
            {
                this._depotIn.Details.Remove(this.bindingSourceDetail.Current as Book.Model.DepotInDetail);

                if (this._depotIn.Details.Count == 0)
                {
                    Model.DepotInDetail detail = new Model.DepotInDetail();
                    detail.DepotInDetailId = Guid.NewGuid().ToString();
                    detail.Description     = "";
                    detail.DepotInQuantity = 1;
                    detail.Product         = new Book.Model.Product();
                    this._depotIn.Details.Add(detail);
                    this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail);
                }

                this.gridControl1.RefreshDataSource();
            }
        }
Ejemplo n.º 11
0
 private void gridView1_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     if (e.Column == this.gridColumn3 || e.Column == this.gridColumnProductId || e.Column == this.gridColumnProductName)
     {
         Model.DepotInDetail detail = this.gridView1.GetRow(e.RowHandle) as Model.DepotInDetail;
         if (detail != null)
         {
             Model.Product p = this._productManager.Get(e.Value.ToString());
             //detail.DepotInDetailId = Guid.NewGuid().ToString();
             detail.DepotPositionId            = null;
             detail.DepotInQuantity            = 1;
             detail.DepotInPrice               = null;
             detail.DepotInTotal               = null;
             detail.Product                    = p;
             detail.ProductId                  = p == null ? "" : p.ProductId;
             detail.ProductUnit                = p == null ? "" : p.DepotUnit.CnName;
             detail.DepotInId                  = this._depotIn.DepotInId;
             detail.Description                = p == null ? "" : p.ProductDescription;
             this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(detail);
         }
         this.gridControl1.RefreshDataSource();
     }
 }
Ejemplo n.º 12
0
        public override void Refresh()
        {
            if (this._depotIn == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action != "insert")
                {
                    this._depotIn = this._depotInManager.GetDetails(this._depotIn);
                    if (this._depotIn == null)
                    {
                        this._depotIn                       = new Book.Model.DepotIn();
                        this._depotIn.DepotInId             = this._depotInManager.GetId(DateTime.Now.Date);
                        this._depotIn.Details               = new List <Model.DepotInDetail>();
                        this._depotInDetail                 = new Book.Model.DepotInDetail();
                        this._depotInDetail.DepotInDetailId = Guid.NewGuid().ToString();
                        this._depotIn.Details.Add(this._depotInDetail);
                        this.bindingSourceDetail.Position = this.bindingSourceDetail.IndexOf(this._depotInDetail);
                    }
                }
            }
            if (this._depotIn.Details != null)
            {
                foreach (var item in this._depotIn.Details)
                {
                    if (!string.IsNullOrEmpty(item.PronoteHeaderId))
                    {
                        item.CusXOId = invoiceXOManager.SelectCusXOIdByPronoteHeaderId(item.PronoteHeaderId);
                    }
                }
            }
            this.dateEditDate.EditValue = DateTime.Now;

            this.textEditDepotInId.Text = this._depotIn.DepotInId;
            if (this._depotIn.DepotInDate != null)
            {
                this.dateEditDate.DateTime = this._depotIn.DepotInDate.Value;
            }

            if (this._depotIn.Employee0Id != null)
            {
                this.newChooseEmp1.EditValue = _depotIn.Employee0;
            }
            //else
            //    this.newChooseEmp0.EditValue = null;


            this.newChooseEmp0.EditValue = this._depotIn.Employee;
            //else
            //    this.newChooseEmp.EditValue = null;

            if (this._depotIn.Supplier != null)
            {
                this.newChooseContorlSupplier.EditValue = this._depotIn.Supplier;
            }
            //else
            //    this.newChooseContorlSupplier.EditValue = null;
            this.lookUpEditDepotId.EditValue = this._depotIn.DepotId;



            this.lookUpEditDepotId.EditValue = this._depotIn.DepotId;

            if (this._depotIn.DepotId == null)
            {
                this.bindingSourceDepotPisition.DataSource = null;
            }
            //else this.newChooseEmp.EditValue = null;

            //this.buttonEditProductCategry.EditValue = this._depotIn.ProductCategory;
            //if (this._depotIn.ProductCategory != null)
            //    this.bindingSourceProduct.DataSource = this._productManager.Select(this._depotIn.ProductCategory);
            this.newChooseEmp2.EditValue  = this._depotIn.AuditEmp;
            this.txt_AuditState.EditValue = this.GetAuditName(this._depotIn.AuditState);

            this.bindingSourceDetail.DataSource = this._depotIn.Details;


            this.gridControl1.RefreshDataSource();

            base.Refresh();

            switch (this.action)
            {
            case "insert":
                this.gridView1.OptionsBehavior.Editable    = true;
                this.textEditDepotInId.Properties.ReadOnly = false;
                break;

            case "update":
                this.gridView1.OptionsBehavior.Editable    = true;
                this.textEditDepotInId.Properties.ReadOnly = true;
                break;

            case "view":
                this.gridView1.OptionsBehavior.Editable    = false;
                this.textEditDepotInId.Properties.ReadOnly = true;
                break;
            }
        }
Ejemplo n.º 13
0
 public void Update(Model.DepotInDetail e)
 {
     this.Update <Model.DepotInDetail>(e);
 }
Ejemplo n.º 14
0
 public void Insert(Model.DepotInDetail e)
 {
     this.Insert <Model.DepotInDetail>(e);
 }