/// <summary> /// Bind IDataReader to Entity /// </summary> public static PagesEntity ReaderBind(IDataReader dataReader) { PagesEntity model = new PagesEntity(); object ojb; ojb = dataReader["PageID"]; if (ojb != null && ojb != DBNull.Value) { model.PageID = (int)ojb; model.ID = model.PageID; } model.PageName = dataReader["PageName"].ToString(); model.PageTitle = dataReader["PageTitle"].ToString(); ojb = dataReader["MID"]; if (ojb != null && ojb != DBNull.Value) { model.MID = (int)ojb; } ojb = dataReader["Orders"]; if (ojb != null && ojb != DBNull.Value) { model.Orders = (int)ojb; } ojb = dataReader["Status"]; if (ojb != null && ojb != DBNull.Value) { model.Status = (int)ojb; } ojb = dataReader["IsMenu"]; if (ojb != null && ojb != DBNull.Value) { model.IsMenu = (bool)ojb; } return(model); }
public static PagesEntity CreatePagesEntity(int createdByUserID, ISystemDateTime timeProvider) { PagesEntity model = new PagesEntity(); model.CreatedBy = createdByUserID; model.CreatedOn = timeProvider.Now; model.ID = 0; model.ModifiedBy = createdByUserID; model.ModifiedOn = timeProvider.Now; model.IsMenu = false; model.MID = 0; model.Orders = 0; model.PageID = 0; model.PageName = string.Empty; model.PageTitle = string.Empty; model.Status = 0; return(model); }