Ejemplo n.º 1
0
 /// <summary>
 /// Update a MPSdetails.
 /// </summary>
 public void Update(Model.MPSdetails mPSdetails)
 {
     //
     // todo: add other logic here.
     //
     accessor.Update(mPSdetails);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Insert a MPSdetails.
 /// </summary>
 public void Insert(Model.MPSdetails mPSdetails)
 {
     //
     // todo:add other logic here
     //
     mPSdetails.MPSdetailsId = Guid.NewGuid().ToString();
     accessor.Insert(mPSdetails);
 }
Ejemplo n.º 3
0
        public void Delete(Model.MPSheader mPSheader)
        {
            try
            {
                BL.V.BeginTransaction();

                foreach (Model.MPSdetails mPSdetails in mPSheader.Details)
                {
                    Model.InvoiceXODetail xodetail = this.InvoiceXODetailAccessor.Get(mPSdetails.InvoiceXODetailId);
                    if (xodetail != null)
                    {
                        Model.MPSdetails md = MPSdetailsAccessor.Get(mPSdetails.MPSdetailsId);
                        if (xodetail.InvoiceMPSQuantity == null)
                        {
                            xodetail.InvoiceMPSQuantity = 0;
                        }
                        xodetail.InvoiceMPSQuantity = Convert.ToDouble(xodetail.InvoiceMPSQuantity) - Convert.ToDouble(md.MPSdetailssum);
                        xodetail.InvoiceMPSQuantity = xodetail.InvoiceMPSQuantity < 0 ? 0 : xodetail.InvoiceMPSQuantity;
                        if (xodetail.InvoiceMPSQuantity >= xodetail.InvoiceXODetailQuantity)
                        {
                            xodetail.DetailMPSState = 2;
                        }
                        else
                        {
                            if (xodetail.InvoiceMPSQuantity > 0)
                            {
                                xodetail.DetailMPSState = 1;
                            }
                            else
                            {
                                xodetail.DetailMPSState = 0;
                            }
                        }
                        //invoiceXODetail.InvoiceMPSQuantity = Convert.ToDouble(MPSdetailsAccessor.GetByInvoiceXODetailId(mPSdetails.InvoiceXODetailId));
                        invoiceManager.Update(xodetail);
                        UpdateInvoiceXOFlag(xodetail.Invoice);
                    }
                }

                accessor.Delete(mPSheader.MPSheaderId);

                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
Ejemplo n.º 4
0
        private void bindingSourceMPS_CurrentChanged(object sender, EventArgs e)
        {
            this._mpsDetails = this.bindingSourceMPS.Current as Model.MPSdetails;
            if (this._mpsDetails == null)
            {
                return;
            }
            detail = this.mRShetailsManager.Select(this._mpsDetails.MPSheaderId, ((Int32)global::Helper.ProductType.HomeMade).ToString(), ((Int32)global::Helper.ProductType.Package).ToString(), ((Int32)global::Helper.ProductType.HomeMadeProcee).ToString());
            this.bindingSource1.DataSource = detail;

            if (this._mpsDetails.IsPronoteHeader == null || !(bool)this._mpsDetails.IsPronoteHeader)
            {
                this.barButtonItem1.Enabled = true;
            }
            else
            {
                this.barButtonItem1.Enabled = false;
            }
            //this.gridControl1.RefreshDataSource();
        }
Ejemplo n.º 5
0
 public void Update(Model.MPSdetails e)
 {
     this.Update <Model.MPSdetails>(e);
 }
Ejemplo n.º 6
0
 public void Insert(Model.MPSdetails e)
 {
     this.Insert <Model.MPSdetails>(e);
 }