Esempio n. 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));
        }
Esempio n. 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);
 }
Esempio n. 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;
        }
Esempio n. 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);
 }
Esempio n. 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);
     }
 }
Esempio n. 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();
                }
            }
        }
Esempio n. 8
0
 protected override void MoveLast()
 {
     this.AtBankTransfer = this.AtBankTransferManager.GetLast();
 }
Esempio n. 9
0
 public Model.AtBankTransfer GetPrev(Model.AtBankTransfer e)
 {
     return(accessor.GetPrev(e));
 }
Esempio n. 10
0
 public bool HasRowsBefore(Model.AtBankTransfer e)
 {
     return(accessor.HasRowsBefore(e));
 }
Esempio n. 11
0
 public bool HasRowsBefore(Model.AtBankTransfer e)
 {
     return(sqlmapper.QueryForObject <bool>("AtBankTransfer.has_rows_before", e));
 }
Esempio n. 12
0
 public void Update(Model.AtBankTransfer e)
 {
     this.Update <Model.AtBankTransfer>(e);
 }
Esempio n. 13
0
 public void Insert(Model.AtBankTransfer e)
 {
     this.Insert <Model.AtBankTransfer>(e);
 }
Esempio n. 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();
        }
Esempio n. 15
0
 protected override void AddNew()
 {
     this.AtBankTransfer = new Model.AtBankTransfer();
 }
Esempio n. 16
0
 protected override void AddNew()
 {
     this.AtBankTransfer = new Model.AtBankTransfer();
     this.AtBankTransfer.TransferDate = DateTime.Now;
     this.action = "insert";
 }
Esempio n. 17
0
 public bool ExistsExcept(Model.AtBankTransfer e)
 {
     return(accessor.ExistsExcept(e));
 }
Esempio n. 18
0
 public bool HasRowsAfter(Model.AtBankTransfer e)
 {
     return(sqlmapper.QueryForObject <bool>("AtBankTransfer.has_rows_after", e));
 }
Esempio n. 19
0
 public bool HasRowsAfter(Model.AtBankTransfer e)
 {
     return(accessor.HasRowsAfter(e));
 }
Esempio n. 20
0
 public Model.AtBankTransfer GetNext(Model.AtBankTransfer e)
 {
     return(sqlmapper.QueryForObject <Model.AtBankTransfer>("AtBankTransfer.get_next", e));
 }
Esempio n. 21
0
 public Model.AtBankTransfer GetNext(Model.AtBankTransfer e)
 {
     return(accessor.GetNext(e));
 }
Esempio n. 22
0
 public Model.AtBankTransfer GetPrev(Model.AtBankTransfer e)
 {
     return(sqlmapper.QueryForObject <Model.AtBankTransfer>("AtBankTransfer.get_prev", e));
 }