public List <TodaysPatientstatu> GetAllStatusByPaging(out int totalrecord, TodaysPatientstatu model) { List <TodaysPatientstatu> todaysPatientstatus; try { todaysPatientstatus = _todayStatusRepository.GetAllStatusByPaging(out totalrecord, model); } catch (Exception exception) { throw new Exception(exception.Message); } return(todaysPatientstatus); }
public int Save(TodaysPatientstatu todaysPatientstatu) { int saveIndex = 0; try { todaysPatientstatu.IsActive = true; saveIndex = _todayStatusRepository.Save(todaysPatientstatu); } catch (Exception exception) { throw new Exception(exception.Message); } return(saveIndex); }
public int Delete(int id) { int deleteIndex = 0; try { TodaysPatientstatu todaysPatientstatu = GetStatusById(id); todaysPatientstatu.IsActive = false; deleteIndex = _todayStatusRepository.Delete(todaysPatientstatu); } catch (Exception exception) { throw new Exception(exception.Message); } return(deleteIndex); }
public JsonResult Save(TodayPatientStatusViewModel model) { int saveIndex = 0; TodaysPatientstatu todaysPatientstatu = new TodaysPatientstatu(); TimeSpan ts = new TimeSpan(); List <string> Values = new List <string>(); todaysPatientstatu.Id = model.Id; todaysPatientstatu.PatientName = model.PatientName; todaysPatientstatu.PatientStatus = model.PatientStatus; todaysPatientstatu.SerialNo = model.SerialNo; todaysPatientstatu.VisitingDate = model.VisitingDate; //todaysPatientstatu.visitingtime = DateTime.ParseExact(model., "h:mm tt", CultureInfo.InvariantCulture).TimeOfDay; todaysPatientstatu.visitingtime = model.visitingtime; //if (Values.Contains("Hour")) // model.InTime = model.InTime + ts; //else // model.InTime = model.InTime + TimeSpan.Parse(model.Values); //todaysPatientstatu.visitingtime = DateTime.ParseExact(model.InTime, "h:mm tt", CultureInfo.InvariantCulture).TimeOfDay; ////if (Values[2].Contains("Hour")) //// todaysPatientstatu.visitingtime = todaysPatientstatu.visitingtime + ts; ////else //// todaysPatientstatu.visitingtime = todaysPatientstatu.visitingtime + TimeSpan.Parse(Values[1]); //// //todaysPatientstatu.visitingtime = todaysPatientstatu.visitingtime + TimeSpan.Parse(model.ToString()); todaysPatientstatu.contact = model.contact; todaysPatientstatu.VisitingPurpose = model.VisitingPurpose; saveIndex = model.Id == 0 ? TodayStatusManager.Save(todaysPatientstatu) : TodayStatusManager.Edit(todaysPatientstatu); return(Reload(saveIndex)); }
public int Edit(TodaysPatientstatu todaysPatientstatu) { int editIndex = 0; try { TodaysPatientstatu _todaysPatientstatu = GetStatusById(todaysPatientstatu.Id); _todaysPatientstatu.Id = todaysPatientstatu.Id; _todaysPatientstatu.PatientName = todaysPatientstatu.PatientName; _todaysPatientstatu.PatientStatus = todaysPatientstatu.PatientStatus; _todaysPatientstatu.SerialNo = todaysPatientstatu.SerialNo; _todaysPatientstatu.VisitingDate = todaysPatientstatu.VisitingDate; _todaysPatientstatu.visitingtime = todaysPatientstatu.visitingtime; _todaysPatientstatu.contact = todaysPatientstatu.contact; _todaysPatientstatu.VisitingPurpose = todaysPatientstatu.VisitingPurpose; editIndex = _todayStatusRepository.Edit(_todaysPatientstatu); } catch (Exception exception) { throw new Exception(exception.Message); } return(editIndex); }