Esempio n. 1
0
        /// <summary>
        /// ������ɫ��
        /// </summary>
        /// <param name="dto">��������ɫ����Ϣ��</param>
        /// <returns>�½�ɫ��Id��</returns>
        public static string InsertRole(RoleDTO dto)
        {
            Role r = new Role();
            r.Id = IdGen.GetNextId(typeof(Role));
            r.Name = dto.Name;
            r.Remark = dto.Remark;
            r.OrderId = dto.OrderId;

            RoleType rt = Db.Session.Load(typeof(RoleType), dto.RoleTypeId) as RoleType;
            rt.AddRole(r);

            Db.TransInsert(r);
            return r.Id;
        }
Esempio n. 2
0
        /// <summary>
        /// ���½�ɫ��
        /// </summary>
        /// <param name="dto">�����½�ɫ����Ϣ��</param>
        public static void UpdateRole(RoleDTO dto)
        {
            Role r = Db.Session.Load(typeof(Role), dto.Id) as Role;
            r.Name = dto.Name;
            r.Remark = dto.Remark;
            r.OrderId = dto.OrderId;

            Db.TransUpdate(r);
        }