コード例 #1
0
ファイル: MenuEntityTypeLogic.cs プロジェクト: ramyothman/RBM
 public bool Insert(MenuEntityType menuentitytype)
 {
     int autonumber = 0;
     MenuEntityTypeDAC menuentitytypeComponent = new MenuEntityTypeDAC();
     bool endedSuccessfuly = menuentitytypeComponent.InsertNewMenuEntityType( ref autonumber,  menuentitytype.Name);
     if(endedSuccessfuly)
     {
         menuentitytype.MenuEntityTypeId = autonumber;
     }
     return endedSuccessfuly;
 }
コード例 #2
0
ファイル: MenuEntityTypeLogic.cs プロジェクト: ramyothman/RBM
 public MenuEntityType GetByID(int _menuEntityTypeId)
 {
     MenuEntityTypeDAC _menuEntityTypeComponent = new MenuEntityTypeDAC();
      IDataReader reader = _menuEntityTypeComponent.GetByIDMenuEntityType(_menuEntityTypeId);
      MenuEntityType _menuEntityType = null;
      while(reader.Read())
      {
          _menuEntityType = new MenuEntityType();
          if(reader["MenuEntityTypeId"] != DBNull.Value)
              _menuEntityType.MenuEntityTypeId = Convert.ToInt32(reader["MenuEntityTypeId"]);
          if(reader["Name"] != DBNull.Value)
              _menuEntityType.Name = Convert.ToString(reader["Name"]);
      _menuEntityType.NewRecord = false;             }             reader.Close();
      return _menuEntityType;
 }
コード例 #3
0
ファイル: MenuEntityTypeLogic.cs プロジェクト: ramyothman/RBM
 public List<MenuEntityType> GetAll()
 {
     MenuEntityTypeDAC _menuEntityTypeComponent = new MenuEntityTypeDAC();
      IDataReader reader =  _menuEntityTypeComponent.GetAllMenuEntityType().CreateDataReader();
      List<MenuEntityType> _menuEntityTypeList = new List<MenuEntityType>();
      while(reader.Read())
      {
      if(_menuEntityTypeList == null)
          _menuEntityTypeList = new List<MenuEntityType>();
          MenuEntityType _menuEntityType = new MenuEntityType();
          if(reader["MenuEntityTypeId"] != DBNull.Value)
              _menuEntityType.MenuEntityTypeId = Convert.ToInt32(reader["MenuEntityTypeId"]);
          if(reader["Name"] != DBNull.Value)
              _menuEntityType.Name = Convert.ToString(reader["Name"]);
      _menuEntityType.NewRecord = false;
      _menuEntityTypeList.Add(_menuEntityType);
      }             reader.Close();
      return _menuEntityTypeList;
 }
コード例 #4
0
ファイル: MenuEntityTypeLogic.cs プロジェクト: ramyothman/RBM
 public bool Update(MenuEntityType menuentitytype ,int old_menuEntityTypeId)
 {
     MenuEntityTypeDAC menuentitytypeComponent = new MenuEntityTypeDAC();
     return menuentitytypeComponent.UpdateMenuEntityType( menuentitytype.Name,  old_menuEntityTypeId);
 }