Пример #1
0
        /// <summary>
        /// 删除
        /// </summary>
        protected override void Delete()
        {
            if (this.AtAccountingCategory == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            try
            {
                this.AtAccountingCategoryManager.Delete(this.AtAccountingCategory.AccountingCategoryId);
                this.AtAccountingCategory = this.AtAccountingCategoryManager.GetNext(this.AtAccountingCategory);
                if (this.AtAccountingCategory == null)
                {
                    this.AtAccountingCategory = this.AtAccountingCategoryManager.GetLast();
                }
            }
            catch
            {
                throw new Exception("");
            }

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

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.AccountingCategoryId) == null?null:Get(e.AccountingCategoryId).Id);
            return(sqlmapper.QueryForObject <bool>("AtAccountingCategory.existsexcept", paras));
        }
Пример #3
0
 /// <summary>
 /// Update a AtAccountingCategory.
 /// </summary>
 public void Update(Model.AtAccountingCategory atAccountingCategory)
 {
     //
     // todo: add other logic here.
     //
     Validate(atAccountingCategory);
     atAccountingCategory.UpdateTime = DateTime.Now;
     accessor.Update(atAccountingCategory);
 }
Пример #4
0
 /// <summary>
 /// Insert a AtAccountingCategory.
 /// </summary>
 public void Insert(Model.AtAccountingCategory atAccountingCategory)
 {
     //
     // todo:add other logic here
     //
     Validate(atAccountingCategory);
     atAccountingCategory.InsertTime           = DateTime.Now;
     atAccountingCategory.AccountingCategoryId = Guid.NewGuid().ToString();
     accessor.Insert(atAccountingCategory);
 }
Пример #5
0
        protected override void MoveNext()
        {
            Model.AtAccountingCategory AtAccountingCategory = this.AtAccountingCategoryManager.GetNext(this.AtAccountingCategory);
            if (AtAccountingCategory == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }

            this.AtAccountingCategory = AtAccountingCategory;
        }
Пример #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        public void MyClick(ref ChooseItem item)
        {
            ChooseAccountingCategoryForm f = new ChooseAccountingCategoryForm();

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Model.AtAccountingCategory AtAccountingCategory = f.SelectedItem as Model.AtAccountingCategory;
                item = new ChooseItem(AtAccountingCategory, AtAccountingCategory.Id, AtAccountingCategory.AccountingCategoryName);
            }
        }
Пример #7
0
 public void MyLeave(ref ChooseItem item)
 {
     BL.AtAccountingCategoryManager manager = new Book.BL.AtAccountingCategoryManager();
     Model.AtAccountingCategory     AtAccountingCategory = manager.GetById(item.ButtonText);
     if (AtAccountingCategory != null)
     {
         item.EditValue  = AtAccountingCategory;
         item.LabelText  = AtAccountingCategory.AccountingCategoryName;
         item.ButtonText = AtAccountingCategory.Id;
     }
     else
     {
         item.ErrorMessage = "物料類型錯誤";
     }
 }
Пример #8
0
 private void Validate(Model.AtAccountingCategory atAccountingCategory)
 {
     if (string.IsNullOrEmpty(atAccountingCategory.Id))
     {
         throw new Helper.RequireValueException(Model.AtAccountingCategory.PRO_Id);
     }
     if (string.IsNullOrEmpty(atAccountingCategory.AccountingCategoriesId))
     {
         throw new Helper.RequireValueException(Model.AtAccountingCategory.PRO_AccountingCategoriesId);
     }
     if (string.IsNullOrEmpty(atAccountingCategory.AccountingCategoryName))
     {
         throw new Helper.RequireValueException(Model.AtAccountingCategory.PRO_AccountingCategoryName);
     }
 }
Пример #9
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.AtAccountingCategory productEpiboly = this.bindingSource1.Current as Model.AtAccountingCategory;
                if (productEpiboly != null)
                {
                    this.AtAccountingCategory = productEpiboly;
                    this.action = "view";
                    this.Refresh();
                }
            }
        }
Пример #10
0
        public override void Refresh()
        {
            if (this.AtAccountingCategory == null)
            {
                this.AtAccountingCategory = new Book.Model.AtAccountingCategory();
                this.action = "insert";
            }
            this.bindingSource1.DataSource = this.AtAccountingCategoryManager.Select();
            this.newChooseContorlAccountingCategoriesId.EditValue = this.AtAccountingCategory.AccountingCategories;
            this.textEditAccountingCategoryId.Text   = this.AtAccountingCategory.Id;
            this.textEditAccountingCategoryName.Text = this.AtAccountingCategory.AccountingCategoryName;
            this.textEditEnglishName.Text            = this.AtAccountingCategory.EnglishName;
            switch (this.action)
            {
            case "insert":
                this.newChooseContorlAccountingCategoriesId.ShowButton     = true;
                this.newChooseContorlAccountingCategoriesId.ButtonReadOnly = false;
                this.textEditAccountingCategoryId.Properties.ReadOnly      = false;
                this.textEditAccountingCategoryName.Properties.ReadOnly    = false;
                this.textEditEnglishName.Properties.ReadOnly = false;
                break;

            case "update":
                this.newChooseContorlAccountingCategoriesId.ShowButton     = true;
                this.newChooseContorlAccountingCategoriesId.ButtonReadOnly = false;
                this.textEditAccountingCategoryId.Properties.ReadOnly      = false;
                this.textEditAccountingCategoryName.Properties.ReadOnly    = false;
                this.textEditEnglishName.Properties.ReadOnly = false;
                break;

            case "view":
                this.newChooseContorlAccountingCategoriesId.ShowButton     = false;
                this.newChooseContorlAccountingCategoriesId.ButtonReadOnly = true;
                this.textEditAccountingCategoryId.Properties.ReadOnly      = true;
                this.textEditAccountingCategoryName.Properties.ReadOnly    = true;
                this.textEditEnglishName.Properties.ReadOnly = true;
                break;

            default:
                break;
            }
            base.Refresh();
        }
 public bool HasRowsBefore(Model.AtAccountingCategory e)
 {
     return(sqlmapper.QueryForObject <bool>("AtAccountingCategory.has_rows_before", e));
 }
Пример #12
0
 protected override void MoveLast()
 {
     this.AtAccountingCategory = this.AtAccountingCategoryManager.GetLast();
 }
Пример #13
0
 public bool HasRowsAfter(Model.AtAccountingCategory e)
 {
     return(accessor.HasRowsAfter(e));
 }
 public void Insert(Model.AtAccountingCategory e)
 {
     this.Insert <Model.AtAccountingCategory>(e);
 }
Пример #15
0
 public Model.AtAccountingCategory GetNext(Model.AtAccountingCategory e)
 {
     return(accessor.GetNext(e));
 }
 public void Update(Model.AtAccountingCategory e)
 {
     this.Update <Model.AtAccountingCategory>(e);
 }
 public Model.AtAccountingCategory GetPrev(Model.AtAccountingCategory e)
 {
     return(sqlmapper.QueryForObject <Model.AtAccountingCategory>("AtAccountingCategory.get_prev", e));
 }
 public Model.AtAccountingCategory GetNext(Model.AtAccountingCategory e)
 {
     return(sqlmapper.QueryForObject <Model.AtAccountingCategory>("AtAccountingCategory.get_next", e));
 }
Пример #19
0
 public bool HasRowsBefore(Model.AtAccountingCategory e)
 {
     return(accessor.HasRowsBefore(e));
 }
Пример #20
0
 protected override void AddNew()
 {
     this.AtAccountingCategory = new Model.AtAccountingCategory();
 }
 public bool HasRowsAfter(Model.AtAccountingCategory e)
 {
     return(sqlmapper.QueryForObject <bool>("AtAccountingCategory.has_rows_after", e));
 }
Пример #22
0
 public bool ExistsExcept(Model.AtAccountingCategory e)
 {
     return(accessor.ExistsExcept(e));
 }