public string update(string Patient_id, string disease, string doctor_id, string a, string b, string c)
        {
            string s = "";

            try
            {
                HospitalManagementEntity context = new HospitalManagementEntity();
                Patient_record           u       = context.Patient_record.Find(Convert.ToInt32(Patient_id));
                u.disease = disease;
                int  id    = Convert.ToInt32(doctor_id);
                User sUser = context.Users.Find(id);
                if (sUser == null)
                {
                    return("Invalide Doctor Id ");
                }
                u.Doctor_id     = Convert.ToInt32(doctor_id);
                u.Description   = a;
                u.Appoinment_id = Convert.ToInt32(b);
                //u.Discharge_date = c;
                context.Entry(u).State = System.Data.Entity.EntityState.Modified;
                context.SaveChanges();
                s = "Update Successfull";
                return(s);
            }
            catch (Exception e) {
                return("Id's Can't be Updated");
            }
        }
        public string update(string Apppoinment_id, string patient_name, string a, string b, string c, string doc_id)
        {
            try
            {
                HospitalManagementEntity context = new HospitalManagementEntity();
                Patient_Appoinment       u       = context.Patient_Appoinment.Find(Convert.ToInt32(Apppoinment_id));
                u.Patient_name    = patient_name;
                u.Appoinment_date = Convert.ToDateTime(a);
                int  id = Convert.ToInt32(doc_id);
                User s  = context.Users.Find(id);
                if (s == null)
                {
                    return("Invalide Doctor Id ");
                }
                u.Doctor_id            = Convert.ToInt32(doc_id);
                u.Address              = b;
                u.Mobile_no            = c;
                context.Entry(u).State = System.Data.Entity.EntityState.Modified;
                context.SaveChanges();

                return("Updation Successfull");
            }
            catch (Exception e)
            {
                return("Can't Update Id's");
            }
        }
예제 #3
0
        public string update(string id, string username, string password)
        {
            try
            {
                HospitalManagementEntity context = new HospitalManagementEntity();
                User u = context.Users.Find(Convert.ToInt32(id));
                u.Username             = username;
                u.Password             = password;
                context.Entry(u).State = System.Data.Entity.EntityState.Modified;
                context.SaveChanges();

                return("Updation Successfull");
            }
            catch (Exception e)
            {
                return("Can't Update Id's");
            }
        }
 public string update(string Patient_id, string name, string price, string e_date, string m_date, string quantity)
 {
   
     try { 
     HospitalManagementEntity context = new HospitalManagementEntity();
     Medicine_details u = context.Medicine_details.Find(Convert.ToInt32(Patient_id));
     u.Mfg_date = Convert.ToDateTime( m_date);
     u.Medicine_Id = Convert.ToInt32(Patient_id);
     u.Name = name;
     u.Expiry_date = Convert.ToDateTime(e_date);
     u.price = Convert.ToInt32(price);
     u.Quantity = Convert.ToInt32(quantity);
     context.Entry(u).State = System.Data.Entity.EntityState.Modified;
     context.SaveChanges();
         
         return "Updation Successfull";
     }
     catch (Exception e)
     {
        return "Can't Update Record Id's";
     }
     
 }