Example #1
0
        /// <summary>
        /// 删除
        /// </summary>
        protected override void Delete()
        {
            if (this.AtBankTransfer == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            {
                return;
            }
            try
            {
                this.AtBankTransferManager.Delete(this.AtBankTransfer.TransferId);
                this.AtBankTransfer = this.AtBankTransferManager.GetNext(this.AtBankTransfer);
                if (this.AtBankTransfer == null)
                {
                    this.AtBankTransfer = this.AtBankTransferManager.GetLast();
                }
            }
            catch
            {
                throw new Exception("");
            }

            return;
        }
        public bool ExistsExcept(Model.AtBankTransfer e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.TransferId) == null?null:Get(e.TransferId).Id);
            return(sqlmapper.QueryForObject <bool>("AtBankTransfer.existsexcept", paras));
        }
Example #3
0
 /// <summary>
 /// Update a AtBankTransfer.
 /// </summary>
 public void Update(Model.AtBankTransfer atBankTransfer)
 {
     //
     // todo: add other logic here.
     //
     Validate(atBankTransfer);
     atBankTransfer.UpdateTime = DateTime.Now;
     accessor.Update(atBankTransfer);
 }
Example #4
0
        protected override void MoveNext()
        {
            Model.AtBankTransfer AtBankTransfer = this.AtBankTransferManager.GetNext(this.AtBankTransfer);
            if (AtBankTransfer == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }

            this.AtBankTransfer = AtBankTransfer;
        }
Example #5
0
 /// <summary>
 /// Insert a AtBankTransfer.
 /// </summary>
 public void Insert(Model.AtBankTransfer atBankTransfer)
 {
     //
     // todo:add other logic here
     //
     Validate(atBankTransfer);
     atBankTransfer.TransferId = Guid.NewGuid().ToString();
     atBankTransfer.InsertTime = DateTime.Now;
     accessor.Insert(atBankTransfer);
 }
Example #6
0
 private void Validate(Model.AtBankTransfer atBankTransfer)
 {
     if (string.IsNullOrEmpty(atBankTransfer.Id))
     {
         throw new Helper.RequireValueException(Model.AtBankTransfer.PRO_Id);
     }
     if (string.IsNullOrEmpty(atBankTransfer.WithBankId))
     {
         throw new Helper.RequireValueException(Model.AtBankTransfer.PRO_WithBankId);
     }
     if (string.IsNullOrEmpty(atBankTransfer.IntoBankId))
     {
         throw new Helper.RequireValueException(Model.AtBankTransfer.PRO_IntoBankId);
     }
 }
Example #7
0
        private void gridView1_Click(object sender, EventArgs e)
        {
            GridView    view    = sender as GridView;
            GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Cursor.Position));

            if (hitInfo.InRow && !view.IsGroupRow(hitInfo.RowHandle))
            {
                Model.AtBankTransfer productEpiboly = this.bindingSource1.Current as Model.AtBankTransfer;
                if (productEpiboly != null)
                {
                    this.AtBankTransfer = productEpiboly;
                    this.action         = "view";
                    this.Refresh();
                }
            }
        }
Example #8
0
 protected override void MoveLast()
 {
     this.AtBankTransfer = this.AtBankTransferManager.GetLast();
 }
Example #9
0
 public Model.AtBankTransfer GetPrev(Model.AtBankTransfer e)
 {
     return(accessor.GetPrev(e));
 }
Example #10
0
 public bool HasRowsBefore(Model.AtBankTransfer e)
 {
     return(accessor.HasRowsBefore(e));
 }
 public bool HasRowsBefore(Model.AtBankTransfer e)
 {
     return(sqlmapper.QueryForObject <bool>("AtBankTransfer.has_rows_before", e));
 }
 public void Update(Model.AtBankTransfer e)
 {
     this.Update <Model.AtBankTransfer>(e);
 }
 public void Insert(Model.AtBankTransfer e)
 {
     this.Insert <Model.AtBankTransfer>(e);
 }
Example #14
0
        public override void Refresh()
        {
            if (this.AtBankTransfer == null)
            {
                this.AtBankTransfer = new Book.Model.AtBankTransfer();
                this.action         = "insert";
            }
            this.bindingSource1.DataSource = this.AtBankTransferManager.Select();
            if (global::Helper.DateTimeParse.DateTimeEquls(this.AtBankTransfer.TransferDate, global::Helper.DateTimeParse.NullDate))
            {
                this.dateEditTransferDate.EditValue = null;
            }
            else
            {
                this.dateEditTransferDate.EditValue = this.AtBankTransfer.TransferDate;
            }
            this.newChooseContorlWithBankId.EditValue = this.AtBankTransfer.WithBank;
            this.newChooseContorlIntoBankId.EditValue = this.AtBankTransfer.IntoBank;
            this.textEditTransferId.Text = this.AtBankTransfer.Id;

            this.spinEditWithMoney.EditValue = this.AtBankTransfer.WithMoney;
            switch (this.action)
            {
            case "insert":
                this.dateEditTransferDate.Properties.ReadOnly           = false;
                this.dateEditTransferDate.Properties.Buttons[0].Visible = true;
                this.newChooseContorlWithBankId.ShowButton     = true;
                this.newChooseContorlWithBankId.ButtonReadOnly = false;
                this.newChooseContorlIntoBankId.ShowButton     = true;
                this.newChooseContorlIntoBankId.ButtonReadOnly = false;

                this.textEditTransferId.Properties.ReadOnly = false;
                this.spinEditWithMoney.Properties.ReadOnly  = false;
                break;

            case "update":
                this.dateEditTransferDate.Properties.ReadOnly           = false;
                this.dateEditTransferDate.Properties.Buttons[0].Visible = true;
                this.newChooseContorlWithBankId.ShowButton     = true;
                this.newChooseContorlWithBankId.ButtonReadOnly = false;
                this.newChooseContorlIntoBankId.ShowButton     = true;
                this.newChooseContorlIntoBankId.ButtonReadOnly = false;

                this.textEditTransferId.Properties.ReadOnly = false;
                this.spinEditWithMoney.Properties.ReadOnly  = false;
                break;

            case "view":
                this.dateEditTransferDate.Properties.ReadOnly           = true;
                this.dateEditTransferDate.Properties.Buttons[0].Visible = false;
                this.newChooseContorlWithBankId.ShowButton     = false;
                this.newChooseContorlWithBankId.ButtonReadOnly = true;
                this.newChooseContorlIntoBankId.ShowButton     = false;
                this.newChooseContorlIntoBankId.ButtonReadOnly = true;

                this.textEditTransferId.Properties.ReadOnly = true;
                this.spinEditWithMoney.Properties.ReadOnly  = true;
                break;

            default:
                break;
            }
            base.Refresh();
        }
Example #15
0
 protected override void AddNew()
 {
     this.AtBankTransfer = new Model.AtBankTransfer();
 }
Example #16
0
 protected override void AddNew()
 {
     this.AtBankTransfer = new Model.AtBankTransfer();
     this.AtBankTransfer.TransferDate = DateTime.Now;
     this.action = "insert";
 }
Example #17
0
 public bool ExistsExcept(Model.AtBankTransfer e)
 {
     return(accessor.ExistsExcept(e));
 }
 public bool HasRowsAfter(Model.AtBankTransfer e)
 {
     return(sqlmapper.QueryForObject <bool>("AtBankTransfer.has_rows_after", e));
 }
Example #19
0
 public bool HasRowsAfter(Model.AtBankTransfer e)
 {
     return(accessor.HasRowsAfter(e));
 }
 public Model.AtBankTransfer GetNext(Model.AtBankTransfer e)
 {
     return(sqlmapper.QueryForObject <Model.AtBankTransfer>("AtBankTransfer.get_next", e));
 }
Example #21
0
 public Model.AtBankTransfer GetNext(Model.AtBankTransfer e)
 {
     return(accessor.GetNext(e));
 }
 public Model.AtBankTransfer GetPrev(Model.AtBankTransfer e)
 {
     return(sqlmapper.QueryForObject <Model.AtBankTransfer>("AtBankTransfer.get_prev", e));
 }