private bool UpdateToFirstDefaultGrantType(int ProjectID) { IEnumerable <GrantTypeList> propstatusList = projrepository.GetGrantTypeLists(); if (propstatusList.Any()) //if there is any List Item. { GrantTypeList GrantTypeStatus = propstatusList.First(); return(projrepository.InsertNewGrantTypeIntoProject(GrantTypeStatus.GrantTypeCodeID, ProjectID)); } else { return(false); } }
public bool InsertGrantTypeList() { bool result = true; try { GrantTypeList ls = new GrantTypeList(); ls.GrantTypeText = ""; db.GrantTypeLists.InsertOnSubmit(ls); db.SubmitChanges(); } catch (Exception ex) { result = false; } return(result); }