Пример #1
0
 protected override void MoveLast()
 {
     //if (AcOtherShouldCollection == null)
     {
         this.AcOtherShouldCollection = this.AcOtherShouldCollectionManager.Get(this.AcOtherShouldCollectionManager.GetLast() == null ? "" : this.AcOtherShouldCollectionManager.GetLast().AcOtherShouldCollectionId);
     }
 }
Пример #2
0
 public EditForm(Model.AcOtherShouldCollection AcOtherShouldCollection, string action)
     : this()
 {
     this.AcOtherShouldCollection         = AcOtherShouldCollection;
     this.AcOtherShouldCollection.Details = this.AcOtherShouldCollectionDetailManager.Select(AcOtherShouldCollection);
     this.action = action;
 }
Пример #3
0
 private void calEffect(IList <Model.AcCollectionDetail> detail)
 {
     foreach (Model.AcCollectionDetail item in detail)
     {
         if (string.IsNullOrEmpty(item.AcInvoiceId))
         {
             continue;
         }
         if (item.AcInvoiceType == "銷售發票單")
         {
             Model.AcInvoiceXOBill xobill = acInvoiceXOBillaccessor.Get(item.AcInvoiceId);
             if (xobill == null)
             {
                 continue;
             }
             xobill.mHeXiaoJingE  = xobill.mHeXiaoJingE == null ? 0 : xobill.mHeXiaoJingE - item.DomesticThisChargeMoney;
             xobill.NoHeXiaoTotal = xobill.ZongMoney - xobill.mHeXiaoJingE;
             acInvoiceXOBillaccessor.Update(xobill);
         }
         else if (item.AcInvoiceType == "其它應收款")
         {
             Model.AcOtherShouldCollection acoSc = acOtherShouldCollectionAccessor.Get(item.AcInvoiceId);
             if (acoSc == null)
             {
                 continue;
             }
             acoSc.mHeXiaoJingE  = acoSc.mHeXiaoJingE == null ? 0 : acoSc.mHeXiaoJingE - item.DomesticThisChargeMoney;
             acoSc.NoHeXiaoTotal = acoSc.HeJi - acoSc.mHeXiaoJingE;
             acOtherShouldCollectionAccessor.Update(acoSc);
         }
     }
 }
 public void Delete(Model.AcOtherShouldCollection acOtherShouldCollection)
 {
     //
     // todo:add other logic here
     //
     accessor.Delete(acOtherShouldCollection.AcOtherShouldCollectionId);
 }
Пример #5
0
        private void addDetail(Model.AcCollection acCollection)
        {
            foreach (Model.AcCollectionDetail item in acCollection.Detail)
            {
                if (string.IsNullOrEmpty(item.AcInvoiceId))
                {
                    continue;
                }
                item.AcCollectionId = acCollection.AcCollectionId;
                if (item.AcInvoiceType == "銷售發票單")
                {
                    Model.AcInvoiceXOBill xobill = acInvoiceXOBillaccessor.Get(item.AcInvoiceId);
                    if (xobill == null)
                    {
                        goto mustdo;
                    }
                    xobill.mHeXiaoJingE  = xobill.mHeXiaoJingE == null ? 0 : xobill.mHeXiaoJingE + item.DomesticThisChargeMoney;
                    xobill.NoHeXiaoTotal = xobill.ZongMoney - xobill.mHeXiaoJingE;
                    acInvoiceXOBillaccessor.Update(xobill);
                }
                else if (item.AcInvoiceType == "其它應收款")
                {
                    Model.AcOtherShouldCollection acoSc = acOtherShouldCollectionAccessor.Get(item.AcInvoiceId);
                    if (acoSc == null)
                    {
                        goto mustdo;
                    }
                    acoSc.mHeXiaoJingE  = acoSc.mHeXiaoJingE == null ? 0 : acoSc.mHeXiaoJingE + item.DomesticThisChargeMoney;
                    acoSc.NoHeXiaoTotal = acoSc.HeJi - acoSc.mHeXiaoJingE;
                    acOtherShouldCollectionAccessor.Update(acoSc);
                }
mustdo:
                acCollectionDetailaccessor.Insert(item);
            }
        }
Пример #6
0
 protected override void MovePrev()
 {
     Model.AcOtherShouldCollection AcOtherShouldCollection = this.AcOtherShouldCollectionManager.GetPrev(this.AcOtherShouldCollection);
     if (AcOtherShouldCollection == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this.AcOtherShouldCollection = this.AcOtherShouldCollectionManager.Get(AcOtherShouldCollection.AcOtherShouldCollectionId);
 }
 public Model.AcOtherShouldCollection GetDetails(string AcOtherShouldCollectionId)
 {
     Model.AcOtherShouldCollection AcOtherShouldCollection = accessor.Get(AcOtherShouldCollectionId);
     if (AcOtherShouldCollection != null)
     {
         AcOtherShouldCollection.Details = AcOtherShouldCollectionDetailAccessor.Select(AcOtherShouldCollection);
     }
     return(AcOtherShouldCollection);
 }
Пример #8
0
 //List搜索
 private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     UI.AccountPayable.AcOtherShouldCollection.ListForm f = new ListForm();
     if (f.ShowDialog(this) == DialogResult.OK)
     {
         this.AcOtherShouldCollection = f.SelectItem;
         this.action = "view";
         this.Refresh();
     }
 }
 private void Validate(Model.AcOtherShouldCollection acOtherShouldCollection)
 {
     if (string.IsNullOrEmpty(acOtherShouldCollection.AcOtherShouldCollectionId))
     {
         throw new Helper.RequireValueException(Model.AcOtherShouldCollection.PRO_AcOtherShouldCollectionId);
     }
     if (acOtherShouldCollection.InvoiceTax + acOtherShouldCollection.InvoiceHeji != acOtherShouldCollection.HeJi)
     {
         throw new Helper.InvalidValueException(Model.AcOtherShouldCollection.PRO_InvoiceHeji);
     }
 }
 /// <summary>
 /// Update a AcOtherShouldCollection.
 /// </summary>
 public void Update(Model.AcOtherShouldCollection acOtherShouldCollection)
 {
     //
     // todo: add other logic here.
     //
     Validate(acOtherShouldCollection);
     if (acOtherShouldCollection != null)
     {
         this.Delete(acOtherShouldCollection);
         acOtherShouldCollection.UpdateTime = DateTime.Now;
         this.Insert(acOtherShouldCollection);
     }
 }
Пример #11
0
 protected override void AddNew()
 {
     this.AcOtherShouldCollection = new Model.AcOtherShouldCollection();
     this.AcOtherShouldCollection.AcOtherShouldCollectionId   = this.AcOtherShouldCollectionManager.GetId();
     this.AcOtherShouldCollection.AcOtherShouldCollectionDate = DateTime.Now;
     this.AcOtherShouldCollection.TaxCaluType = 0;
     this.AcOtherShouldCollection.Details     = new List <Model.AcOtherShouldCollectionDetail>();
     this.AcOtherShouldCollection.Employee    = BL.V.ActiveOperator.Employee;
     if (this.action == "insert")
     {
         Model.AcOtherShouldCollectionDetail detail = new Model.AcOtherShouldCollectionDetail();
         detail.AcOtherShouldCollectionId = this.AcOtherShouldCollection.AcOtherShouldCollectionId;
         this.AcOtherShouldCollection.Details.Add(detail);
         this.bindingSource1.Position = this.bindingSource1.IndexOf(detail);
     }
 }
        /// <summary>
        /// Insert a AcOtherShouldCollection.
        /// </summary>
        public void Insert(Model.AcOtherShouldCollection acOtherShouldCollection)
        {
            //
            // todo:add other logic here
            //
            Validate(acOtherShouldCollection);
            try
            {
                acOtherShouldCollection.InsertTime = DateTime.Now;
                BL.V.BeginTransaction();
                string invoiceKind   = this.GetInvoiceKind().ToLower();
                string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, acOtherShouldCollection.InsertTime.Value.Year);
                string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, acOtherShouldCollection.InsertTime.Value.Year, acOtherShouldCollection.InsertTime.Value.Month);
                string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, acOtherShouldCollection.InsertTime.Value.ToString("yyyy-MM-dd"));
                string sequencekey   = string.Format(invoiceKind);

                SequenceManager.Increment(sequencekey_y);
                SequenceManager.Increment(sequencekey_m);
                SequenceManager.Increment(sequencekey_d);
                SequenceManager.Increment(sequencekey);


                accessor.Insert(acOtherShouldCollection);

                foreach (Model.AcOtherShouldCollectionDetail acOtherShouldCollectionDetail in acOtherShouldCollection.Details)
                {
                    acOtherShouldCollectionDetail.AcOtherShouldCollectionDetailId = Guid.NewGuid().ToString();
                    acOtherShouldCollectionDetail.AcOtherShouldCollectionId       = acOtherShouldCollection.AcOtherShouldCollectionId;
                    AcOtherShouldCollectionDetailAccessor.Insert(acOtherShouldCollectionDetail);
                }

                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
Пример #13
0
 public void Insert(Model.AcOtherShouldCollection e)
 {
     this.Insert <Model.AcOtherShouldCollection>(e);
 }
Пример #14
0
 public bool HasRowsAfter(Model.AcOtherShouldCollection e)
 {
     return(accessor.HasRowsAfter(e));
 }
Пример #15
0
 public bool HasRowsBefore(Model.AcOtherShouldCollection e)
 {
     return(sqlmapper.QueryForObject <bool>("AcOtherShouldCollection.has_rows_before", e));
 }
Пример #16
0
        public XO(string acOtherShouldCollectionId)
        {
            InitializeComponent();
            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelDataName.Text        = "其他應收款";
            this.xrLabelPrintDate.Text       = "列表日期: " + DateTime.Now.ToShortDateString();
            this.acOtherShouldCollection     = this.acOtherShouldCollectionManager.Get(acOtherShouldCollectionId);
            if (this.acOtherShouldCollection == null)
            {
                return;
            }
            this.acOtherShouldCollection.Details = this.acOtherShouldCollectionDetailManager.Select(this.acOtherShouldCollection);
            this.DataSource = this.acOtherShouldCollection.Details;
            if (this.acOtherShouldCollection.Customer != null)
            {
                this.xrLabelCustomerId.Text = this.acOtherShouldCollection.Customer.CustomerShortName;
            }
            this.xrLabelId.Text = this.acOtherShouldCollection.AcOtherShouldCollectionId;
            this.xrLabelAcOtherShouldCollectionDate.Text = this.acOtherShouldCollection.AcOtherShouldCollectionDate.Value.ToString("yyyy-MM-dd");
            this.xrLabelAdvancePayableDate.Text          = this.acOtherShouldCollection.AdvancePayableDate.Value.ToString("yyyy-MM-dd");
            if (this.acOtherShouldCollection.Employee0 != null)
            {
                this.xrLabelEmployee0Id.Text = this.acOtherShouldCollection.Employee0.EmployeeName;
            }
            if (this.acOtherShouldCollection.Employee != null)
            {
                this.xrLabelEmployeeId.Text = this.acOtherShouldCollection.Employee.EmployeeName;
            }
            if (this.acOtherShouldCollection.Employee1 != null)
            {
                this.xrLabelEmployee1Id.Text = this.acOtherShouldCollection.Employee1.EmployeeName;
            }
            //if (this.acOtherShouldCollection.AtCurrencyCategory != null)
            //{
            //    this.xrLabelAtCurrencyCategoryId.Text = this.acOtherShouldCollection.AtCurrencyCategory.AtCurrencyName;
            //}
            this.xrLabelAcDesc.Text = this.acOtherShouldCollection.AcDesc;
            //  this.xrLabelExchangeRate.Text = this.acOtherShouldCollection.ExchangeRate.ToString();
            this.lblHeJi.Text = this.acOtherShouldCollection.HeJi.ToString();
            //  this.xrLabelInvoiceId.Text = this.acOtherShouldCollection.InvoiceId;
            this.lblObjectName.Text     = this.acOtherShouldCollection.ObjectName;
            this.lblInvoiceHeJi.Text    = this.acOtherShouldCollection.InvoiceHeji.Value.ToString(global::Helper.DateTimeParse.GetFormat(BL.V.SetDataFormat.XSZJXiao.Value));
            this.lblInvoiceTax.Text     = this.acOtherShouldCollection.InvoiceTax.Value.ToString(global::Helper.DateTimeParse.GetFormat(BL.V.SetDataFormat.XSZJXiao.Value));
            this.lblInvoiceTaxrate.Text = this.acOtherShouldCollection.InvoiceTaxrate.Value.ToString();
            switch (this.acOtherShouldCollection.TaxCaluType)
            {
            case 0:
                this.lblTaxCaluType.Text = "免稅";
                break;

            case 1:
                this.lblTaxCaluType.Text = "外加稅";
                break;

            case 2:
                this.lblTaxCaluType.Text = "內含稅";
                break;
            }

            //明细
            //  this.xrTableCellAcOtherShouldCollectionId.DataBindings.Add("Text", this.DataSource, Model.AcOtherShouldCollectionDetail.PRO_AcOtherShouldCollectionId);
            this.xrTableCellLoanName.DataBindings.Add("Text", this.DataSource, Model.AcOtherShouldCollectionDetail.PRO_LoanName);

            this.xrTableCellSubjectId.DataBindings.Add("Text", this.DataSource, "Subject." + Model.AtAccountSubject.PRO_SubjectName);
            this.xrTableCellDetailDesc.DataBindings.Add("Text", this.DataSource, Model.AcOtherShouldCollectionDetail.PRO_DetailDesc);
            this.xrTableCellAcMoney.DataBindings.Add("Text", this.DataSource, Model.AcOtherShouldCollectionDetail.PRO_AcMoney, global::Helper.DateTimeParse.GetFormatA(BL.V.SetDataFormat.XSZJXiao.Value));
        }
Пример #17
0
 public bool HasRowsAfter(Model.AcOtherShouldCollection e)
 {
     return(sqlmapper.QueryForObject <bool>("AcOtherShouldCollection.has_rows_after", e));
 }
Пример #18
0
 public Model.AcOtherShouldCollection GetPrev(Model.AcOtherShouldCollection e)
 {
     return(sqlmapper.QueryForObject <Model.AcOtherShouldCollection>("AcOtherShouldCollection.get_prev", e));
 }
Пример #19
0
 public Model.AcOtherShouldCollection GetNext(Model.AcOtherShouldCollection e)
 {
     return(accessor.GetNext(e));
 }
Пример #20
0
 public void Update(Model.AcOtherShouldCollection e)
 {
     this.Update <Model.AcOtherShouldCollection>(e);
 }
 public IList <Model.AcOtherShouldCollectionDetail> Select(Model.AcOtherShouldCollection acOtherShouldCollection)
 {
     return(sqlmapper.QueryForList <Model.AcOtherShouldCollectionDetail>("AcOtherShouldCollectionDetail.getByAcOtherShouldCollectionId", acOtherShouldCollection.AcOtherShouldCollectionId));
 }
Пример #22
0
 protected override void MoveFirst()
 {
     this.AcOtherShouldCollection = this.AcOtherShouldCollectionManager.Get(this.AcOtherShouldCollectionManager.GetFirst() == null ? "" : this.AcOtherShouldCollectionManager.GetFirst().AcOtherShouldCollectionId);
 }
 public IList <Model.AcOtherShouldCollectionDetail> Select(Model.AcOtherShouldCollection acOtherShouldCollection)
 {
     return(accessor.Select(acOtherShouldCollection));
 }
Пример #24
0
        public override void Refresh()
        {
            if (this.AcOtherShouldCollection == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action == "view")
                {
                    this.AcOtherShouldCollection = this.AcOtherShouldCollectionManager.GetDetails(AcOtherShouldCollection.AcOtherShouldCollectionId);
                }
            }
            this.textEditFPId.EditValue = this.AcOtherShouldCollection.InvoiceId;
            this.calcFPMoney.EditValue  = this.AcOtherShouldCollection.BillMoney;
            this.textEditAcOtherShouldCollectionId.Text = this.AcOtherShouldCollection.AcOtherShouldCollectionId;
            // this.textEditInvoiceId.Text = this.AcOtherShouldCollection.InvoiceId;
            this.textEditObjectName.Text = this.AcOtherShouldCollection.ObjectName;
            this.memoEditDesc.Text       = this.AcOtherShouldCollection.AcDesc;
            if (global::Helper.DateTimeParse.DateTimeEquls(this.AcOtherShouldCollection.AcOtherShouldCollectionDate, global::Helper.DateTimeParse.NullDate))
            {
                this.dateEditAcOtherShouldCollectionDate.EditValue = null;
            }
            else
            {
                this.dateEditAcOtherShouldCollectionDate.EditValue = this.AcOtherShouldCollection.AcOtherShouldCollectionDate;
            }
            if (global::Helper.DateTimeParse.DateTimeEquls(this.AcOtherShouldCollection.AdvancePayableDate, global::Helper.DateTimeParse.NullDate))
            {
                this.dateEditAdvancePayableDate.EditValue = null;
            }
            else
            {
                this.dateEditAdvancePayableDate.EditValue = this.AcOtherShouldCollection.AdvancePayableDate;
            }
            // this.spinEditExchangeRate.EditValue = this.AcOtherShouldCollection.ExchangeRate;
            this.calcZongEMoney.EditValue = this.AcOtherShouldCollection.HeJi;
            // this.newChooseContorlAtCurrencyCategoryId.EditValue = this.AcOtherShouldCollection.AtCurrencyCategory;
            this.newChooseContorlCustomerId.EditValue  = this.AcOtherShouldCollection.Customer;
            this.newChooseContorlEmployee0Id.EditValue = this.AcOtherShouldCollection.AuditEmp;
            this.newChooseContorlEmployee1Id.EditValue = this.AcOtherShouldCollection.Employee1;
            this.newChooseContorlEmployeeId.EditValue  = this.AcOtherShouldCollection.Employee;
            this.nccCompany.EditValue      = this.AcOtherShouldCollection.Company;
            this.bindingSource1.DataSource = this.AcOtherShouldCollection.Details;

            this.calcTaxRate.EditValue      = this.AcOtherShouldCollection.InvoiceTaxrate;
            this.calcTaxRateMoney.EditValue = this.AcOtherShouldCollection.InvoiceTax;
            this.TaxType.SelectedIndex      = this.AcOtherShouldCollection.TaxCaluType.Value;
            this.calcHeJiMoney.EditValue    = this.AcOtherShouldCollection.InvoiceHeji;

            if (this.AcOtherShouldCollection.Details != null && this.AcOtherShouldCollection.Details.Count > 0)
            {
                foreach (Model.AcOtherShouldCollectionDetail d in this.AcOtherShouldCollection.Details)
                {
                    d.TaxCalualateDictionary = new global::Helper.TaxCalculateHelper((Helper.TaxType)d.AcOtherShouldCollection.TaxCaluType.Value, d.AcOtherShouldCollection.InvoiceTaxrate.Value, d.AcOtherShouldCollection.InvoiceTaxrate.Value, d.AcMoney.Value, 1).TaxCalculateDictionary;
                }
            }
            this.txt_AuditState.EditValue = this.GetAuditName(this.AcOtherShouldCollection.AuditState);
            base.Refresh();
            switch (this.action)
            {
            case "insert":
                this.gridView1.OptionsBehavior.Editable = true;
                break;

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

            case "view":
                this.gridView1.OptionsBehavior.Editable = false;
                break;

            default:
                break;
            }

            this.newChooseContorlEmployeeId.Enabled = false;
            this.calcZongEMoney.Enabled             = false;
            this.calcHeJiMoney.Enabled    = false;
            this.calcTaxRateMoney.Enabled = false;
        }