コード例 #1
0
        public RO_Backup(Model.AtCashAccount model)
            : this()
        {
            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            this.lblReportDate.Text += DateTime.Now.ToString("yyyy-MM-dd");
            //this.lblMonth.Text = model.AtCashAccountMonth.Value.ToString("yyyy-MM-dd");

            if (model.Detail.Count > 0)
            {
                //this.lblStartBalance.Text = model.Detail[0].Subject.TheBalance == null ? "" : model.Detail[0].Subject.TheBalance.Value.ToString("F2");
                this.lblIncome.Text = model.IncomeTotal == null ? "" : model.IncomeTotal.Value.ToString("F2");
            }
            this.lblPay.Text     = model.PayTotal == null ? "" : model.PayTotal.Value.ToString("F2");
            this.lblBalance.Text = model.BalanceTotal == null ? "" : model.BalanceTotal.Value.ToString("F2");

            this.DataSource = model.Detail;

            //this.TCTime.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_AtCashAccountDetaiDate, "{0:yyyy-MM-dd}");
            //this.TCId.DataBindings.Add("Text", this.DataSource, "Subject." + Model.AtAccountSubject.PRO_Id);
            //this.TCName.DataBindings.Add("Text", this.DataSource, "Subject." + Model.AtAccountSubject.PRO_SubjectName);
            this.TCNote.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_Note);
            this.TCIncome.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_Income, "{0:F2}");
            this.TCPay.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_Pay, "{0:F2}");
            //this.TCBalance.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_Balance, "{0:F2}");
        }
コード例 #2
0
ファイル: RO.cs プロジェクト: daobataotie/EDERP
        public RO(Model.AtCashAccount model)
            : this()
        {
            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            this.lblReportDate.Text += DateTime.Now.ToString("yyyy-MM-dd");
            this.lbl_DateRange.Text  = model.HeaderDateRange;
            this.lblLastBalance.Text = model.LastBalance == null ? "" : model.LastBalance.Value.ToString("N0");

            if (model.Detail.Count > 0)
            {
                this.lblTotalIncome.Text = model.Detail.Sum(d => d.Income).HasValue ? model.Detail.Sum(d => d.Income).Value.ToString("N0") : "0";
                this.lblTotalPay.Text    = model.Detail.Sum(d => d.Pay).HasValue ? model.Detail.Sum(d => d.Pay).Value.ToString("N0") : "0";

                this.lblBalance.Text = model.Detail[model.Detail.Count - 1].Balance.HasValue ? model.Detail[model.Detail.Count - 1].Balance.Value.ToString("N0") : "0";
            }

            this.DataSource = model.Detail;

            this.TCDate.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_AtCashAccountDetaiDate, "{0:MM/dd}");
            this.TCAtSubject.DataBindings.Add("Text", this.DataSource, "Subject." + Model.AtAccountSubject.PRO_SubjectName);
            this.TCSummary.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_Summary);
            this.TCIncome.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_Income, "{0:N0}");
            this.TCPay.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_Pay, "{0:N0}");
            this.TCBalance.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_Balance, "{0:N0}");
            this.TCNote.DataBindings.Add("Text", this.DataSource, Model.AtCashAccountDetail.PRO_Note);
        }
コード例 #3
0
        /// <summary>
        /// Insert a AtCashAccount.
        /// </summary>
        public void Insert(Model.AtCashAccount atCashAccount)
        {
            ValiDate(atCashAccount);

            try
            {
                BL.V.BeginTransaction();
                atCashAccount.InsertTime = DateTime.Now;
                atCashAccount.UpdateTime = DateTime.Now;
                accessor.Insert(atCashAccount);

                foreach (var item in atCashAccount.Detail)
                {
                    item.AtCashAccountId = atCashAccount.AtCashAccountId;
                    detailaccessor.Insert(item);
                }

                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
コード例 #4
0
ファイル: EditForm.cs プロジェクト: daobataotie/EDERP
 public EditForm(Model.AtCashAccount model)
     : this()
 {
     this._atCashAccount = model;
     this.action         = "view";
     flag = 1;
 }
コード例 #5
0
ファイル: EditForm.cs プロジェクト: daobataotie/EDERP
        public override void Refresh()
        {
            if (this._atCashAccount == null)
            {
                this.AddNew();
            }
            else
            if (this.action == "view")
            {
                this._atCashAccount = this.manager.GetDetail(this._atCashAccount.AtCashAccountId);
            }

            isRefresh = true;
            this.date_Begin.EditValue = this._atCashAccount.DateBegin;
            isRefresh = true;
            this.date_End.EditValue             = this._atCashAccount.DateEnd;
            this.spe_LastBalance.EditValue      = this._atCashAccount.LastBalance;
            this.spe_BalanceTotal.EditValue     = this._atCashAccount.BalanceTotal;
            this.bindingSourceDetail.DataSource = this._atCashAccount.Detail;
            this.gridControl1.DataSource        = this.bindingSourceDetail.DataSource;
            this.gridControl1.RefreshDataSource();

            base.Refresh();

            this.spe_LastBalance.Properties.ReadOnly  = true;
            this.spe_BalanceTotal.Properties.ReadOnly = true;
        }
コード例 #6
0
 public Model.AtCashAccount GetDetail(string Id)
 {
     Model.AtCashAccount model = this.Get(Id);
     if (model != null)
         model.Detail = new BL.AtCashAccountDetailManager().SelectByHeaderId(Id);
     return model;
 }
コード例 #7
0
ファイル: EditForm.cs プロジェクト: daobataotie/EDERP
        protected override void AddNew()
        {
            this._atCashAccount = new Book.Model.AtCashAccount();
            this._atCashAccount.AtCashAccountId = Guid.NewGuid().ToString();

            if (this._atCashAccount.Detail == null)
            {
                this._atCashAccount.Detail = new List <Model.AtCashAccountDetail>();
            }
            //Model.AtCashAccountDetail detail = new Book.Model.AtCashAccountDetail();
            //detail.AtCashAccountDetailId = Guid.NewGuid().ToString();
            ////detail.AtCashAccountDetaiDate = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM"));
            ////Model.AtAccountSubject subject;
            ////if (subjectList.Any(d => d.Id == "9999000"))
            ////{
            ////    subject = subjectList.First(d => d.Id == "9999000");
            ////    detail.SubjectId = subject.SubjectId;
            ////    if (this.HasRows())
            ////        detail.Balance = this.manager.GetBalance();
            ////    else
            ////        detail.Balance = subject.TheBalance;
            ////}
            //this._atCashAccount.Detail.Add(detail);
            //this._atCashAccount.BalanceTotal = detail.Balance;
            this.action = "insert";
        }
コード例 #8
0
        public bool ISExistsMonth(Model.AtCashAccount model)
        {
            Hashtable ht = new Hashtable();

            ht.Add("Date", model.AtCashAccountMonth);
            ht.Add("Id", model.AtCashAccountId);
            return(sqlmapper.QueryForObject <bool>("AtCashAccount.ISExistsMonth", ht));
        }
コード例 #9
0
ファイル: EditForm.cs プロジェクト: daobataotie/EDERP
 protected override void MovePrev()
 {
     Model.AtCashAccount model = this.manager.GetPrev(this._atCashAccount);
     if (model == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._atCashAccount = model;
 }
コード例 #10
0
ファイル: EditForm.cs プロジェクト: daobataotie/EDERP
 protected override void MoveLast()
 {
     if (this.flag == 1)
     {
         this.flag = 0;
         return;
     }
     this._atCashAccount = this.manager.GetLast();
 }
コード例 #11
0
ファイル: EditForm.cs プロジェクト: daobataotie/EDNew
 public override void Refresh()
 {
     if (this._atCashAccount == null)
     {
         this.AddNew();
     }
     else
     if (this.action == "view")
     {
         this._atCashAccount = this.manager.GetDetail(this._atCashAccount.AtCashAccountId);
     }
     this.data_Month.EditValue           = this._atCashAccount.AtCashAccountMonth;
     this.spe_IncomeTotal.EditValue      = this._atCashAccount.IncomeTotal;
     this.spe_PayTotal.EditValue         = this._atCashAccount.PayTotal;
     this.spe_BalanceTotal.EditValue     = this._atCashAccount.BalanceTotal;
     this.bindingSourceDetail.DataSource = this._atCashAccount.Detail;
     base.Refresh();
     this.spe_IncomeTotal.Properties.ReadOnly  = true;
     this.spe_PayTotal.Properties.ReadOnly     = true;
     this.spe_BalanceTotal.Properties.ReadOnly = true;
 }
コード例 #12
0
ファイル: EditForm.cs プロジェクト: daobataotie/EDERP
 protected override void Delete()
 {
     if (this._atCashAccount == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     Model.AtCashAccount model = this.manager.GetNext(this._atCashAccount);
     this.manager.Delete(this._atCashAccount.AtCashAccountId);
     if (model == null)
     {
         this._atCashAccount = this.manager.GetLast();
     }
     else
     {
         this._atCashAccount = model;
     }
 }
コード例 #13
0
 public void Insert(Model.AtCashAccount e)
 {
     this.Insert <Model.AtCashAccount>(e);
 }
コード例 #14
0
ファイル: EditForm.cs プロジェクト: daobataotie/EDERP
 protected override void MoveFirst()
 {
     this._atCashAccount = this.manager.GetFirst();
 }
コード例 #15
0
 public Model.AtCashAccount GetNext(Model.AtCashAccount e)
 {
     return(accessor.GetNext(e));
 }
コード例 #16
0
 public void Update(Model.AtCashAccount e)
 {
     this.Update <Model.AtCashAccount>(e);
 }
コード例 #17
0
 public bool HasRowsBefore(Model.AtCashAccount e)
 {
     return(sqlmapper.QueryForObject <bool>("AtCashAccount.has_rows_before", e));
 }
コード例 #18
0
 public Model.AtCashAccount GetPrev(Model.AtCashAccount e)
 {
     return(sqlmapper.QueryForObject <Model.AtCashAccount>("AtCashAccount.get_prev", e));
 }
コード例 #19
0
 public Model.AtCashAccount GetNext(Model.AtCashAccount e)
 {
     return(sqlmapper.QueryForObject <Model.AtCashAccount>("AtCashAccount.get_next", e));
 }
コード例 #20
0
 public bool HasRowsAfter(Model.AtCashAccount e)
 {
     return(sqlmapper.QueryForObject <bool>("AtCashAccount.has_rows_after", e));
 }
コード例 #21
0
 public bool ISExistsMonth(Model.AtCashAccount model)
 {
     return(accessor.ISExistsMonth(model));
 }
コード例 #22
0
 public bool HasRowsAfter(Model.AtCashAccount e)
 {
     return(accessor.HasRowsAfter(e));
 }
コード例 #23
0
 public bool HasRowsBefore(Model.AtCashAccount e)
 {
     return(accessor.HasRowsBefore(e));
 }
コード例 #24
0
 public Model.AtCashAccount GetPrev(Model.AtCashAccount e)
 {
     return(accessor.GetPrev(e));
 }