Beispiel #1
0
 private static GroupBE FillDataRecord(IDataRecord dr)
 {
     GroupBE objGroupBE = new GroupBE();
     if (!dr.IsDBNull(dr.GetOrdinal("GroupId")))
     {
         objGroupBE.GroupId = dr.GetInt32(dr.GetOrdinal("GroupId"));
     }
     if (!dr.IsDBNull(dr.GetOrdinal("GroupName")))
     {
         objGroupBE.GroupName = dr.GetString(dr.GetOrdinal("GroupName"));
     }
     if (!dr.IsDBNull(dr.GetOrdinal("OwnerId")))
     {
         objGroupBE.OwnerId = dr.GetInt32(dr.GetOrdinal("OwnerId"));
     }
     if (!dr.IsDBNull(dr.GetOrdinal("StartDate")))
     {
         objGroupBE.StartDate = dr.GetDateTime(dr.GetOrdinal("StartDate"));
     }
     if (!dr.IsDBNull(dr.GetOrdinal("EndDate")))
     {
         objGroupBE.EndDate = dr.GetDateTime(dr.GetOrdinal("EndDate"));
     }
     return objGroupBE;
 }
Beispiel #2
0
 public static GroupBE GetElementById(int intGroupId)
 {
     GroupBE objGroupBE = new GroupBE();
     List<GenralizeParametre> objListGroupParam = new List<GenralizeParametre>();
     objListGroupParam.Add(new GenralizeParametre("GroupId", intGroupId, DbType.Int32));
     IDataRecord dr = GenralizeStoredProcedure.GetIDataRecord(spGroupGetElementById, objListGroupParam);
     objGroupBE = FillDataRecord(dr);
     return objGroupBE;
 }
Beispiel #3
0
        public static int Save(GroupBE objGroupBE)
        {
            List<GenralizeParametre> objListGroupParam = new List<GenralizeParametre>();
            objListGroupParam.Add(new GenralizeParametre("GroupId", objGroupBE.GroupId, DbType.Int32));
            objListGroupParam.Add(new GenralizeParametre("GroupName", objGroupBE.GroupName, DbType.String));
            objListGroupParam.Add(new GenralizeParametre("OwnerId", objGroupBE.OwnerId, DbType.Int32));
            objListGroupParam.Add(new GenralizeParametre("StartDate", objGroupBE.StartDate, DbType.DateTime));
            objListGroupParam.Add(new GenralizeParametre("EndDate", objGroupBE.EndDate, DbType.DateTime));

            objGroupBE.GroupId = GenralizeStoredProcedure.GetInt(spGroupSave, objListGroupParam);
            return objGroupBE.GroupId;
        }