Ejemplo n.º 1
0
 protected override void MoveLast()
 {
     // if (_acbeginAccountPayble == null)
     {
         this._acbeginAccountPayble = this.acbeginAccountPaybleManager.Get(this.acbeginAccountPaybleManager.GetLast() == null ? "" : this.acbeginAccountPaybleManager.GetLast().AcbeginAccountPayableId);
     }
 }
Ejemplo n.º 2
0
        public Ro(Model.AcbeginAccountPayable payable)
        {
            InitializeComponent();

            this.xrLabelName.Text   = BL.Settings.CompanyChineseName;
            this.xrLabelTitle.Text  = Properties.Resources.AcbeginAccountPayable;
            this.xrLabelPrint.Text += System.DateTime.Now.ToShortDateString();
            #region header
            this.AcbeginAccountPayableId.Text   = payable.AcbeginAccountPayableId;
            this.AcbeginAccountPayableDate.Text = payable.AcbeginAccountPayableDate.Value.ToString("yyyy-MM-dd");
            this.Employee1.Text = payable.Employee == null ? "" : payable.Employee.EmployeeName;
            this.Employee0.Text = payable.Employee0 == null ? "" : payable.Employee0.EmployeeName;
            //  this.AtCurrencyCategoryId.Text = payable.AtCurrencyCategory == null ? "" : payable.AtCurrencyCategory.ToString();
            #endregion

            #region Details
            this.DataSource = payable.Details;

            this.xrTableCell1SupplierId.DataBindings.Add("Text", this.DataSource, "Supplier." + Model.Supplier.PROPERTY_SUPPLIERSHORTNAME);
            //  this.xrTableCell1AdvancePayment.DataBindings.Add("Text", this.DataSource, Model.AcbeginAccountPayableDetail.PRO_AdvancePayment,"{0:0.####}");
            this.xrTableCell1DomesticAdvancePayment.DataBindings.Add("Text", this.DataSource, Model.AcbeginAccountPayableDetail.PRO_DomesticAdvancePayment, "{0:0.####}");
            //  this.xrTableCell1ShouldPayment.DataBindings.Add("Text", this.DataSource, Model.AcbeginAccountPayableDetail.PRO_ShouldPayment, "{0:0.####}");
            // this.xrTableCell1DomesticAccountPayable.DataBindings.Add("Text", this.DataSource, Model.AcbeginAccountPayableDetail.PRO_DomesticAccountPayable, "{0:0.####}");
            // this.xrTableCell1AlreadyPayment.DataBindings.Add("Text", this.DataSource, Model.AcbeginAccountPayableDetail.PRO_AlreadyPayment, "{0:0.####}");
            //  this.xrTableCell1DomesticAlreadyPayment.DataBindings.Add("Text", this.DataSource, Model.AcbeginAccountPayableDetail.PRO_DomesticAlreadyPayment, "{0:0.####}");
            //  this.xrTableCellBeginningBalance.DataBindings.Add("Text", this.DataSource, Model.AcbeginAccountPayableDetail.PRO_BeginningBalance, "{0:0.####}");
            this.xrTableCellDomesticBeginningBalance.DataBindings.Add("Text", this.DataSource, Model.AcbeginAccountPayableDetail.PRO_DomesticBeginningBalance, "{0:0.####}");

            #endregion
        }
        /// <summary>
        /// Update a AcbeginAccountPayable.
        /// </summary>
        public void Update(Model.AcbeginAccountPayable acbeginAccountPayable)
        {
            if (acbeginAccountPayable != null)
            {
                try
                {
                    BL.V.BeginTransaction();
                    //更新详细
                    detailsaccessor.DeleteByAcbeginAccountPayableId(acbeginAccountPayable.AcbeginAccountPayableId);
                    foreach (Model.AcbeginAccountPayableDetail detail in acbeginAccountPayable.Details)
                    {
                        detailsaccessor.Insert(detail);
                    }
                    acbeginAccountPayable.UpdateTime = DateTime.Now;
                    accessor.Update(acbeginAccountPayable);

                    BL.V.CommitTransaction();
                }
                catch
                {
                    BL.V.RollbackTransaction();
                    throw;
                }
            }
        }
Ejemplo n.º 4
0
        public override void Refresh()
        {
            if (this._acbeginAccountPayble == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action != "insert")
                {
                    this._acbeginAccountPayble = this.acbeginAccountPaybleManager.GetDetails(_acbeginAccountPayble);
                    if (this._acbeginAccountPayble == null)
                    {
                        this._acbeginAccountPayble = new Book.Model.AcbeginAccountPayable();
                    }
                }
            }

            this.textEditAcbeginAccountPayableId.Text       = this._acbeginAccountPayble.AcbeginAccountPayableId;
            this.dateEditAcbeginAccountPayableDate.DateTime = this._acbeginAccountPayble.AcbeginAccountPayableDate.Value;
            this.memoEditAcbeginAccountPayableDesc.Text     = this._acbeginAccountPayble.AcbeginAccountPayableDesc;
            // this.newChooseAtCurrencyCategory.EditValue = this._acbeginAccountPayble.AtCurrencyCategory;
            this.newChooseEmp.EditValue          = this._acbeginAccountPayble.Employee;
            this.newChooseEmp0.EditValue         = this._acbeginAccountPayble.AuditEmp;
            this.textEditAuditingState.EditValue = this.GetAuditName(this._acbeginAccountPayble.AuditState);
            this.bindingSourceAcbeginAccountPayableDetail.DataSource = this._acbeginAccountPayble.Details;


            //this.gridView1.GroupPanelText = "共: " + this.acbeginAccountPayble.Details.Count + " 項";
            base.Refresh();
        }
        /// <summary>
        /// Insert a AcbeginAccountPayable.
        /// </summary>
        public void Insert(Model.AcbeginAccountPayable acbeginAccountPayable)
        {

            try
            {
                BL.V.BeginTransaction();
                acbeginAccountPayable.InsertTime = DateTime.Now;
                acbeginAccountPayable.UpdateTime = DateTime.Now;
                string invoiceKind = this.GetInvoiceKind().ToLower();
                string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, acbeginAccountPayable.InsertTime.Value.Year);
                string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, acbeginAccountPayable.InsertTime.Value.Year, acbeginAccountPayable.InsertTime.Value.Month);
                string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, acbeginAccountPayable.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(acbeginAccountPayable);

                foreach (Model.AcbeginAccountPayableDetail detail in acbeginAccountPayable.Details)
                {
                    detail.AcbeginAccountPayableDetailId = Guid.NewGuid().ToString();
                    detail.AcbeginAccountPayableId = acbeginAccountPayable.AcbeginAccountPayableId;
                    detailsaccessor.Insert(detail);
                }
                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
Ejemplo n.º 6
0
 protected override void MoveNext()
 {
     Model.AcbeginAccountPayable temp = this.acbeginAccountPaybleManager.GetNext(this._acbeginAccountPayble);
     if (temp == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._acbeginAccountPayble = this.acbeginAccountPaybleManager.Get(temp.AcbeginAccountPayableId);
 }
 public Model.AcbeginAccountPayable GetDetails(Model.AcbeginAccountPayable acbeginAccountPayable)
 {
     Model.AcbeginAccountPayable acbeginAccount = accessor.Get(acbeginAccountPayable.AcbeginAccountPayableId);
     if (acbeginAccount != null)
     {
         acbeginAccount.Details = detailsaccessor.Select(acbeginAccount);
     }
     return acbeginAccount;
 }
Ejemplo n.º 8
0
 protected override void AddNew()
 {
     _acbeginAccountPayble = new Model.AcbeginAccountPayable();
     _acbeginAccountPayble.AcbeginAccountPayableId        = this.acbeginAccountPaybleManager.GetId();
     this._acbeginAccountPayble.AcbeginAccountPayableDate = DateTime.Now;
     _acbeginAccountPayble.Employee = BL.V.ActiveOperator.Employee;
     //_acbeginAccountPayble.Details = new List<Model.AcbeginAccountPayableDetail>();
     _acbeginAccountPayble.Details = this.acbeginAccountPayableDetailManager.SelectDefaultDetails();
 }
Ejemplo n.º 9
0
        //private void simpleButton_Add_Click(object sender, EventArgs e)
        //{
        //    Model.AcbeginAccountPayableDetail temp = new Model.AcbeginAccountPayableDetail();
        //    temp.AcbeginAccountPayableDetailId = Guid.NewGuid().ToString();
        //    this._acbeginAccountPayble.Details.Add(temp);
        //    this.gridControl1.RefreshDataSource();
        //}

        //private void simpleButton_Remove_Click(object sender, EventArgs e)
        //{
        //    Model.AcbeginAccountPayableDetail temp = this.bindingSourceAcbeginAccountPayableDetail.Current as Model.AcbeginAccountPayableDetail;
        //    if (temp == null) return;
        //    this._acbeginAccountPayble.Details.Remove(temp);
        //    this.gridControl1.RefreshDataSource();
        //}

        private void barButtonItem_Search_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm list = new ListForm();

            if (list.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            this._acbeginAccountPayble = this.acbeginAccountPaybleManager.GetDetails(list.SelectItem as Model.AcbeginAccountPayable);
            this.action = "view";
            this.Refresh();
        }
        public void Delete(Model.AcbeginAccountPayable acbeginAccountPayable)
        {
            try
            {
                BL.V.BeginTransaction();

                detailsaccessor.DeleteByAcbeginAccountPayableId(acbeginAccountPayable.AcbeginAccountPayableId);

                this.Delete(acbeginAccountPayable.AcbeginAccountPayableId);

                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }

        }
Ejemplo n.º 11
0
 protected override void Delete()
 {
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
     {
         return;
     }
     try
     {
         this.acbeginAccountPaybleManager.Delete(this._acbeginAccountPayble);
         this._acbeginAccountPayble = this.acbeginAccountPaybleManager.GetNext(this._acbeginAccountPayble);
         if (this._acbeginAccountPayble == null)
         {
             this._acbeginAccountPayble = this.acbeginAccountPaybleManager.GetLast();
         }
     }
     catch
     {
         throw;
     }
 }
 public bool HasRowsAfter(Model.AcbeginAccountPayable e)
 {
     return(sqlmapper.QueryForObject <bool>("AcbeginAccountPayable.has_rows_after", e));
 }
 public bool HasRowsBefore(Model.AcbeginAccountPayable e)
 {
     return(sqlmapper.QueryForObject <bool>("AcbeginAccountPayable.has_rows_before", e));
 }
 public void Update(Model.AcbeginAccountPayable e)
 {
     this.Update <Model.AcbeginAccountPayable>(e);
 }
 public void Insert(Model.AcbeginAccountPayable e)
 {
     this.Insert <Model.AcbeginAccountPayable>(e);
 }
 public Model.AcbeginAccountPayable GetNext(Model.AcbeginAccountPayable e)
 {
     return(accessor.GetNext(e));
 }
 public bool HasRowsAfter(Model.AcbeginAccountPayable e)
 {
     return(accessor.HasRowsAfter(e));
 }
 public IList <Model.AcbeginAccountPayableDetail> Select(Model.AcbeginAccountPayable acbeginAccountPayable)
 {
     return(sqlmapper.QueryForList <Model.AcbeginAccountPayableDetail>("AcbeginAccountPayableDetail.selectByacbeginaccountPaybleId", acbeginAccountPayable.AcbeginAccountPayableId));
 }
Ejemplo n.º 19
0
 public IList <Model.AcbeginAccountPayableDetail> Select(Model.AcbeginAccountPayable acbeginAccountPayable)
 {
     return(accessor.Select(acbeginAccountPayable));
 }
Ejemplo n.º 20
0
 protected override void MoveFirst()
 {
     this._acbeginAccountPayble = this.acbeginAccountPaybleManager.Get(this.acbeginAccountPaybleManager.GetFirst() == null ? "" : this.acbeginAccountPaybleManager.GetFirst().AcbeginAccountPayableId);
 }
Ejemplo n.º 21
0
 public EditForm(Model.AcbeginAccountPayable acbeginAccountPayable, string action)
     : this()
 {
     this._acbeginAccountPayble = acbeginAccountPayable;
     this.action = action;
 }
Ejemplo n.º 22
0
 public EditForm(Model.AcbeginAccountPayable acbeginAccountPayable)
     : this()
 {
     this._acbeginAccountPayble = acbeginAccountPayable;
     this.action = "update";
 }
 public Model.AcbeginAccountPayable GetNext(Model.AcbeginAccountPayable e)
 {
     return(sqlmapper.QueryForObject <Model.AcbeginAccountPayable>("AcbeginAccountPayable.get_next", e));
 }
 public Model.AcbeginAccountPayable GetPrev(Model.AcbeginAccountPayable e)
 {
     return(sqlmapper.QueryForObject <Model.AcbeginAccountPayable>("AcbeginAccountPayable.get_prev", e));
 }
 public bool HasRowsBefore(Model.AcbeginAccountPayable e)
 {
     return(accessor.HasRowsBefore(e));
 }