コード例 #1
0
 /// <summary>
 /// Update a AtCurrencyCategory.
 /// </summary>
 public void Update(Model.AtCurrencyCategory atCurrencyCategory)
 {
     //
     // todo: add other logic here.
     //
     Validate(atCurrencyCategory);
     accessor.Update(atCurrencyCategory);
 }
コード例 #2
0
        public bool ExistsExcept(Model.AtCurrencyCategory e)
        {
            Hashtable paras = new Hashtable();

            paras.Add("newId", e.Id);
            paras.Add("oldId", Get(e.AtCurrencyCategoryId) == null?null:Get(e.AtCurrencyCategoryId).Id);
            return(sqlmapper.QueryForObject <bool>("AtCurrencyCategory.existsexcept", paras));
        }
コード例 #3
0
 /// <summary>
 /// Insert a AtCurrencyCategory.
 /// </summary>
 public void Insert(Model.AtCurrencyCategory atCurrencyCategory)
 {
     //
     // todo:add other logic here
     //
     Validate(atCurrencyCategory);
     atCurrencyCategory.AtCurrencyCategoryId = Guid.NewGuid().ToString();
     accessor.Insert(atCurrencyCategory);
 }
コード例 #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="item"></param>
        public void MyClick(ref ChooseItem item)
        {
            ChooseAtCurrencyCategoryForm f = new ChooseAtCurrencyCategoryForm();

            if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Model.AtCurrencyCategory AtCurrencyCategory = f.SelectedItem as Model.AtCurrencyCategory;
                item = new ChooseItem(AtCurrencyCategory, AtCurrencyCategory.Id, AtCurrencyCategory.AtCurrencyName);
            }
        }
コード例 #5
0
 private void Validate(Model.AtCurrencyCategory atCurrencyCategory)
 {
     if (string.IsNullOrEmpty(atCurrencyCategory.Id))
     {
         throw new Helper.RequireValueException(Model.AtCurrencyCategory.PRO_Id);
     }
     if (string.IsNullOrEmpty(atCurrencyCategory.AtCurrencyName))
     {
         throw new Helper.RequireValueException(Model.AtCurrencyCategory.PRO_AtCurrencyName);
     }
 }
コード例 #6
0
 public void MyLeave(ref ChooseItem item)
 {
     BL.AtCurrencyCategoryManager manager            = new Book.BL.AtCurrencyCategoryManager();
     Model.AtCurrencyCategory     AtCurrencyCategory = manager.GetById(item.ButtonText);
     if (AtCurrencyCategory != null)
     {
         item.EditValue  = AtCurrencyCategory;
         item.LabelText  = AtCurrencyCategory.AtCurrencyName;
         item.ButtonText = AtCurrencyCategory.Id;
     }
     else
     {
         item.ErrorMessage = "物料類型錯誤";
     }
 }
コード例 #7
0
ファイル: CategoryEditForm.cs プロジェクト: daobataotie/EDERP
        private void gridView1_Click_1(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.AtCurrencyCategory productEpiboly = this.bindingSource1.Current as Model.AtCurrencyCategory;
                if (productEpiboly != null)
                {
                    this.AtCurrencyCategory = productEpiboly;
                    this.action             = "view";
                    this.Refresh();
                }
            }
        }
コード例 #8
0
ファイル: CategoryEditForm.cs プロジェクト: daobataotie/EDERP
        public override void Refresh()
        {
            if (this.AtCurrencyCategory == null)
            {
                this.AtCurrencyCategory = new Book.Model.AtCurrencyCategory();
                this.action             = "insert";
            }
            this.bindingSource1.DataSource = this.AtCurrencyCategoryManager.Select();
            this.textEditId.Text           = this.AtCurrencyCategory.Id;
            this.textEditName.Text         = this.AtCurrencyCategory.AtCurrencyName;
            this.textEditEnglishName.Text  = this.AtCurrencyCategory.EnglishName;

            switch (this.action)
            {
            case "insert":
                this.textEditId.Properties.ReadOnly          = false;
                this.textEditName.Properties.ReadOnly        = false;
                this.textEditEnglishName.Properties.ReadOnly = false;

                break;

            case "update":
                this.textEditId.Properties.ReadOnly          = false;
                this.textEditName.Properties.ReadOnly        = false;
                this.textEditEnglishName.Properties.ReadOnly = false;

                break;

            case "view":
                this.textEditId.Properties.ReadOnly          = true;
                this.textEditName.Properties.ReadOnly        = true;
                this.textEditEnglishName.Properties.ReadOnly = true;

                break;

            default:
                break;
            }
            base.Refresh();
        }
コード例 #9
0
ファイル: CategoryEditForm.cs プロジェクト: daobataotie/EDERP
 protected override void AddNew()
 {
     this.AtCurrencyCategory = new Model.AtCurrencyCategory();
 }
コード例 #10
0
 public void Update(Model.AtCurrencyCategory e)
 {
     this.Update <Model.AtCurrencyCategory>(e);
 }
コード例 #11
0
 public void Insert(Model.AtCurrencyCategory e)
 {
     this.Insert <Model.AtCurrencyCategory>(e);
 }
コード例 #12
0
 public bool ExistsExcept(Model.AtCurrencyCategory e)
 {
     return(accessor.ExistsExcept(e));
 }