public void Add() { string resourceName = Request["resourceName"]; string strStart = Request["strStart"]; string strEnd = Request["strEnd"]; string resourceId = Request["resourceId"]; string result = ""; if (string.IsNullOrEmpty(resourceId) || string.IsNullOrEmpty(strEnd) || string.IsNullOrEmpty(strStart) || string.IsNullOrEmpty(resourceName)) { result = "wrong1"; Response.Write(result); return; } RecordData record = new RecordData(); try { record.StartTime = Convert.ToDateTime(strStart); record.EndTime = Convert.ToDateTime(strEnd); record.ResourceName = resourceName; record.ResourceId = Convert.ToInt32(resourceId); record.UserName = User.Identity.Name; this.RecordService.AddRecord(record); result = "success"; } catch (Exception e) { result = "wrong2"; } Response.Write(result); }
public void DeleteRecord(RecordData record) { this.RecordRepository.DeleteRecord(record); }
public void AddRecord(RecordData record) { this.RecordRepository.AddRecord(record); }