Пример #1
0
        private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            Model.AtSummonDetail         _detail     = this.gridView1.GetRow(e.RowHandle) as Model.AtSummonDetail;
            IList <Model.AtSummonDetail> _detailList = this.bindingSource1.DataSource as IList <Model.AtSummonDetail>;

            if (e.Column == this.colJinE || e.Column == this.colJieorDai)
            {
                this.spinEditTotalDebits.EditValue = _detailList.Where(d => d.Lending == "借").ToList().Sum(d => d.AMoney);
                this.spinEditCreditTotal.EditValue = _detailList.Where(d => d.Lending == "貸").ToList().Sum(d => d.AMoney);
            }
            else if (e.Column == this.colKemuBianHao || e.Column == this.colKeMuMingCheng)
            {
                if (!string.IsNullOrEmpty(_detail.SubjectId))  //&& string.IsNullOrEmpty(_detail.Summary)
                {
                    var subject = new BL.AtAccountSubjectManager().Get(_detail.SubjectId);
                    if (subject != null && !string.IsNullOrEmpty(subject.CommonSummary))
                    {
                        _detail.Summary = subject.CommonSummary;
                    }
                }
            }


            //this.bindingSource1.Position = this.bindingSource1.IndexOf(_detail);
            this.gridControl1.RefreshDataSource();
        }
Пример #2
0
        public XRPeriodTryTo(ConditionPeriodTryTo condition)
        {
            InitializeComponent();
            decimal?bb = 0;
            decimal?cc = 0;

            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelDataName.Text        = "期試算表";
            IList <Model.AtSummonDetail> list = detailManager.Select(condition.StartDate, condition.EndDate, null, null);

            this.xrLabel1.Text = "列表日期:" + DateTime.Now.ToShortDateString();
            this.xrLabel2.Text = "日期區間:" + condition.StartDate.ToShortDateString() + "至" + condition.EndDate.ToShortDateString();

            if (list != null)
            {
                foreach (Model.AtSummonDetail at in list)
                {
                    at.J = new BL.AtSummonDetailManager().CountSummonTo("借", at.SubjectId);
                    at.K = new BL.AtSummonDetailManager().CountSummonTo("貸", at.SubjectId);

                    Model.AtAccountSubject atSub = new BL.AtAccountSubjectManager().Get(at.SubjectId);
                    if (atSub != null)
                    {
                        at.B = atSub.SubjectName;
                        at.A = atSub.Id;
                    }
                    at.E = at.DebitMoney;
                    at.F = at.CreditMoney;
                    at.G = at.E - at.F;
                    bb  += at.E;
                    cc  += at.F;
                    oList.Add(at);
                }
            }
            this.DataSource    = oList;
            this.xrLabel3.Text = bb.ToString();
            this.xrLabel4.Text = cc.ToString();

            this.xrTableCell8.DataBindings.Add("Text", this.DataSource, "A");

            this.xrTableCell9.DataBindings.Add("Text", this.DataSource, "B");
            this.xrTableCell10.DataBindings.Add("Text", this.DataSource, "E", "{0:0}");
            this.xrTableCell11.DataBindings.Add("Text", this.DataSource, "F", "{0:0}");
            this.xrTableCell12.DataBindings.Add("Text", this.DataSource, "G", "{0:0}");
            this.xrTableCell13.DataBindings.Add("Text", this.DataSource, "J");
            this.xrTableCell14.DataBindings.Add("Text", this.DataSource, "K");
        }
Пример #3
0
        public XRTayTo(ConditionTryTo condition)
        {
            InitializeComponent();
            decimal?bb = 0;
            decimal?cc = 0;

            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelDataName.Text        = "Spreadsheet";
            IList <Model.AtSummonDetail> list = detailManager.Select(condition.StartDate, condition.EndDate, null, null);

            this.xrLabel1.Text = "Print date£º" + DateTime.Now.ToShortDateString();
            this.xrLabel2.Text = "Date range£º" + condition.StartDate.ToShortDateString() + "To" + condition.EndDate.ToShortDateString();

            if (list != null)
            {
                foreach (Model.AtSummonDetail at in list)
                {
                    Model.AtAccountSubject atSub = new BL.AtAccountSubjectManager().Get(at.SubjectId);
                    if (atSub != null)
                    {
                        at.B = atSub.SubjectName;
                        at.A = atSub.Id;
                    }
                    at.E = at.DebitMoney;
                    at.F = at.CreditMoney;
                    bb  += at.E;
                    cc  += at.F;
                    oList.Add(at);
                }
            }
            this.DataSource    = oList;
            this.xrLabel3.Text = bb.ToString();
            this.xrLabel4.Text = cc.ToString();

            this.xrTableCell5.DataBindings.Add("Text", this.DataSource, "A");

            this.xrTableCell6.DataBindings.Add("Text", this.DataSource, "B");
            this.xrTableCell7.DataBindings.Add("Text", this.DataSource, "E", "{0:0}");
            this.xrTableCell8.DataBindings.Add("Text", this.DataSource, "F", "{0:0}");
        }