예제 #1
0
        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);
        }
예제 #2
0
 public void DeleteRecord(RecordData record)
 {
     this.RecordRepository.DeleteRecord(record);
 }
예제 #3
0
 public void AddRecord(RecordData record)
 {
     this.RecordRepository.AddRecord(record);
 }