Exemple #1
0
        public string EditClinic(DtoClinic dtoClinic)
        {
            var unigueClinic = ClinicMethods.Instance.GetClinicByCode(dtoClinic.Code);
            if (!dtoClinic.IsEdit)
            {
                var clinic = new DataAccess.Clinic()
                {
                    Code = dtoClinic.Code,
                    Name = dtoClinic.Name,
                    Address = dtoClinic.Address
                };
                return ClinicMethods.Instance.InsertClinic(clinic);
            }
            else
            {
                var clinic = new DataAccess.Clinic()
                  {
                      Id = unigueClinic.Id,
                      Code = dtoClinic.Code,
                      Name = dtoClinic.Name,
                      Address = dtoClinic.Address
                  };
                return ClinicMethods.Instance.UpdateClinic(clinic);

            }
        }
Exemple #2
0
        public string EditClinic(DtoClinic dtoClinic)
        {
            var unigueClinic = ClinicMethods.Instance.GetClinicByCode(dtoClinic.Code);

            if (!dtoClinic.IsEdit)
            {
                var clinic = new DataAccess.Clinic()
                {
                    Code    = dtoClinic.Code,
                    Name    = dtoClinic.Name,
                    Address = dtoClinic.Address
                };
                return(ClinicMethods.Instance.InsertClinic(clinic));
            }
            else
            {
                var clinic = new DataAccess.Clinic()
                {
                    Id      = unigueClinic.Id,
                    Code    = dtoClinic.Code,
                    Name    = dtoClinic.Name,
                    Address = dtoClinic.Address
                };
                return(ClinicMethods.Instance.UpdateClinic(clinic));
            }
        }
Exemple #3
0
        public DtoClinic[] FindClinics(DtoClinic dtoClinic)
        {
            string code = dtoClinic.Code;
            string name = dtoClinic.Name;
            string adress = dtoClinic.Address;
            Clinic.DataAccess.Clinic[] clinics = ClinicMethods.Instance.GetClinics(code, name);
            DtoClinic[] dtoClinics = clinics.Select(clinic => new DtoClinic()
                                      {
                                          Id = clinic.Id,
                                          Code = clinic.Code,
                                          Name = clinic.Name,
                                          Address = clinic.Address

                                      }).ToArray();
            return dtoClinics;
        }
Exemple #4
0
        public DtoClinic[] FindClinics(DtoClinic dtoClinic)
        {
            string code   = dtoClinic.Code;
            string name   = dtoClinic.Name;
            string adress = dtoClinic.Address;

            Clinic.DataAccess.Clinic[] clinics = ClinicMethods.Instance.GetClinics(code, name);
            DtoClinic[] dtoClinics             = clinics.Select(clinic => new DtoClinic()
            {
                Id      = clinic.Id,
                Code    = clinic.Code,
                Name    = clinic.Name,
                Address = clinic.Address
            }).ToArray();
            return(dtoClinics);
        }