Exemple #1
0
 /// <summary>
 /// Update a AcOtherShouldPaymentDetail.
 /// </summary>
 public void Update(Model.AcOtherShouldPaymentDetail acOtherShouldPaymentDetail)
 {
     //
     // todo: add other logic here.
     //
     accessor.Update(acOtherShouldPaymentDetail);
 }
Exemple #2
0
 /// <summary>
 /// Insert a AcOtherShouldPaymentDetail.
 /// </summary>
 public void Insert(Model.AcOtherShouldPaymentDetail acOtherShouldPaymentDetail)
 {
     //
     // todo:add other logic here
     //
     accessor.Insert(acOtherShouldPaymentDetail);
 }
Exemple #3
0
        private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            if (e.Column == this.colAcItemPrice || e.Column == this.colAcQuantity)
            {
                Model.AcOtherShouldPaymentDetail CurrentDetail = this.AcOtherShouldPayment.Details[e.RowHandle];
                double?mInvoiceTaxrate   = (calcTaxRate.EditValue == null || string.IsNullOrEmpty(this.calcTaxRate.EditValue.ToString())) ? 0 : double.Parse(this.calcTaxRate.EditValue.ToString());
                global::Helper.TaxType t = (Helper.TaxType) this.TaxType.SelectedIndex;

                CurrentDetail.AcItemPrice = this.GetDecimal((CurrentDetail.AcItemPrice.HasValue ? CurrentDetail.AcItemPrice.Value : 0), BL.V.SetDataFormat.CGDJXiao.Value);
                //CurrentDetail.AcQuantity = this.GetDecimal(CurrentDetail.AcQuantity.HasValue ? CurrentDetail.AcQuantity.Value : 0, BL.V.SetDataFormat.CGSLXiao.Value);
                CurrentDetail.AcMoney = this.GetDecimal(CurrentDetail.AcItemPrice.Value * CurrentDetail.AcQuantity.Value, BL.V.SetDataFormat.CGJEXiao.Value);

                if (CurrentDetail.AcQuantity.HasValue && CurrentDetail.AcQuantity.Value > 0)
                {
                    CurrentDetail.TaxCalualateDictionary = new global::Helper.TaxCalculateHelper(t, mInvoiceTaxrate.Value, mInvoiceTaxrate.Value, CurrentDetail.AcMoney.Value, CurrentDetail.AcQuantity.Value).TaxCalculateDictionary;
                    this.CalculateMoney();
                }

                this.gridControl1.RefreshDataSource();
                //this.CalcHeJI();
            }

            if (e.Column == this.colLoanName)
            {
                Model.AcOtherShouldPaymentDetail CurrentDetail = this.AcOtherShouldPayment.Details[e.RowHandle];
                IList <Model.AcItem>             acilist       = (from Model.AcItem ac in acitemlist
                                                                  where ac.ItemName == CurrentDetail.LoanName
                                                                  select ac).ToList <Model.AcItem>();

                if (acilist != null && acilist.Count != 0)
                {
                    Model.AcItem aci = acilist.First <Model.AcItem>();

                    CurrentDetail.AcItemId = aci.AcItemId;
                    CurrentDetail.AcItem   = aci;
                    CurrentDetail.LoanName = aci.ItemName;

                    double?mInvoiceTaxrate   = (calcTaxRate.EditValue == null || string.IsNullOrEmpty(this.calcTaxRate.EditValue.ToString())) ? 0 : double.Parse(this.calcTaxRate.EditValue.ToString());
                    global::Helper.TaxType t = (Helper.TaxType) this.TaxType.SelectedIndex;

                    CurrentDetail.AcItemPrice = this.GetDecimal(aci.ItemPrice.HasValue ? aci.ItemPrice.Value : 0, BL.V.SetDataFormat.CGDJXiao.Value);
                    //CurrentDetail.AcQuantity = this.GetDecimal(CurrentDetail.AcQuantity.HasValue ? CurrentDetail.AcQuantity.Value : 0, BL.V.SetDataFormat.CGSLXiao.Value);
                    CurrentDetail.AcMoney = this.GetDecimal(CurrentDetail.AcItemPrice.Value * CurrentDetail.AcQuantity.Value, BL.V.SetDataFormat.CGJEXiao.Value);

                    if (CurrentDetail.AcQuantity.HasValue && CurrentDetail.AcQuantity.Value > 0)
                    {
                        CurrentDetail.TaxCalualateDictionary = new global::Helper.TaxCalculateHelper(t, mInvoiceTaxrate.Value, mInvoiceTaxrate.Value, CurrentDetail.AcMoney.Value, CurrentDetail.AcQuantity.Value).TaxCalculateDictionary;
                        this.CalculateMoney();
                    }

                    this.gridControl1.RefreshDataSource();
                }
                else
                {
                    CurrentDetail             = new Book.Model.AcOtherShouldPaymentDetail();
                    CurrentDetail.AcItemPrice = 0;
                    CurrentDetail.AcMoney     = 0;
                    CurrentDetail.AcQuantity  = 0;
                    this.gridControl1.RefreshDataSource();
                }
            }
        }
Exemple #4
0
 public void Update(Model.AcOtherShouldPaymentDetail e)
 {
     this.Update <Model.AcOtherShouldPaymentDetail>(e);
 }
Exemple #5
0
 public void Insert(Model.AcOtherShouldPaymentDetail e)
 {
     this.Insert <Model.AcOtherShouldPaymentDetail>(e);
 }