public void DeleteFaq(Faq faq) { //Cancella la FAQ specificata ITransaction tx; tx = this.Session_Col.BeginTransaction(); this.Session_Col.Delete(faq); tx.Commit(); }
public void AddFaq(Faq Faq) { ITransaction tx; tx = this.Session_Col.BeginTransaction(); this.Session_Col.Save(Faq); tx.Commit(); //Aggiorna una Faq. //Verranno modificati sia i dati relativi alla FAQ //che l'associazione con le categorie }
/// <summary> /// Utilizzato sia per modificare Domanda/risposta /// che per aggiornare la lista di categorie associate. /// </summary> /// <param name="Faq"></param> /// <remarks> /// Verificare la struttura in relazione ad nHibernate, Id ed affini... /// </remarks> public Enum.ErrorCode UpdateFaq(Faq Faq) { Enum.ErrorCode ErrorCode = Enum.ErrorCode.none; if (Faq.onCategories.Count > 0) { FAQ_Dal.UpdateFaq(Faq); } else { ErrorCode = Enum.ErrorCode.NoCategory; } return(ErrorCode); }
public void DeleteFaq(Int64 FaqID) { //Cancella la FAQ specificata ITransaction tx; tx = this.Session_Col.BeginTransaction(); Faq faq = (from Faq fq in this.Session_Col.Linq <Faq>() where fq.Id == FaqID select fq).First(); this.Session_Col.Delete(faq); tx.Commit(); }
public EditFaqModel GetNewFaqModel(Int32 CommunityId) { EditFaqModel EFM = new EditFaqModel(); Faq NewFaq = new Faq(); NewFaq.Question = ""; NewFaq.Answer = ""; NewFaq.CommunityId = CommunityId; NewFaq.onCategories = new List <Category>(); EFM.Faq = NewFaq; EFM.Category = FAQ_Dal.GetCategoriesList(CommunityId); //EFM.Faq = FAQ_Dal.GetFaq(FaqId); //EFM.Category = FAQ_Dal.GetCategoriesList(CommunityId); return(EFM); }
public Faq CreateFaq(Int32 CommunityId, String Question, String Answer, IList <Int64> CategoriesId) { Faq newFaq = new Faq(); newFaq.CommunityId = CommunityId; newFaq.Question = Question; newFaq.Answer = Answer; if (CategoriesId.Count > 0) { newFaq.onCategories = FAQ_Dal.GetCategoriesList(CategoriesId); } FAQ_Dal.AddFaq(newFaq); return(newFaq); }
public Enum.ErrorCode UpdateFaq(Int64 Id, String Question, String Answer) { Enum.ErrorCode ErrorCode = Enum.ErrorCode.none; if ((Question == null) || (Question == "") || (Answer == null) || (Answer == "")) { ErrorCode = Enum.ErrorCode.NoData; } else { Faq Faq = FAQ_Dal.GetFaq(Id); Faq.Question = Question; Faq.Answer = Answer; FAQ_Dal.UpdateFaq(Faq); } return(ErrorCode); }
public Enum.ErrorCode UpdateFaq(Int64 Id, String Question, String Answer, IList <Int64> CategoriesId) { Enum.ErrorCode ErrorCode = Enum.ErrorCode.none; if ((Question == null) || (Question == "") || (Answer == null) || (Answer == "")) { ErrorCode = Enum.ErrorCode.NoData; } else if (CategoriesId.Count < 1) { ErrorCode = Enum.ErrorCode.NoCategory; } else { Faq Faq = FAQ_Dal.GetFaq(Id); Faq.Question = Question; Faq.Answer = Answer; Faq.onCategories = FAQ_Dal.GetCategoriesList(CategoriesId); FAQ_Dal.UpdateFaq(Faq); } return(ErrorCode); }
public void DeleteFaq(Faq faq) { FAQ_Dal.DeleteFaq(faq); }
public Link(Faq Faq, Category Category) { this.Id = new IdLink(Faq, Category); }
public IdLink(Faq Faq, Category Category) { this.Faq = Faq; this.Category = Category; }