// Get All Records For a give group id public List <CallListDto> GetAll() { var customerList = new List <CallListDto>(); int id = 100; for (var i = 1; i <= 100; i++) { Random rnd = new Random(); int val = rnd.Next(0, 3); var customer = new CallListDto { Id = i + id, Status = "New", Name = _randomTitle[val], CallStartDate = DateTime.Today, LastCallDate = DateTime.Today, CallSheet = "https://www.google.com" }; customerList.Add(customer); } return(customerList); }
// Save public CallListDto Post(CallListDto dto) { Console.WriteLine("Post got called " + dto.Id); if (dto.Name == "jay") { throw new Exception("Name is not Valid"); } Random rnd = new Random(); int val = rnd.Next(101, 200); var customer = new CallListDto { Id = 1, Status = "New", Name = _randomTitle[2], CallStartDate = DateTime.Today, LastCallDate = DateTime.Today, CallSheetLabel = "Click Here", CallSheet = "https://www.google.com" }; return(customer); }
// Get All Records For a give group id public List <CallListDto> GetAll(int id) { if (id == 0) { throw new Exception("ID is not valid"); } var customerList = new List <CallListDto>(); id = id * 100; for (var i = 1; i <= 100; i++) { Random rnd = new Random(); int val = rnd.Next(0, 3); var customer = new CallListDto { Id = i + id, Status = "New", Name = _randomTitle[val], CallStartDate = DateTime.Today, LastCallDate = DateTime.Today, CallSheetLabel = "Click Here", CallSheet = "https://www.google.com" }; customerList.Add(customer); } return(customerList); }
public void OnGet(int id) { Console.WriteLine(id); var dl = new CustomerDataLogic(); CallListDtoVal = dl.Get(id); }
public ActionResult <CallListDto> Edit([FromForm] CallListDto input) { try { return(_dataProvider.Put(input)); } catch (Exception e) { return(BadRequest(e.Message)); } }
// Update public CallListDto Put(CallListDto dto) { Console.WriteLine("Update Got Called"); var customer = new CallListDto { Id = 1, Status = "New", Name = _randomTitle[2], CallStartDate = DateTime.Today, LastCallDate = DateTime.Today, CallSheet = "https://www.google.com" }; return(customer); }
// Get a record by Id public CallListDto Get(int id) { Console.WriteLine("Get All got called"); var customer = new CallListDto { Id = id, Status = "New", Name = _randomTitle[2], CallStartDate = DateTime.Today, LastCallDate = DateTime.Today, CallSheet = "https://www.google.com" }; return(customer); }