public extra(string add, string message) { try { if (message.ToUpper().Contains("#NUMERICAL")) { Contact contact = new Contact(add); Numericaldb db = new Numericaldb(); db.CreateDatabase(); db.Insert(contact); SmsManager.Default.SendTextMessage(add, null, "Your request for Numerical Computing subject's notifications is recieved", null, null); } if (message.ToUpper().Contains("#JAVA")) { Contact contact = new Contact(add); JAVAdb db = new JAVAdb(); db.CreateDatabase(); db.InsertIntoTablePerson(contact); SmsManager.Default.SendTextMessage(add, null, "Your request for JAVA subject's notifications is recieved", null, null); } if (message.ToUpper().Contains("#COMPILER")) { Contact contact = new Contact(add); Compilerdb db = new Compilerdb(); db.CreateDatabase(); db.InsertIntoTablePerson(contact); SmsManager.Default.SendTextMessage(add, null, "Your request for Compiler Construction subject's notifications is recieved", null, null); } if (message.ToUpper().Contains("#SE")) { Contact contact = new Contact(add); SEdb db = new SEdb(); db.CreateDatabase(); db.InsertIntoTablePerson(contact); SmsManager.Default.SendTextMessage(add, null, "Your request for Software Engineering subject's notifications is recieved", null, null); } if (message.ToUpper().Contains("#ERP")) { Contact contact = new Contact(add); ERPdb db = new ERPdb(); db.CreateDatabase(); db.InsertIntoTablePerson(contact); SmsManager.Default.SendTextMessage(add, null, "Your request for Enterprize Resource Planning subject's notifications is recieved", null, null); } if (message.ToUpper().Contains("#OS")) { Contact contact = new Contact(add); OSdb db = new OSdb(); db.CreateDatabase(); db.InsertIntoTablePerson(contact); SmsManager.Default.SendTextMessage(add, null, "Your request for Operating System subject's notifications is recieved", null, null); } } catch (Exception e) { Android.Util.Log.Info(e.InnerException.GetType().ToString(), e.Message); } }
void BtnJavaClick() { try { JAVAdb db = new JAVAdb(); db.CreateDatabase(); int dbCount = db.selectTablePerson().Count; int i = 0; foreach (Contact c in db.selectTablePerson()) { SmsManager.Default.SendTextMessage(c.Number, null, txtmsg.Text, null, null); } } catch (Exception ex) { Android.Util.Log.Info(ex.GetType().ToString(), ex.Message); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); java.CreateDatabase(); os.CreateDatabase(); erp.CreateDatabase(); compiler.CreateDatabase(); num.CreateDatabase(); se.CreateDatabase(); btnJAVA = FindViewById <Button>(Resource.Id.btnJAVA); try { btnJAVA.Text = "JAVA (" + java.selectTablePerson().Count + ")"; } catch (NullReferenceException) { btnJAVA.Text = "JAVA (0)"; } btnOS = FindViewById <Button>(Resource.Id.btnOS); try { btnOS.Text = "OS (" + os.selectTablePerson().Count + ")"; } catch (NullReferenceException) { btnOS.Text = "OS (0)"; } btnERP = FindViewById <Button>(Resource.Id.btnERP); try { btnERP.Text = "ERP (" + erp.selectTablePerson().Count + ")"; } catch (NullReferenceException) { btnERP.Text = "ERP (0)"; } btnComp = FindViewById <Button>(Resource.Id.btnComp); try { btnComp.Text = "Compiler (" + compiler.selectTablePerson().Count + ")"; } catch (NullReferenceException) { btnComp.Text = "Compiler (0)"; } btnNum = FindViewById <Button>(Resource.Id.btnNum); try { btnNum.Text = "Numerical (" + num.selectTable().Count + ")"; } catch (NullReferenceException) { btnNum.Text = "Numerical (0)"; } btnSE = FindViewById <Button>(Resource.Id.btnSE); try { btnSE.Text = "SE (" + se.selectTablePerson().Count + ")"; } catch (NullReferenceException) { btnSE.Text = "SE (0)"; } txtmsg = FindViewById <EditText>(Resource.Id.messageBox); count = FindViewById <TextView>(Resource.Id.wordCount); status = FindViewById <TextView>(Resource.Id.txtStatus); btnSE.Click += BtnSE_Click; btnNum.Click += BtnNum_Click; btnComp.Click += BtnComp_Click; btnERP.Click += BtnERP_Click; btnOS.Click += BtnOS_Click; btnJAVA.Click += BtnJAVA_Click; txtmsg.TextChanged += Txtmsg_TextChanged; }