public int UpdateSectionTable(string stringJSON) { try { log.Info("BusinessLogic => UpdateSectionTable - Begin"); SectionModel sectionModel = JsonConvert.DeserializeObject <SectionModel>(stringJSON); return(_tableDAO.UpdateSectiontable(sectionModel.SectionID, sectionModel.Name)); } catch (Exception ex) { log.Error("BussicnessLogic => UpdateSectionTable" + ex.Message); return(-1); } }
public string GetListOfSection() { try { List <tb_section> lstSectionModel = new List <tb_section>(); lstSectionModel = _tableDAO.GetListOfSection(); SectionModel sectionModel; List <SectionModel> lstSectionModels = new List <SectionModel>(); for (int i = 0; i < lstSectionModel.Count; i++) { sectionModel = new SectionModel(); sectionModel.Name = lstSectionModel[i].name; sectionModel.SectionID = lstSectionModel[i].section_id; sectionModel.IsActive = lstSectionModel[i].is_active ?? 0; lstSectionModels.Add(sectionModel); } return(JsonConvert.SerializeObject(lstSectionModels)); } catch (Exception ex) { log.Error("BussicnessLogic => GetListOfTable" + ex.Message); return(null); } }