示例#1
0
文件: RoleDao.cs 项目: pjjwpc/.netOA
        public int Delete(Role Role_Code)
        {
            DBHelper db = new DBHelper();
            DbCommand cmd = db.GetSqlStringCommand("DELETE FROM Role WHERE Role_Code = '" + Role_Code.Role_Code+"'");

            return db.ExecuteNonQuery(cmd);
        }
示例#2
0
文件: RoleDao.cs 项目: pjjwpc/.netOA
        private Role DataRowToBean(DataRow row)
        {
            Role Role = new Role();
            Role.Role_Code = Guid.Parse(UtilData.DBObjectToString(row["Role_Code"]));
            Role.Role_Name = UtilData.DBObjectToString(row["Role_Name"]);
            Role.DES = UtilData.DBObjectToString(row["DES"]);

            return Role;
        }
示例#3
0
文件: RoleDao.cs 项目: pjjwpc/.netOA
        public int Update(Role Role)
        {
            DBHelper db = new DBHelper();
            DbCommand cmd = db.GetStoredProcCommand("p_Role_update");
            db.AddInParameter(cmd, "@Role_Code", DbType.Guid, Role.Role_Code);
            db.AddInParameter(cmd, "@Role_Name", DbType.String, Role.Role_Name);
            db.AddInParameter(cmd, "@DES", DbType.String, Role.DES);

            return db.ExecuteNonQuery(cmd);
        }
示例#4
0
文件: RoleDao.cs 项目: pjjwpc/.netOA
        public int Save(Role Role)
        {
            DBHelper db = new DBHelper();
            DbCommand cmd = db.GetStoredProcCommand("p_Role_insert");//返回主键
            db.AddInParameter(cmd, "@Role_Name", DbType.String, Role.Role_Name);
            db.AddInParameter(cmd, "@DES", DbType.String, Role.DES);

            object res = db.ExecuteScalar(cmd);

            return res == null ? -1 :1;
        }