async void save_ClickedAsync(object sender, System.EventArgs e) { if (pass1_entry.Text == pass2_entry.Text) { var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); vals["password"] = pass1_entry.Text; bool updated = Controller.InstanceCreation().UpdatePassword("res.users", "write", App.userid, vals); Settings.UserPassword = pass1_entry.Text; await DisplayAlert("Alert", "Password updated successfully", "Ok"); await PopupNavigation.PopAllAsync(); } else { await DisplayAlert("Alert", "Password doesn't match", "Ok"); await PopupNavigation.PopAllAsync(); } }
async void apply_clickedAsync(object sender, System.EventArgs e) { var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); bool res = Controller.InstanceCreation().UpdatePromotions(so_id, promo_key_id); if (res == true) { Application.Current.MainPage = new MasterPage(new CrmTabbedPage("tab3")); await DisplayAlert("Alert", "Promotions Applied Successfully", "Ok"); await PopupNavigation.PopAllAsync(); } else { await DisplayAlert("Alert", "Try Again", "Ok"); await PopupNavigation.PopAllAsync(); } // PopupNavigation.PopAsync(); // Navigation.PushPopupAsync(new ApplyProManPopupPage()); }
async void save_ClickedAsync(object sender, System.EventArgs e) { if (type_id == 1) { await PopupNavigation.PopAsync(); await Navigation.PushPopupAsync(new ApplyProManPopupPage(so_id)); } else if (type_id == 2) { try { var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); bool res = Controller.InstanceCreation().UpdatePromotionsAuto(so_id); if (res == true) { Application.Current.MainPage = new MasterPage(new CrmTabbedPage("tab3")); await DisplayAlert("Alert", "Promotions Applied Successfully", "Ok"); await PopupNavigation.PopAllAsync(); } else if (res == false) { await DisplayAlert("Alert", "There are multiple promotions applicable, please select manually.", "Ok"); await PopupNavigation.PopAsync(); } // await PopupNavigation.PopAsync(); } catch (Exception ex) { await DisplayAlert("Alert", "Please try again", "Ok"); await PopupNavigation.PopAsync(); } } }
//private void DownloadClicked(object sender, EventArgs e) //{ // downloader.DownloadFile("http://www.dada-data.net/uploads/image/hausmann_abcd.jpg", "XF_Downloads"); //} async void filedeleteClickedAsync(object sender, EventArgs e1) { // attachListView.ItemsSource = attachres; var args = (TappedEventArgs)e1; Attachments t2 = args.Parameter as Attachments; var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); string res = Controller.InstanceCreation().SaleOrderConfirm("sale.order", "remove_attachment", t2.id); if (res == "true") { attachListView.ItemsSource = null; attachres = Controller.InstanceCreation().getfileAtachment(so_id); attachListView.ItemsSource = attachres; listviewlayout.HeightRequest = attachres.Count * 45; mainlayout.HeightRequest = listviewlayout.HeightRequest + 35; if (attachres.Count == 0) { listviewlayout.IsVisible = false; mainlayout.WidthRequest = 100; mainlayout.HeightRequest = 20; } MessagingCenter.Send <string, List <Attachments> >("MyApp", "attachUpdated", attachres); await PopupNavigation.PopAsync(); } else { await DisplayAlert("Alert", "Please Try Again", "Cancel"); await PopupNavigation.PopAsync(); } await PopupNavigation.PopAsync(); }
private async void update_Clicked(object sender, EventArgs e) { var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); bool updated = Controller.InstanceCreation().UpdateLost(modelId, reasonId); if (updated) { await DisplayAlert("Alert", "Sucessfuly submitted", "Ok"); // Navigation.PopAllPopupAsync(); // App.Current.MainPage = new MasterPage(new CrmTabbedPage()); Loadingalertcall(); } else { await DisplayAlert("Alert", "Please try again", "Ok"); Loadingalertcall(); } }
async Task Handle_Clicked(object sender, System.EventArgs e) { try { Contract.Ensures(Contract.Result <Task>() != null); date_alert.IsVisible = false; date_box.IsVisible = false; meeting_alert.IsVisible = false; meeting_box.IsVisible = false; DateTime startdateTime; DateTime stopdateTime; // DateTime startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "M/d/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); // startdateTime = DateTime.ParseExact("24/01/2019 00:00:00", "dd/MM/yyyy hh:mm:ss", CultureInfo.InvariantCulture); //try //{ // startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture); //} //catch (Exception exe) //{ // try // { // startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "MM/dd/yyyy hh:mm:ss", CultureInfo.InvariantCulture); // } // catch (Exception ea) // { // try // { // startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); // } // catch (Exception ea1) // { // try // { // startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd-MM-yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); // } // catch // { // try // { // startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd/MM/yyyy hh:mm:ss", CultureInfo.InvariantCulture); // } // catch // { // try // { // startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture); // } // catch // { // try // { // startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "dd/MM/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); // } // catch // { // startdateTime = DateTime.ParseExact(st_date.Date.ToString(), "M/d/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); // } // } // } // } // } // } //} String convertstartdate = st_date.Date.ToString("yyyy-MM-dd"); // string convertstartdate = startdateTime.ToString("yyyy-MM-dd"); var dt = st_poptime.Time.ToString(); convertstartdate = convertstartdate + " " + dt.ToString(); // string convertstarttime1 = startdateTime; // string convertstarttime = dt.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss"); string convertstarttime = convertstartdate; DateTime startDate = DateTime.ParseExact(convertstarttime, "yyyy-MM-dd HH:mm:ss", null); // convertstarttime = startDate.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss"); convertstarttime = startDate.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss"); //try //{ // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture); //} //catch (Exception exc) //{ // try // { // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "MM/dd/yyyy hh:mm:ss", CultureInfo.InvariantCulture); // } // catch (Exception a) // { // try // { // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); // } // catch // { // try // { // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd-MM-yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); // } // catch // { // try // { // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd/MM/yyyy hh:mm:ss", CultureInfo.InvariantCulture); // } // catch // { // try // { // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture); // } // catch // { // try // { // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd/MM/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); // } // catch // { // try // { // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "dd/MM/yyyy HH:mm:ss tt", CultureInfo.InvariantCulture); // } // catch // { // try // { // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "M/d/yyyy hh:mm:ss", CultureInfo.InvariantCulture); // } // catch // { // stopdateTime = DateTime.ParseExact(stop_date.Date.ToString(), "M/d/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); // } // } // } // } // } // } // } // } //} //string convertstopdate = stopdateTime.ToString("yyyy-MM-dd"); string convertstopdate = stop_date.Date.ToString("yyyy-MM-dd"); var dt1 = stop_poptime.Time.ToString(); // string convertstoptime = dt1.ToUniversalTime().ToString("HH:mm:ss"); string convertstoptime = convertstopdate + " " + dt1.ToString(); DateTime stopDate = DateTime.ParseExact(convertstoptime, "yyyy-MM-dd HH:mm:ss", null); convertstoptime = stopDate.ToUniversalTime().ToString("yyyy-MM-dd HH:mm:ss"); vals["location"] = loc.Text.ToString(); vals["attendees"] = atnIdsList; vals["tags"] = tagIdsList; vals["meeting_subject"] = meeting_subject.Text; vals["start_datetime"] = convertstarttime; vals["stop_datetime"] = convertstoptime; vals["start"] = convertstarttime; vals["stop"] = convertstoptime; vals["description"] = des.Text; vals["start_date"] = startDate.ToString("yyyy-MM-dd"); if (check1.Checked == true) { vals["all_day"] = true; vals["duration"] = 0; // vals["start_date"] = convertstarttime; vals["start_date"] = startDate.ToString("yyyy-MM-dd"); // vals["stop_date"] = convertstoptime; vals["stop_date"] = stopDate.ToString("yyyy-MM-dd"); vals_update["start"] = convertstarttime; vals_update["stop"] = convertstoptime; if (stopDate.Date <= startDate.Date) { date_alert.IsVisible = true; date_box.IsVisible = true; // DisplayAlert("Alert", "Please fill meeting subject", "Ok"); } } else { vals["all_day"] = false; try { vals["duration"] = Convert.ToDouble(dur.Text); DateTime startDate1 = startDate.ToUniversalTime(); startDate1 = startDate1.AddHours(Convert.ToDouble(dur.Text)); string startstring1 = startDate1.ToString("yyyy-MM-dd HH:mm:ss"); vals["stop_date"] = stopDate.ToString("yyyy-MM-dd"); vals["stop_datetime"] = startstring1; vals["stop"] = startstring1; } catch { vals["duration"] = 0; //vals["stop_date"] = stopDate.ToString("yyyy-MM-dd"); //vals["stop_datetime"] = convertstarttime; //vals["stop"] = convertstarttime; } // vals["duration"] = 0; } if (meeting_subject.Text == "") { meeting_alert.IsVisible = true; meeting_box.IsVisible = true; // DisplayAlert("Alert", "Please check your stop date ", "Ok"); } else if (check1.Checked == false && dur.Text == "") { await DisplayAlert("Alert", "Please fill All day / Duration", "Ok"); } else { var updated = Controller.InstanceCreation().UpdateCRMOpporData("calendar.event", "create_calendar_event_app", vals); if (updated == "true") { date_alert.IsVisible = false; var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); App.Current.MainPage = new MasterPage(new CalendarPage()); await DisplayAlert("Alert", "Created Successfull", "Ok"); Loadingalertcall(); // Navigation.PopAllPopupAsync(); } else { await DisplayAlert("Alert", "Please try again", "Ok"); } } } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(">>>>>>>>>>>>>" + ex.Message); } }
public AttachmentPopupPage(List <Attachments> res, int id) { InitializeComponent(); // downloader.OnFileDownloaded += OnFileDownloaded; attachres = res; so_id = id; // attachListView.ItemsSource = App.nextActivityList; //next_activity nxt = new next_activity(); //nxt.name = "akil.pdf"; //App.nextActivityList.Add(nxt); // attachres = Controller.InstanceCreation().getfileAtachment(so_id, "crm.lead"); attachListView.ItemsSource = attachres; listviewlayout.HeightRequest = attachres.Count * 45; mainlayout.HeightRequest = listviewlayout.HeightRequest + 35; if (attachres.Count == 0) { listviewlayout.IsVisible = false; mainlayout.WidthRequest = 100; mainlayout.HeightRequest = 25; } var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += async(s, e) => { // handle the tap FileData fileData = new FileData(); FileData filedata = null; try { filedata = await CrossFilePicker.Current.PickFile(); if (filedata.FileName.Contains(".pdf") || filedata.FileName.Contains(".doc") || filedata.FileName.Contains(".docx") || filedata.FileName.Contains(".txt") || filedata.FileName.Contains(".jpeg") || filedata.FileName.Contains(".xls") || filedata.FileName.Contains(".jpg") || filedata.FileName.Contains(".wav") || filedata.FileName.Contains(".mp3") || filedata.FileName.Contains(".png") || filedata.FileName.Contains(".mp4") || filedata.FileName.Contains(".3gp") || filedata.FileName.Contains(".avi") || filedata.FileName.Contains(".xlsx")) { if (!string.IsNullOrEmpty(filedata.FileName)) //Just the file name, it doesn't has the path { byte[] bydata = filedata.DataArray; // String UploadData = Convert.ToBase64String(bydata); string file_uploadstring = Convert.ToBase64String(bydata); string file_uploadname = filedata.FileName; Dictionary <string, dynamic> vals = new Dictionary <string, dynamic>(); var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); vals["res_model"] = "crm.lead"; vals["res_id"] = so_id; vals["name"] = file_uploadname; vals["datas"] = file_uploadstring; vals["datas_fname"] = file_uploadname; vals["public"] = true; var res1 = Controller.InstanceCreation().UpdateLeadCreationData("ir.attachment", "create", vals); await DisplayAlert("Alert", "Record updated successfully", "Ok"); attachres = Controller.InstanceCreation().getfileAtachment(so_id, "crm.lead"); attachListView.ItemsSource = attachres; listviewlayout.HeightRequest = attachres.Count * 45; mainlayout.HeightRequest = listviewlayout.HeightRequest + 35; if (attachres.Count == 0) { listviewlayout.IsVisible = false; mainlayout.WidthRequest = 100; mainlayout.HeightRequest = 20; } MessagingCenter.Send <string, List <Attachments> >("MyApp", "attachUpdated", attachres); // MessagingCenter.Send<List<Attachments>,>("attachUpdated", attachres); await PopupNavigation.PopAsync(); await PopupNavigation.PopAsync(); // topimg = UploadData; // var stream = new MemoryStream(bydata); // user_img.Source = ImageSource.FromStream(() => stream); } } else { await DisplayAlert("Alert", "Please upload valid file name", "Ok"); await PopupNavigation.PopAsync(); } } catch (Exception ex) { filedata = null; System.Diagnostics.Debug.WriteLine("Warning Exception : " + ex.Message); } }; add_attach.GestureRecognizers.Add(tapGestureRecognizer); }
async void save_ClickedAsync(object sender, System.EventArgs e) { DateTime startdateTime; DateTime stopdateTime; // DisplayAlert("Alert", start_datepicker.Date.ToString(), "Ok"); String startdatestring = String.Format("{0:MM-dd-yyyy HH:mm:ss}", start_datepicker.Date); startdateTime = DateTime.ParseExact(startdatestring, "MM-dd-yyyy HH:mm:ss", CultureInfo.InvariantCulture); string start_datestring = startdateTime.ToString("yyyy-MM-dd"); String stopdatestring = String.Format("{0:MM-dd-yyyy HH:mm:ss}", end_datepicker.Date); stopdateTime = DateTime.ParseExact(stopdatestring, "MM-dd-yyyy HH:mm:ss", CultureInfo.InvariantCulture); string end_datestring = stopdateTime.ToString("yyyy-MM-dd"); string combinestring = start_datestring + " " + end_datestring; DateTime startDate = DateTime.ParseExact(start_datestring, "yyyy-MM-dd", CultureInfo.InvariantCulture); DateTime endDate = DateTime.ParseExact(end_datestring, "yyyy-MM-dd", CultureInfo.InvariantCulture); //if (endDate.Date <= startDate.Date) //{ // date_alert.IsVisible = true; // date_box.IsVisible = true; // // DisplayAlert("Alert", "Please fill meeting subject", "Ok"); // mainlayout.HeightRequest = 380; //} if (App.filterstring != "Days" && App.filterstring != "Month") { App.filterdict["range"] = combinestring; App.filterdict["days"] = "False"; App.filterdict["month"] = "False"; if (endDate.Date <= startDate.Date) { date_alert.IsVisible = true; date_box.IsVisible = true; // DisplayAlert("Alert", "Please fill meeting subject", "Ok"); mainlayout.HeightRequest = 380; // await Navigation.PopAsync(); } else { var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); List <CRMLead> crmLeadData = Controller.InstanceCreation().crmFilterData(); App.Current.MainPage = new MasterPage(new CrmTabbedPage(tab_string)); await Navigation.PopAllPopupAsync(); } } else { if (App.filterstring == "Days") { App.filterdict["range"] = "False"; App.filterdict["days"] = "True"; App.filterdict["month"] = "False"; } else { App.filterdict["range"] = "False"; App.filterdict["days"] = "False"; App.filterdict["month"] = "True"; } var currentpage = new LoadingAlert(); await PopupNavigation.PushAsync(currentpage); List <CRMLead> crmLeadData = Controller.InstanceCreation().crmFilterData(); App.Current.MainPage = new MasterPage(new CrmTabbedPage(tab_string)); //await Navigation.PopAllPopupAsync(); Loadingalertcall(); } // MessagingCenter.Send<Dictionary<string,dynamic>, string>(vals, "NotifyMsg", "test"); async void Loadingalertcall() { await PopupNavigation.PopAllAsync(); } }