public bool SaveDelayedMission() { DMission = new المهماة_المؤجلة(); DMission.رمز_المركز = centerID; //car //mission type DMission.رمز = MonthlyID; DMission.التاريخ_والوقت = Date; //case type //case // تفاصيل الحالة //patient id //patient name //can sit //from //to //caller phone //caller name PatientInfo.SaveInfo(DMission); DataTable cas = new DataTable(); cas.Clear(); cas.Columns.Add("رمز_الحالة"); cas.Columns.Add("الرمز_الشهري"); cas.Columns.Add("رمز_السنوي"); cas.Columns.Add("السنة"); DataRow dr; foreach (DataRow row in Case.Rows) { dr = cas.NewRow(); dr["رمز_الحالة"] = row["ID"]; dr["الرمز_الشهري"] = MonthlyID; dr["رمز_السنوي"] = AnnualID; dr["السنة"] = Date.Year; cas.Rows.Add(dr); } return(mission.add_Mission(DMission)); }
public static bool add_Mission(المهماة_المؤجلة new_Mission) { bool added = false; using (ERCEntities entity = new ERCEntities()) { try { entity.المهماة_المؤجلة.Add(new_Mission); added = entity.SaveChanges() > 0 ? true : false;; return(added); } catch { added = false; return(added); } }; }
public bool SaveInfo(المهماة_المؤجلة Mission) { /*= patientID; * * if (!IsPatientExist(patientID)) * { * المرضى Patient = new المرضى(); * //get data of new patient and added him to data table of patients * //a new form appear and the user fill the data * //addpatient class * } * if (From == FromTo.Home) * { * Mission.من_رمز_المدينة = FromCityID; * Mission.من_رمز_المنطقة = FromregionID; * } * else * { * Mission.من_مشفى = FromHospitalID; * Mission.من_القسم = FromDepatementID; * } * if (To == FromTo.Home) * { * Mission.الى_رمز_المدينة = ToCityID; * Mission.الى_رمز_المنطقة = ToregionID; * } * else * { * Mission.إلى_مشفى = ToHospitalID; * Mission.إلى_القسم = ToDepatementID; * } * */ return(true); }