Exemplo n.º 1
0
 public async static Task SyncMaster(HomeMasterDetailPageViewModel viewModel)
 {
     _viewModel = viewModel;
     await Sync_mstr_bed_details();
     await Sync_mstr_bed_meal_class_mapping();
     await Sync_mstr_Cycledetails();
     await Sync_mstr_ward_details();
     await Sync_mstr_allergies_master();
     await Sync_mstr_diet_type();
     await Sync_mstr_ingredient();
     await Sync_mstr_mealclass();
     await Sync_mstr_meal_option();
     await Sync_mstr_meal_time();
     await Sync_mstr_meal_type();
     await Sync_mstr_menu_item_category();
     await Sync_mstr_others_master();
     await Sync_mstr_remarks();
     await Sync_mstr_diet_texture();
     await Sync_mstr_displaypayment();
     await Sync_mstr_therapeutic();
 }
Exemplo n.º 2
0
        public async static Task Sync_mstr_patient_info(HomeMasterDetailPageViewModel viewModel)
        {
            try
            {
                mstr_patient_info   patient_info = new mstr_patient_info();
                HttpClient          httpClient   = new System.Net.Http.HttpClient();
                HttpRequestMessage  request      = new HttpRequestMessage(HttpMethod.Get, Library.URL + "/" + Library.METHODE_GETALLPATIENT + "/" + Library.KEY_USER_SiteCode);
                HttpResponseMessage response     = await httpClient.SendAsync(request);

                List <mstr_patient_info> jarray = JsonConvert.DeserializeObject <List <mstr_patient_info> >(await response.Content.ReadAsStringAsync());
                using (var dbConn = DependencyService.Get <IDBInterface>().GetConnection())
                {
                    dbConn.DropTable <mstr_patient_info>();
                    dbConn.CreateTable <mstr_patient_info>();
                    dbConn.BeginTransaction();
                    float itemNo = 0;
                    foreach (var item in jarray)
                    {
                        itemNo++;
                        item.ward_bed = item.ward_name + "-" + item.bed_name;
                        item.ID       = item.ID;

                        if (string.Equals(item.is_care_giver, "true", StringComparison.CurrentCultureIgnoreCase))
                        {
                            item.Patientname = item.Patientname + ' ' + "(Care Giver)";
                        }

                        dbConn.Insert(item);
                        viewModel.CurrentProgress = ((itemNo / jarray.Count) * 100) / 100;
                    }

                    dbConn.Commit();
                };
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 3
0
 public HomeMasterDetailPage()
 {
     InitializeComponent();
     _viewModel            = BindingContext as HomeMasterDetailPageViewModel;
     _viewModel.navigation = Navigation;
 }
Exemplo n.º 4
0
 internal static async Task SyncMenuMaster(HomeMasterDetailPageViewModel homeMasterDetailPageViewModel)
 {
     _viewModel = homeMasterDetailPageViewModel;
     await Sync_mstr_menu_item();
     await Sync_mstr_menu_master();
 }