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

            Item.ID          = (Int32)(rd["RF_ID"]);
            Item.FN_ID       = (Int32)(rd["RF_FN_ID"]);
            Item.ROLE_ID     = (Int32)(rd["RF_ROLE_ID"]);
            Item.Active      = (Boolean)(rd["RF_Active"]);
            Item.RowId       = (Guid)(rd["RF_RowId"]);
            Item.NguoiTao    = (String)(rd["RF_NguoiTao"]);
            Item.NgayTao     = (DateTime)(rd["RF_NgayTao"]);
            Item.NgayCapNhat = (DateTime)(rd["RF_NgayCapNhat"]);
            return(Item);
        }
Esempio n. 2
0
        public static RoleFunction SelectById(Int32 RF_ID)
        {
            RoleFunction Item = new RoleFunction();

            SqlParameter[] obj = new SqlParameter[1];
            obj[0] = new SqlParameter("RF_ID", RF_ID);
            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblRoleFunction_Select_SelectById_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Esempio n. 3
0
        public static RoleFunction UpdateByRoleIdFunctionList(string ROLE_ID, string FN_List, string NguoiTao)
        {
            RoleFunction Item = new RoleFunction();

            SqlParameter[] obj = new SqlParameter[3];
            obj[0] = new SqlParameter("ROLE_ID", ROLE_ID);
            obj[1] = new SqlParameter("FN_List", FN_List);
            obj[2] = new SqlParameter("NguoiTao", NguoiTao);

            using (IDataReader rd = SqlHelper.ExecuteReader(DAL.con(), CommandType.StoredProcedure, "sp_tblRoleFunction_Update_UpdateByRoleIdFunctionList_linhnx", obj))
            {
                while (rd.Read())
                {
                    Item = getFromReader(rd);
                }
            }
            return(Item);
        }
Esempio n. 4
0
        public static RoleFunction Insert(RoleFunction Inserted)
        {
            RoleFunction Item = new RoleFunction();

            SqlParameter[] obj = new SqlParameter[7];
            obj[0] = new SqlParameter("RF_FN_ID", Inserted.FN_ID);
            obj[1] = new SqlParameter("RF_ROLE_ID", Inserted.ROLE_ID);
            obj[2] = new SqlParameter("RF_Active", Inserted.Active);
            obj[3] = new SqlParameter("RF_RowId", Inserted.RowId);
            obj[4] = new SqlParameter("RF_NguoiTao", Inserted.NguoiTao);
            obj[5] = new SqlParameter("RF_NgayTao", Inserted.NgayTao);
            obj[6] = new SqlParameter("RF_NgayCapNhat", Inserted.NgayCapNhat);

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