Esempio n. 1
0
        public static MemberRole getFromReader(IDataReader rd)
        {
            MemberRole Item = new MemberRole();

            Item.ID          = (Int32)(rd["MR_ID"]);
            Item.Username    = (String)(rd["MR_Username"]);
            Item.ROLE_ID     = (Int32)(rd["MR_ROLE_ID"]);
            Item.RowId       = (Guid)(rd["MR_RowId"]);
            Item.NgayTao     = (DateTime)(rd["MR_NgayTao"]);
            Item.NgayCapNhat = (DateTime)(rd["MR_NgayCapNhat"]);
            Item.NguoiTao    = (String)(rd["MR_NguoiTao"]);
            return(Item);
        }
Esempio n. 2
0
        public static MemberRole SelectById(Int32 MR_ID)
        {
            MemberRole Item = new MemberRole();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("MR_ID", MR_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblMemberRole_Select_SelectById_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Esempio n. 3
0
        public static MemberRole InsertDangKyCaNhan(SqlTransaction tran, int CQ_ID, string Username)
        {
            MemberRole Item = new MemberRole();

            SqlParameter[] obj = new SqlParameter[2];
            obj[0] = new SqlParameter("Username", Username);
            obj[1] = new SqlParameter("CQ_ID", CQ_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(tran, CommandType.StoredProcedure, "sp_tblMemberRole_Insert_InsertDangKyCaNhan_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Esempio n. 4
0
        public static MemberRole Insert(MemberRole Inserted)
        {
            MemberRole Item = new MemberRole();

            SqlParameter[] obj = new SqlParameter[6];
            obj[0] = new SqlParameter("MR_Username", Inserted.Username);
            obj[1] = new SqlParameter("MR_ROLE_ID", Inserted.ROLE_ID);
            obj[2] = new SqlParameter("MR_RowId", Inserted.RowId);
            obj[3] = new SqlParameter("MR_NgayTao", Inserted.NgayTao);
            obj[4] = new SqlParameter("MR_NgayCapNhat", Inserted.NgayCapNhat);
            obj[5] = new SqlParameter("MR_NguoiTao", Inserted.NguoiTao);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblMemberRole_Insert_InsertNormal_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Esempio n. 5
0
        public static MemberRole Insert(SqlTransaction tran, int ROLE_ID, string Username)
        {
            MemberRole Item = new MemberRole();

            SqlParameter[] obj = new SqlParameter[6];
            obj[0] = new SqlParameter("MR_Username", Username);
            obj[1] = new SqlParameter("MR_ROLE_ID", ROLE_ID);
            obj[2] = new SqlParameter("MR_RowId", Guid.NewGuid());
            obj[3] = new SqlParameter("MR_NgayTao", DateTime.Now);
            obj[4] = new SqlParameter("MR_NgayCapNhat", DateTime.Now);
            obj[5] = new SqlParameter("MR_NguoiTao", Username);

            using (IDataReader rd = SqlHelper.ExecuteReader(tran, CommandType.StoredProcedure, "sp_tblMemberRole_Insert_InsertNormal_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }