コード例 #1
0
ファイル: Add.aspx.cs プロジェクト: fangliu520/Beeant
 /// <summary>
 /// 填充用户
 /// </summary>
 /// <param name="info"></param>
 protected virtual void FillGroupAccounts(UserEntity info)
 {
     info.GroupAccounts = new List <GroupAccountEntity>();
     foreach (GridViewRow gvr in gvRole.Rows)
     {
         if (gvr.RowType != DataControlRowType.DataRow)
         {
             continue;
         }
         var ckSelect = gvr.FindControl("ckSelect") as System.Web.UI.HtmlControls.HtmlInputCheckBox;
         if (ckSelect == null || !ckSelect.Checked)
         {
             continue;
         }
         var groupAccount = new GroupAccountEntity
         {
             Group = new GroupEntity {
                 Id = ckSelect.Value.Convert <long>()
             },
             Account  = info.Account,
             SaveType = SaveType.Add,
         };
         info.GroupAccounts.Add(groupAccount);
     }
 }
コード例 #2
0
ファイル: Add.aspx.cs プロジェクト: fangliu520/Beeant
        /// <summary>
        /// 重写
        /// </summary>
        /// <typeparam name="TEntityType"></typeparam>
        /// <param name="id"></param>
        /// <param name="saveType"></param>
        /// <returns></returns>
        protected override TEntityType CreateSaveEntity <TEntityType>(long id, SaveType saveType)
        {
            var info = new GroupAccountEntity
            {
                SaveType = saveType,
                Group    = new GroupEntity {
                    Id = id
                }, Account = new AccountEntity {
                    Id = AccountId
                }
            };

            return(info as TEntityType);
        }
コード例 #3
0
    public int DeleteGroupAccount(GroupAccountEntity oGroupAccountEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("DELETE FROM tblGroupAccount WHERE GrpAccSL=" + oGroupAccountEntity.GrpAccSL, con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }
コード例 #4
0
    public int UpdateGroupAccount(GroupAccountEntity oGroupAccountEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("UPDATE  tblGroupAccount SET GrpAccNo='" + oGroupAccountEntity.GrpAccNo + "',AccGTSL='" + oGroupAccountEntity.AccGTSL + "',GrpAccName='" + oGroupAccountEntity.GrpAccName + "',Remarks='" + oGroupAccountEntity.Remarks + "', LastModifiedBy ='" + oGroupAccountEntity.LastModifiedBy + "' WHERE GrpAccSL=" + oGroupAccountEntity.GrpAccSL, con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }
コード例 #5
0
    public int InsertGroupAccount(GroupAccountEntity oGroupAccountEntity)
    {
        con = oConnectionDatabase.DatabaseConnection();
        int i = 0;

        cmd = new SqlCommand("INSERT INTO tblGroupAccount (GrpAccNo,AccGTSL,GrpAccName,Remarks,CrateBy,LastModifiedBy) VALUES('" + oGroupAccountEntity.GrpAccNo + "','" + oGroupAccountEntity.AccGTSL + "','" + oGroupAccountEntity.GrpAccName + "','" + oGroupAccountEntity.Remarks + "','" + oGroupAccountEntity.CrateBy + "','" + oGroupAccountEntity.LastModifiedBy + "')", con);
        try
        {
            cmd.CommandType = CommandType.Text;
            cmd.ExecuteNonQuery();
            i = 1;
        }
        catch { }
        con.Close();
        return(i);
    }