Exemple #1
0
        private void Button_SendSingleMessage_Click(object sender, EventArgs e)
        {
            Label_ErrorSingleSMS.Text = "";

            MessagingController singleSmsCt = new MessagingController();
            MessagingModel      singleSmsMd = new MessagingModel();

            singleSmsMd.recipient = TextBox_SingleReciepient.Text;
            singleSmsMd.smsText   = RichText_SingleMessage.Text;

            if (singleSmsCt.checkForEmpty(singleSmsMd))
            {
                NotifySMS sms = new NotifySMS();
                if (sms.loginSMS())
                {
                    if (sms.singleSMS(singleSmsMd))
                    {
                        MessageBox.Show("SMS has been sent");
                        clearSingelSMSFeilds();
                    }
                    else
                    {
                        MessageBox.Show("SMS Not Sent. Somthing went wrong!");
                    }
                }
                else
                {
                    MessageBox.Show("SMS Login Failed");
                }
            }
            else
            {
                Label_ErrorSingleSMS.Text = singleSmsMd.errorMessage;
            }
        }
        private void Button_AddTeam_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            Label_ErrorMessage_TeamAdd.Text = "";

            AddTeamModel      addTeamMd = new AddTeamModel();
            AddTeamController addTeamCt = new AddTeamController();

            addTeamMd.teamMemberName    = Text_Team_Fullname.Text;
            addTeamMd.teamMemberAddress = Text_Team_Address.Text;
            addTeamMd.teamMemberContact = Text_Team_ContactNumber.Text;
            addTeamMd.sendSMSCheck      = CheckBox_SendSMS_teamAdd.Checked;

            if (addTeamCt.saveTeamMember(addTeamMd))
            {
                if (addTeamCt.smsChecked(addTeamMd))
                {
                    NotifySMS sms = new NotifySMS();

                    if (sms.loginSMS())
                    {
                        if (sms.teamAddSMS(addTeamMd))
                        {
                            MessageBox.Show("Team Member was Notified Via SMS");
                        }
                        else
                        {
                            MessageBox.Show("The Member was not notified via SMS", "Somthing Went Wrong");
                        }
                    }
                    else
                    {
                        MessageBox.Show("SMS Not Sent", "The Login Failed");
                    }
                }

                Label_ErrorMessage_TeamAdd.Text = addTeamMd.errorMessage;
                clearFeilds();
                loadTeamMembersGrid();

                new FormNewCase();
            }
            else
            {
                Label_ErrorMessage_TeamAdd.Text = addTeamMd.errorMessage;
            }
        }
        private void Button_AddDonor_Click(object sender, EventArgs e)
        {
            Label_ErrorDonation.Text = "";

            DonorMD donorModel   = new DonorMD();
            DonorCT DonorControl = new DonorCT();

            donorModel.DonorName      = TextBox_DonorName.Text;
            donorModel.DonorGuardian  = TextBox_DonorGuardian.Text;
            donorModel.DonorAddress   = TextBox_DonorAddress.Text;
            donorModel.DonorContact   = TextBox_DonorContact.Text;
            donorModel.DonationAmount = TextBox_DonationAmount.Text;
            donorModel.DonationDate   = Date_DonationDate.Text;
            donorModel.smsChecked     = CheckBox_SendSMS_Donor.Checked;

            if (DonorControl.SaveDonorDetails(donorModel))
            {
                if (DonorControl.smsChecked(donorModel))
                {
                    NotifySMS sms = new NotifySMS();

                    if (sms.loginSMS())
                    {
                        if (sms.donorAddSMS(donorModel))
                        {
                            MessageBox.Show("Team Donor was Notified Via SMS");
                        }
                        else
                        {
                            MessageBox.Show("The Member was not notified via SMS", "Somthing Went Wrong");
                        }
                    }
                    else
                    {
                        MessageBox.Show("SMS Not Sent", "The Login Failed");
                    }
                }

                MessageBox.Show("Donation Recorded Successfully!");
                loadDonors();
                clearFeilds();
            }
            else
            {
                Label_ErrorDonation.Text = donorModel.ErrorMessageDonors;
            }
        }
Exemple #4
0
        private void case_personal_btn_Click(object sender, EventArgs e)
        {
            if (Combo_PersonalInfo_Verifier.SelectedIndex != 0)
            {
                Cursor.Current = Cursors.WaitCursor;

                Label_ErrorMessagePersonalInfo.Text = "";
                Case_Personal_Info case_new = new Case_Personal_Info();
                case_new.fullname  = TextBox_FullName.Text;
                case_new.guardian  = TextBox_Guardian.Text;
                case_new.p_address = TextBox_pAddress.Text;
                case_new.c_address = TextBox_cAddress.Text;
                case_new.age       = TextBox_Age.Text;
                case_new.contact   = TextBox_ContactNumber.Text;
                case_new.aadhaar   = TextBox_Aadhaar.Text;


                //SMS Checkboxes below
                case_new.SMSCheckBox = CheckBox_SendSMS.Checked;

                case_new.verifier           = Combo_PersonalInfo_Verifier.SelectedValue.ToString();
                case_new.secondary_verifier = Combo_SecondaryVerifier.SelectedValue.ToString();

                MemoryStream stream = new MemoryStream();

                Image img = ImageController.ReduceImg(PictureBox_Photo.Image, 5);
                img.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
                case_new.picture = stream.ToArray();
                stream.Flush();
                case_Control c_con = new case_Control();

                if (c_con.checkForEmpty(case_new))
                {
                    if (c_con.validateForChars(case_new))
                    {
                        if (c_con.InsertPersonalInf(case_new))
                        {
                            if (c_con.smsChecked(case_new))
                            {
                                NotifySMS sms = new NotifySMS();

                                if (sms.loginSMS())
                                {
                                    //long contact = ((KeyValuePair<long, string>)Combo_PersonalInfo_Verifier.SelectedItem).Key;
                                    if (sms.notifyViaSMS(case_new))
                                    {
                                        MessageBox.Show("SMS Notification has been Sent Successfully", "SMS Sent", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                                    }
                                    else
                                    {
                                        MessageBox.Show("The SMS Notification was not Sent. Make sure you are connected to the internet.", "SMS not Sent", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                                    }
                                }
                                else
                                {
                                    MessageBox.Show("The SMS Login Failed.", "Message Not Sent", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                                }
                            }

                            clearPersonalInfo();

                            MessageBox.Show("Registration Success. Switch tabs to fill more details.", "Successfully Registered", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                            loadCases(ComboSelectCase);
                            loadCases(combo_bank);
                            loadCases(comboBox_otherDetails);
                            loadCases(NeedTab_ComboBoxCases);
                            loadCases(ComboBox_RemarksTab);

                            //viewAll.loadGrid_Cases();
                        }
                        else
                        {
                            Label_ErrorMessagePersonalInfo.Text = case_new.message;
                        }
                    }
                    else
                    {
                        Label_ErrorMessagePersonalInfo.Text = case_new.message;
                    }
                }
                else
                {
                    Label_ErrorMessagePersonalInfo.Text = case_new.message;
                }
            }
            else
            {
                MessageBox.Show("Please Choose a Verifier for this Case", "Verifier Not Selected", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }