Exemplo n.º 1
0
        public override void Refresh()
        {
            this._detail = AtAccountingCategoriesManager.Select();
            this.bindingSource1.DataSource = this._detail;
            if (this.action == "insert")
            {
                Model.AtAccountingCategories pc = new Model.AtAccountingCategories();
                this._detail.Add(pc);
                this.bindingSource1.DataSource = this._detail;
                this.bindingSource1.Position   = this.bindingSource1.IndexOf(pc);
                this.gridControl1.RefreshDataSource();
            }

            switch (this.action)
            {
            case "insert":
                this.gridView1.OptionsBehavior.Editable = true;
                break;

            case "update":
                this.gridView1.OptionsBehavior.Editable = true;
                break;

            case "view":
                this.gridView1.OptionsBehavior.Editable = false;
                break;

            default:
                break;
            }
            base.Refresh();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Insert a AtAccountingCategories.
 /// </summary>
 public void Insert(Model.AtAccountingCategories atAccountingCategories)
 {
     //
     // todo:add other logic here
     //
     atAccountingCategories.AccountingCategoriesId = Guid.NewGuid().ToString();
     accessor.Insert(atAccountingCategories);
 }
Exemplo n.º 3
0
        public bool ExistsExcept(Model.AtAccountingCategories e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.AccountingCategoriesId) == null?null:Get(e.AccountingCategoriesId).Id);
            return(sqlmapper.QueryForObject <bool>("AtAccountingCategories.existsexcept", paras));
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        public void MyClick(ref ChooseItem item)
        {
            ChooseAccountCategoriesForm f = new ChooseAccountCategoriesForm();

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Model.AtAccountingCategories AtAccountingCategories = f.SelectedItem as Model.AtAccountingCategories;
                item = new ChooseItem(AtAccountingCategories, AtAccountingCategories.Id, AtAccountingCategories.AccountingCategoriesName);
            }
        }
Exemplo n.º 5
0
 public void MyLeave(ref ChooseItem item)
 {
     BL.AtAccountingCategoriesManager manager = new Book.BL.AtAccountingCategoriesManager();
     Model.AtAccountingCategories     AtAccountingCategories = manager.GetById(item.ButtonText);
     if (AtAccountingCategories != null)
     {
         item.EditValue  = AtAccountingCategories;
         item.LabelText  = AtAccountingCategories.AccountingCategoriesName;
         item.ButtonText = AtAccountingCategories.Id;
     }
     else
     {
         item.ErrorMessage = "物料類型錯誤";
     }
 }
Exemplo n.º 6
0
 private void gridView1_KeyDown(object sender, KeyEventArgs e)
 {
     if (this.action == "insert" || this.action == "update")
     {
         if (e.KeyData == Keys.Enter)
         {
             Model.AtAccountingCategories pc = new Model.AtAccountingCategories();
             this._detail.Add(pc);
             this.bindingSource1.Position = this.bindingSource1.IndexOf(pc);
         }
         if (e.KeyData == Keys.Delete)
         {
             this._detail.Remove(this.bindingSource1.Current as Model.AtAccountingCategories);
         }
         this.gridControl1.RefreshDataSource();
     }
 }
Exemplo n.º 7
0
 public void Delete(Model.AtAccountingCategories atAccountingCategories)
 {
     this.Delete(atAccountingCategories.AccountingCategoriesId);
 }
Exemplo n.º 8
0
 public Model.AtAccountingCategories GetPrev(Model.AtAccountingCategories e)
 {
     return(sqlmapper.QueryForObject <Model.AtAccountingCategories>("AtAccountingCategories.get_prev", e));
 }
Exemplo n.º 9
0
 public bool HasRowsAfter(Model.AtAccountingCategories e)
 {
     return(sqlmapper.QueryForObject <bool>("AtAccountingCategories.has_rows_after", e));
 }
Exemplo n.º 10
0
 public bool HasRowsBefore(Model.AtAccountingCategories e)
 {
     return(sqlmapper.QueryForObject <bool>("AtAccountingCategories.has_rows_before", e));
 }
Exemplo n.º 11
0
 public void Update(Model.AtAccountingCategories e)
 {
     this.Update <Model.AtAccountingCategories>(e);
 }
Exemplo n.º 12
0
 public void Insert(Model.AtAccountingCategories e)
 {
     this.Insert <Model.AtAccountingCategories>(e);
 }
 public Model.AtAccountingCategories GetNext(Model.AtAccountingCategories e)
 {
     return(accessor.GetNext(e));
 }
 public bool HasRowsAfter(Model.AtAccountingCategories e)
 {
     return(accessor.HasRowsAfter(e));
 }
 public bool HasRowsBefore(Model.AtAccountingCategories e)
 {
     return(accessor.HasRowsBefore(e));
 }
 public bool ExistsExcept(Model.AtAccountingCategories e)
 {
     return(accessor.ExistsExcept(e));
 }