public ManualType GetModel() { var manualType = new ManualType { Title = Title, Order = Order }; return manualType; }
public static bool Update(DefaultContext db, ManualType manualType) { int manualTypeId = manualType.ManualTypeId; ManualType dbManualType = GetDetail(db, manualTypeId); if (dbManualType == null) return false; dbManualType.CopyFrom(manualType); db.SaveChanges(); return true; }
public static DeleteResult Delete(DefaultContext db, ManualType manualType) { if (manualType == null) return DeleteResult.AuthorizationFailed; try { db.ManualTypes.Remove(manualType); db.SaveChanges(); return DeleteResult.Ok; } catch (Exception e) { Logger.SetLog(e); return DeleteResult.DbFailed; } }
public void CopyFrom(ManualType manualType) { Title = manualType.Title; Order = manualType.Order; }
private ManualTypeDelete(ManualType manualType) { ManualTypeId = manualType.ManualTypeId; Title = manualType.Title; }
private ManualTypeIndex(ManualType manualType) { ManualTypeId = manualType.ManualTypeId; Title = manualType.Title; Order = manualType.Order; }
public static ManualTypeEdit GetModelView(ManualType manualType) { if (manualType == null) return null; var manualTypeEdit = new ManualTypeEdit(manualType); return manualTypeEdit; }
public static ManualTypeDelete GetModelView(ManualType manualType) { if (manualType == null) return null; var manualTypeDelete = new ManualTypeDelete(manualType); return manualTypeDelete; }
private bool IsAccess(ManualType manualType) { return manualType != null; }
private ManualsByTypeIndex(BaseController baseController, ManualType manualType, int pageNumber, int pageSize) { Title = String.Format("{0} - {1}", ViewResource.ManualsByType_Index_Title_Text, manualType.Title); Manuals = manualType.Manuals.OrderBy(m => m.Order).Select(m => new ManualDashboard.Manual(baseController, m)).ToPagedList(pageNumber, pageSize); }
public ManualTypeItem(ManualType manualType, Manual[] manuals, bool isMore, bool isOddBlock) { ManualType = manualType; Manuals = manuals; IsMore = isMore; CssClass = isOddBlock ? ManualTypesOddBlockCssClass : ManualTypesEvenBlockCssClass; }
private static ManualType GetManualType(Models.ManualType manualType) { var localManualType = new ManualType(manualType.ManualTypeId, manualType.Title); return localManualType; }
public static void Insert(DefaultContext db, ManualType manualType) { db.ManualTypes.Add(manualType); db.SaveChanges(); }