public void UpdatePatientId(int id, int patientId)
 {
     using (var db = new ArtelusDbContext())
     {
         string sql = "UPDATE [Patient] SET [PatientId]={1} Where p_id={0}";
         db.Database.ExecuteSqlCommand(sql, id, patientId);
         db.SaveChanges();
     }
 }
 public void UpdateSyncStatus(int reportId)
 {
     using (var db = new ArtelusDbContext())
     {
         string sql = "UPDATE [PatientReport] SET Sync=1 Where Id={0}";
         db.Database.ExecuteSqlCommand(sql, reportId);
         db.SaveChanges();
     }
 }
 public void Update(PatientEntity model)
 {
     using (var db = new ArtelusDbContext())
     {
         string sql = "UPDATE [Patient] SET name={1},pMName={2},pLName={3},ifResidentOfM={4},IcNumber={5},otherOption={6},othersID={7},doctosName={8},hospitalName={9},hospitalID={10},hospitaScreening={11},p_email={12},marital_status={13},age={14},[sex]={15},[permanent_address]={16},[area]={17},[phone_res]={18},[mobile]={19},[occupation]={20},[working_at]={21},[currentMedications]={22},[laser_reatment]={23},have_cataract={24},have_hypertension={25},allergy_to_drugs={26},have_diabetes={27},additional_info={28},emg_contact_name={29},emg_phone={30},name_of_the_stated_onsent={31},relation_with_patient={32},update_at={33},allergy_drugs_details={34},MedicalInsurance={35} Where p_id={0}";
         db.Database.ExecuteSqlCommand(sql, model.Id, model.Nm, model.MNm, model.LNm, model.IfResidentOfM, model.IcNumber, model.OtherOption, model.OthersID, model.DocNm, model.HospitalNm, model.HospitalID, model.HospitalScreening, model.Email, model.MaritalStatus == "Married" ? "Yes" : "No", model.Age, model.Sex == "Male" ? "m" : "f", model.PerAdr, model.Area, model.ResidentPh, model.Mob, model.Occupation, model.WorkingAt, model.CurrentMedications, model.LaserTreatment, model.Cataract, model.Hypertension, model.AllergyDrugs, model.Diabetic, model.Info, model.EmergContactNm, model.EmergPh, model.StatedConsentPerson, model.Relation, model.MDt, model.AllergyDrugsDtl, model.MedicalInsurance);
         db.SaveChanges();
     }
 }
Ejemplo n.º 4
0
        public bool Update(UserEntity user)
        {
            int count = 0;

            using (var db = new ArtelusDbContext())
            {
                count = db.Database.ExecuteSqlCommand("Update [Users] SET IsConfigured={0},InstallID={1},Location={2},PinCode={3},Token={5},Address={6}, Email={7} Where Id={4}", user.IsConfigured, user.InstallID, user.Location, user.PinCode, user.Id, user.Token, user.Address, user.Email);
                db.SaveChanges();
            }
            return(count > 0);
        }
        public int AddReportData(int reportId, string mode, string eye, string img, string prediction, string size, int patientId)
        {
            int reportDataId = 0;

            using (var db = new ArtelusDbContext())
            {
                db.Database.ExecuteSqlCommand("INSERT INTO ReportData(PatientReportId,Mode,Img,Eye,Prediction,Size,PatientId) VALUES({0},{1},{2},{3},{4},{5},{6})", reportId, mode, img, eye, prediction, size, patientId);
                db.SaveChanges();
                reportDataId = db.Database.SqlQuery <int>("SELECT MAX(Id) FROM ReportData").SingleOrDefault();
            }
            return(reportDataId);
        }