コード例 #1
0
      public MessageModel SaveOutdoorPatient(DAL.Model.OutdoorPatient aOutdoorPatient)
      {
          MessageModel aMessageModel = new MessageModel();

          aOutdoorPatientGatway = new OutdoorPatientGatway();


          DataTable data = new DataTable();

          data = aOutdoorPatientGatway.IsExist(aOutdoorPatient);
          if (data.Rows.Count > 0)
          {
              aMessageModel.MessageTitle = "Warning";
              aMessageModel.MessageBody  = "This patient already exist. Press the refresh button. \n Thank You.";
              return(aMessageModel);
          }
          string message = Ischecked(aOutdoorPatient);

          if (message != "Checked")
          {
              aMessageModel.MessageTitle = "Warning";
              aMessageModel.MessageBody  = message;
              return(aMessageModel);
          }

          if (aOutdoorPatientGatway.SaveOutdoorPatient(aOutdoorPatient) > 0)
          {
              //int  saveCount = new IpdGateway().SavePatientServiceIPD(aOutdoorPatient.AService);
              aMessageModel.MessageTitle = "Successful";
              aMessageModel.MessageBody  = "Outdoor patient information saved successfully.";
          }
          return(aMessageModel);
      }
コード例 #2
0
        public MessageModel UpdateAdmissionPatient(Patient patient, DAL.Model.OutdoorPatient aOutdoorPatient)
        {
            aIpdGateway = new IpdGateway();
            MessageModel aMessageModel = new MessageModel();
            int          saveCount     = 0;


            OutdoorPatientGatway aOutdoorPatientGatway = new OutdoorPatientGatway();
            DataTable            data = new DataTable();

            data = aOutdoorPatientGatway.IsExist(aOutdoorPatient);
            if (data.Rows.Count > 0)
            {
                saveCount = aIpdGateway.UpdateAdmissionPatient(patient);
                aMessageModel.MessageTitle = "Successfull";
                aMessageModel.MessageBody  = "Indoor patient information updated successfully!";
                return(aMessageModel);
            }
            else
            {
                saveCount = aIpdGateway.UpdateAdmissionPatient(patient);
                saveCount = new OutdoorPatientGatway().UpdateOutdoorPatient(aOutdoorPatient);
                aMessageModel.MessageTitle = "Successfull";
                aMessageModel.MessageBody  = "Indoor patient information updated successfully!";
            }
            return(aMessageModel);
        }
コード例 #3
0
        public MessageModel SaveIpdPatient(Patient patient, Service service, DAL.Model.OutdoorPatient aOutdoorPatient)
        {
            int          saveCount     = 0;
            MessageModel aMessageModel = new MessageModel();
            string       message       = Ischecked(patient);

            if (message != "Checked")
            {
                aMessageModel.MessageTitle = "Warning";
                aMessageModel.MessageBody  = message;
                return(aMessageModel);
            }


            OutdoorPatientGatway aOutdoorPatientGatway = new OutdoorPatientGatway();
            DataTable            data = new DataTable();

            data = aOutdoorPatientGatway.IsExist(aOutdoorPatient);
            if (data.Rows.Count > 0)
            {
                saveCount = new IpdGateway().SaveAdmissionPatient(patient);
                saveCount = new IpdGateway().SavePatientServiceIPD(service);
                if (saveCount > 0)
                {
                    aMessageModel.MessageTitle = "Successful";
                    aMessageModel.MessageBody  = "Indoor patient information saved successfully!";
                }
                return(aMessageModel);
            }
            else
            {
                saveCount = new IpdGateway().SaveAdmissionPatient(patient);
                saveCount = new IpdGateway().SavePatientServiceIPD(service);
                saveCount = new OutdoorPatientGatway().SaveOutdoorPatient(aOutdoorPatient);
                if (saveCount > 0)
                {
                    aMessageModel.MessageTitle = "Successful";
                    aMessageModel.MessageBody  = "Indoor patient information saved successfully!";
                }
                return(aMessageModel);
            }
        }