/// <summary>
 /// 保存
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     this.DataVerify();
     if (this.IsVerify)
     {
         PfmAccountsMDL accMdl = new PfmAccountsMDL();
         accMdl.AccAddTime     = DateTime.Now;
         accMdl.MbrId          = TypeHelper.TypeToInt32(this.cboxMember.SelectedValue, 0);
         accMdl.AccStatus      = TypeHelper.TypeToTinyInt(this.cboxStatus.SelectedValue, 0);
         accMdl.AccName        = this.txtName.Text;
         accMdl.AccCode        = string.IsNullOrEmpty(this.txtCode.Text) ? null : this.txtCode.Text;
         accMdl.AccCard        = string.IsNullOrEmpty(this.txtCard.Text) ? null : this.txtCard.Text;
         accMdl.AccPurpose     = string.IsNullOrEmpty(this.txtPurpose.Text) ? null : this.txtPurpose.Text;
         accMdl.AccDescription = string.IsNullOrEmpty(this.txtDescription.Text) ? null : this.txtDescription.Text;
         PfmAccountsBLL.Insert(accMdl);
         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.Accounts);
             }
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 向数据表PfmAccounts中插入一条新记录
 /// </summary>
 /// <param name="pfmAccounts">PfmAccounts实体对象</param>
 /// <returns></returns>
 public static int Insert(PfmAccountsMDL pfmAccounts)
 {
     if (pfmAccounts == null)
     {
         return(0);
     }
     return(PfmAccountsBLL._dal.Insert(pfmAccounts));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 向数据表PfmAccounts修改一条记录
 /// </summary>
 /// <param name="pfmAccounts">PfmAccounts实体对象</param>
 /// <returns></returns>
 public static int Update(PfmAccountsMDL pfmAccounts)
 {
     if (pfmAccounts == null)
     {
         return(0);
     }
     return(PfmAccountsBLL._dal.Update(pfmAccounts));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 删除数据表PfmAccounts中的一条记录
 /// </summary>
 /// <param name="pfmAccounts">PfmAccounts实体对象</param>
 /// <returns></returns>
 public static int Delete(PfmAccountsMDL pfmAccounts)
 {
     return(PfmAccountsBLL._dal.Delete(pfmAccounts));
 }