Beispiel #1
0
        // huy dat lich
        public async Task <bool> SetNoBook(string CusNo_, string ShiftNo_, string Phone)
        {
            try
            {
                foreach (BookModel2 lay in menuList2)
                {
                    if (lay.time == datee)
                    {
                        string sql    = @"update Book set CusNo_='', ShiftNo_ ='" + ShiftNo_ + "',Phone='',TrangThai='' where Book.EmpNo_='" + EmpNo_1 + "' and  TimeBook='" + lay.TimeBook + "'";
                        int    result = await ex.setDataBFO(sql);

                        break;
                    }
                }


                return(true);
            }
            catch (Exception ex)
            {
                await DisplayAlert("error", ex.ToString(), "OK");

                return(false);
            }
        }
Beispiel #2
0
        public async void sentEmail(string toEmail, string subject, string name_cs
                                    , string day, string time, string id_cli
                                    , string id_fal)
        {
            //gan thong tin vao bien cuc bo
            getInfoCs(id_cli, id_fal);
            try
            {
                string username = "******";
                string password = "******";
                System.Net.NetworkCredential nc = new
                                                  System.Net.NetworkCredential(username, password);
                MailMessage MailMessage = new MailMessage();

                MailMessage.From = new System.Net.Mail.MailAddress("*****@*****.**");
                MailMessage.To.Add(toEmail);
                //subject email
                MailMessage.Subject    = subject;
                MailMessage.IsBodyHtml = true;


                //read file
                //var assembly = typeof(App).GetTypeInfo().Assembly;
                //Stream stream = assembly.GetManifestResourceStream("CLINIC.Droid.index.txt");
                //write stream
                //string text = "";
                //using (var reader = new System.IO.StreamReader(stream))
                //{
                //    text = reader.ReadToEnd();
                //}
                //string html = text;
                //MailMessage.Body = html;
                MailMessage.Body = @"<html>
                      <body> 
                      <p>Chào " + name_cs + @",</p> 
                      <p>Bạn đã đặt lịch hẹn tại phong khám " + name_cli_p + @"</p> 
                      <p>Chuyên khoa " + name_fal_p + @"</p> 
                      <p>Vào lúc " + time + @"</p> 
                      <p>Ngày " + day + @"</p> 
                      <p>Trân Trọng</p> 
                      </body> 
                      </html> 
                     ";
                SmtpClient SmtpClient = new SmtpClient("smtp.gmail.com");

                SmtpClient.EnableSsl   = true;
                SmtpClient.Credentials = nc;
                SmtpClient.Port        = 587;
                SmtpClient.Send(MailMessage);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
Beispiel #3
0
        public async Task Loadata()
        {
            string sql = @"SELECT [CliNo_]
                        ,[Name]
                        ,[Adr]
                         ,[Phone]
                        ,[Mail]
                        ,[Descrip]
                        FROM [Clinic]";

            try
            {
                var json = await ex.getDataBFO(sql);

                foreach (var item in json)
                {
                    varClinic             = new ClinicModel();
                    varClinic.Name        = item["Name"].ToString();
                    varClinic.CliNo_      = item["CliNo_"].ToString();
                    varClinic.Address     = item["Adr"].ToString();
                    varClinic.Phone       = item["Phone"].ToString();
                    varClinic.Email       = item["Mail"].ToString();
                    varClinic.Description = item["Descrip"].ToString();
                    listClinic.Add(varClinic);
                }
                mylist.ItemsSource = listClinic;
            }
            catch (Exception ex)
            {
                await DisplayAlert("thong bao", ex.ToString(), "ÖK");
            }
        }