/// <summary>
 /// 保存
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     this.DataVerify();
     if (this.IsVerify)
     {
         PfmIaeCategoryMDL catMdl = new PfmIaeCategoryMDL();
         int catFlag = TypeHelper.TypeToInt32(this.cboxCategory.SelectedValue, 0);
         catMdl.CatName        = this.txtName.Text;
         catMdl.CatFather      = catFlag;
         catMdl.CatClick       = 0;
         catMdl.CatCounts      = 0;
         catMdl.CatDescription = string.IsNullOrEmpty(this.txtDescription.Text) ? null : this.txtDescription.Text;
         PfmIaeCategoryBLL.Insert(catMdl, catFlag == -1 ? false : true);
         MessageBoxResult boxResult = MessageBox.Show("新数据添加成功!是否继续添加?", "提示:", MessageBoxButton.YesNo, MessageBoxImage.Information, MessageBoxResult.No);
         if (boxResult == MessageBoxResult.Yes)
         {
             this.InitializeData();
         }
         else
         {
             if (ModuleExtend != null)
             {
                 this.ModuleExtend(false, Library.Transit.NameItems.IaeCategory);
             }
         }
     }
 }
Esempio n. 2
0
 /// <summary>
 ///  初始化数据
 /// </summary>
 private void InitializeData()
 {
     if (this.svDetailed.Visibility == Visibility.Visible)
     {
         this.DetailedBack();
     }
     EntityListener.PfmIaeCategoryListener.Instance.Receive(PfmIaeCategoryBLL.ISelectPaging(pager.PageSize, pager.PageCurrent, out _dataTotal));
 }
Esempio n. 3
0
 /// <summary>
 /// 删除收支类别数据
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void mitmDelete_Click(object sender, RoutedEventArgs e)
 {
     if (IaeCategoryEntity != null && IaeCategoryEntity.CatId > 0)
     {
         MessageBoxResult boxResult = MessageBox.Show(string.Format("您确定要删除数据【{0}】所包含的信息吗?(包含子类别数据)", IaeCategoryEntity.CatName), "询问:", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No);
         if (boxResult == MessageBoxResult.Yes)
         {
             PfmIaeCategoryBLL.Delete(IaeCategoryEntity.CatId, true);
             MessageBox.Show("数据删除成功!", "提示:", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
             this.InitializePaging();
         }
     }
 }
 /// <summary>
 /// 初始化数据盒子
 /// </summary>
 private void InitBoxOfComboBox()
 {
     DataIaeCategory = PfmIaeCategoryBLL.RecursiveI(" ", " ");
     if (DataIaeCategory.Count > 0)
     {
         this.BuildMain();
         this.btnChangeMode.Content   = "主类别";
         this.btnChangeMode.IsEnabled = true;
     }
     else
     {
         this.BuildChild();
         this.btnChangeMode.Content   = "子类别";
         this.btnChangeMode.IsEnabled = false;
     }
 }
 /// <summary>
 /// 取得收支类别名称
 /// </summary>
 /// <param name="catId">类别编号</param>
 /// <returns></returns>
 public static string GetName(int catId)
 {
     return(PfmIaeCategoryBLL.Select(catId).CatName);
 }
        /// <summary>
        /// 初始化数据盒子
        /// </summary>
        private void InitBoxOfComboBox()
        {
            //收支类型
            this.cboxType.SelectedValuePath = "Value";
            this.cboxType.DisplayMemberPath = "Key";
            this.cboxType.DataContext       = DictionaryTsit.IncomingsOrOutgoings;
            //账务成员
            IList <PfmMemberMDL> mbrList = PfmMemberBLL.ISelect();

            if (mbrList.Count > 0)
            {
                this.cboxMember.SelectedValuePath = "MbrId";
                this.cboxMember.DisplayMemberPath = "MbrName";
                this.cboxMember.DataContext       = mbrList;
            }
            else
            {
                this.cboxMember.SelectedValuePath = "Value";
                this.cboxMember.DisplayMemberPath = "Key";
                this.cboxMember.DataContext       = DictionaryTsit.DefSelect;
            }
            //账务账目
            IList <PfmAccountsMDL> accList = PfmAccountsBLL.ISelect();

            if (accList.Count > 0)
            {
                this.cboxAccounts.SelectedValuePath = "AccId";
                this.cboxAccounts.DisplayMemberPath = "AccName";
                this.cboxAccounts.DataContext       = accList;
            }
            else
            {
                this.cboxAccounts.SelectedValuePath = "Value";
                this.cboxAccounts.DisplayMemberPath = "Key";
                this.cboxAccounts.DataContext       = DictionaryTsit.DefSelect;
            }
            //收支类别
            IList <PfmIaeCategoryMDL> catList = PfmIaeCategoryBLL.RecursiveI(" ", " ");

            if (catList.Count > 0)
            {
                this.cboxCategory.SelectedValuePath = "CatId";
                this.cboxCategory.DisplayMemberPath = "CatName";
                this.cboxCategory.DataContext       = catList;
            }
            else
            {
                this.cboxCategory.SelectedValuePath = "Value";
                this.cboxCategory.DisplayMemberPath = "Key";
                this.cboxCategory.DataContext       = DictionaryTsit.DefSelect;
            }
            //收支项目·名称
            IList <PfmIaeItemsMDL> itemName = PfmIaeItemsBLL.ISelect("item_type = 1 and item_status > 0");

            if (itemName.Count > 0)
            {
                this.cboxName.SelectedValuePath = "ItemName";
                this.cboxName.DisplayMemberPath = "ItemName";
                this.cboxName.DataContext       = itemName;
            }
            else
            {
                this.cboxName.SelectedValuePath = "Value";
                this.cboxName.DisplayMemberPath = "Key";
                this.cboxName.DataContext       = DictionaryTsit.DefSelect;
            }
            //收支项目·地址
            IList <PfmIaeItemsMDL> addrName = PfmIaeItemsBLL.ISelect("item_type = 2 and item_status > 0");

            if (addrName.Count > 0)
            {
                this.cboxAddress.SelectedValuePath = "ItemName";
                this.cboxAddress.DisplayMemberPath = "ItemName";
                this.cboxAddress.DataContext       = addrName;
            }
            else
            {
                this.cboxAddress.SelectedValuePath = "Value";
                this.cboxAddress.DisplayMemberPath = "Key";
                this.cboxAddress.DataContext       = DictionaryTsit.DefSelect;
            }
            //收支项目·描述
            IList <PfmIaeItemsMDL> descName = PfmIaeItemsBLL.ISelect("item_type = 3 and item_status > 0");

            if (descName.Count > 0)
            {
                this.cboxDescription.SelectedValuePath = "ItemName";
                this.cboxDescription.DisplayMemberPath = "ItemName";
                this.cboxDescription.DataContext       = descName;
            }
            else
            {
                this.cboxDescription.SelectedValuePath = "Value";
                this.cboxDescription.DisplayMemberPath = "Key";
                this.cboxDescription.DataContext       = DictionaryTsit.DefSelect;
            }
        }