public string GetListOfPrinterLog() { try { List <tb_printer_log> lstPrinterLogModel = new List <tb_printer_log>(); lstPrinterLogModel = _printerDAO.GetListOfPrinterLog(); PrinterLogModel printerLogModel; List <PrinterLogModel> lstPrinterLog = new List <PrinterLogModel>(); for (int i = 0; i < lstPrinterLogModel.Count; i++) { printerLogModel = new PrinterLogModel(); printerLogModel.PrinterLogID = lstPrinterLogModel[i].printer_log_id; printerLogModel.PrinterID = lstPrinterLogModel[i].printer_id; printerLogModel.PrinterDateTime = lstPrinterLogModel[i].print_dt; //printerLogModel.PrinterDetail = lstPrinterLogModel[i].printer_detail; lstPrinterLog.Add(printerLogModel); } return(JsonConvert.SerializeObject(lstPrinterLogModel)); } catch (Exception ex) { log.Error("BussicnessLogic => GetListOfLocationTab" + ex.Message); return(null); } }
public int AddPrinterLog(string stringJSON) { try { log.Info("BusinessLogic => AddPrinter - Begin"); PrinterLogModel printerLogModel = JsonConvert.DeserializeObject <PrinterLogModel>(stringJSON); return(_printerDAO.AddPrinterLog(printerLogModel.PrinterID, printerLogModel.PrinterDateTime.ToShortDateString(), printerLogModel.PrinterDetail)); } catch (Exception ex) { log.Error("BussicnessLogic => AddPrinter" + ex.Message); return(-1); } }