Beispiel #1
0
 public string GetListOfTable()
 {
     try
     {
         List <tb_table_section> lstTableSection = new List <tb_table_section>();
         lstTableSection = _tableDAO.GetListTable();
         TableModal        tableModel;
         List <TableModal> lstTableModel = new List <TableModal>();
         for (int i = 0; i < lstTableSection.Count; i++)
         {
             tableModel              = new TableModal();
             tableModel.TableID      = lstTableSection[i].table_section_id;
             tableModel.uniName      = lstTableSection[i].u_name;
             tableModel.Name         = lstTableSection[i].name;
             tableModel.SectionID    = lstTableSection[i].section_id ?? -1;
             tableModel.MarginTop    = lstTableSection[i].margin_top ?? -1;
             tableModel.MarginBottom = lstTableSection[i].margin_bottom ?? -1;
             tableModel.MarginRight  = lstTableSection[i].margin_right ?? -1;
             tableModel.MarginLeft   = lstTableSection[i].margin_left ?? -1;
             tableModel.Height       = lstTableSection[i].height ?? 50;
             tableModel.Width        = lstTableSection[i].width ?? 50;
             tableModel.IsActive     = lstTableSection[i].is_active ?? 0;
             lstTableModel.Add(tableModel);
         }
         return(JsonConvert.SerializeObject(lstTableModel));
     }
     catch (Exception ex)
     {
         log.Error("BussicnessLogic => GetListOfTable" + ex.Message);
         return(null);
     }
 }
Beispiel #2
0
        public int UpdateTable(string stringJSON)
        {
            try
            {
                TableModal tableModel = JsonConvert.DeserializeObject <TableModal>(stringJSON);

                return(_tableDAO.UpdateTable(tableModel.TableID, tableModel.MarginTop, tableModel.MarginBottom, tableModel.MarginLeft, tableModel.MarginRight));
            }
            catch (Exception ex)
            {
                log.Error("BussicnessLogic => UpdateTable" + ex.Message);
                return(-1);
            }
        }
Beispiel #3
0
        public int AddTable(string stringJSON)
        {
            try
            {
                log.Info("BusinessLogic => AddTable - Begin");
                TableModal tableModel = JsonConvert.DeserializeObject <TableModal>(stringJSON);

                return(_tableDAO.AddTable(tableModel.uniName, tableModel.Name, tableModel.SectionID, tableModel.MarginTop, tableModel.MarginBottom, tableModel.MarginLeft, tableModel.MarginRight));
            }
            catch (Exception ex)
            {
                log.Error("BussicnessLogic => AddTable" + ex.Message);
                return(-1);
            }
        }