/// <summary> /// /// </summary> /// <param name="objEventBE"></param> /// <returns></returns> public static int Save(EventBE objEventBE) { List<GenralizeParametre> ObjListUserParam = new List<GenralizeParametre>(); ObjListUserParam.Add(new GenralizeParametre("EventId", objEventBE.EventId, DbType.Int32)); ObjListUserParam.Add(new GenralizeParametre("Title", objEventBE.Title, DbType.String)); ObjListUserParam.Add(new GenralizeParametre("Description", objEventBE.Description, DbType.String)); ObjListUserParam.Add(new GenralizeParametre("OwnerId", objEventBE.OwnerId, DbType.Int32)); ObjListUserParam.Add(new GenralizeParametre("OwnerTypeId", objEventBE.OwnerTypeId, DbType.Int32)); ObjListUserParam.Add(new GenralizeParametre("EventTypeId", objEventBE.EventTypeId, DbType.Int32)); ObjListUserParam.Add(new GenralizeParametre("StartDateTime", objEventBE.StartDateTime, DbType.DateTime)); ObjListUserParam.Add(new GenralizeParametre("EndDateTime", objEventBE.EndDateTime, DbType.DateTime)); objEventBE.EventId = GenralizeStoredProcedure.GetInt(spEventSave, ObjListUserParam); return objEventBE.EventId; }
private static EventBE FillDataRecord(IDataRecord dr) { EventBE objEventBE = new EventBE(); if (!dr.IsDBNull(dr.GetOrdinal("EventId"))) { objEventBE.EventId = dr.GetInt32(dr.GetOrdinal("EventId")); } if (!dr.IsDBNull(dr.GetOrdinal("Title"))) { objEventBE.Title = dr.GetString(dr.GetOrdinal("Title")); } if (!dr.IsDBNull(dr.GetOrdinal("Description"))) { objEventBE.Description = dr.GetString(dr.GetOrdinal("Description")); } if (!dr.IsDBNull(dr.GetOrdinal("OwnerId"))) { objEventBE.OwnerId = dr.GetInt32(dr.GetOrdinal("OwnerId")); } if (!dr.IsDBNull(dr.GetOrdinal("OwnerTypeId"))) { objEventBE.OwnerTypeId = dr.GetInt32(dr.GetOrdinal("OwnerTypeId")); } if (!dr.IsDBNull(dr.GetOrdinal("EventTypeId"))) { objEventBE.EventTypeId = dr.GetInt32(dr.GetOrdinal("EventTypeId")); } if (!dr.IsDBNull(dr.GetOrdinal("StartDateTime"))) { objEventBE.StartDateTime = dr.GetDateTime(dr.GetOrdinal("StartDateTime")); } if (!dr.IsDBNull(dr.GetOrdinal("EndDateTime"))) { objEventBE.EndDateTime = dr.GetDateTime(dr.GetOrdinal("EndDateTime")); } return objEventBE; }