Example #1
0
        private void menuItemEslestirmeBaslat_Click(object sender, EventArgs e)
        {
            try
            {
                #region Validasyon
                if (dal.f_GetNotSyncDataretrieveCount() == 0)
                {
                    MessageBox.Show("Eşleştirilecek veriniz bulunmamaktadır. Güncel durumdasınız.", "Eşleştirme Durumu", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (!InternetCS.IsConnectedToInternet())
                {
                    MessageBox.Show("İnternet bağlantısının olduğundan emin olunuz ve tekrar eşleştirme yapınız.", "Eşleştirme Durumu", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }
                #endregion

                bool bSonuc = f_CekGonder();
                if (bSonuc)
                {
                    MessageBox.Show(bSonuc ? "Eşleştirme başarıyla tamamlandı." : "Eşleştirme tamamlanamadı!", "Eşleştirme Durumu", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                //--IS
                ex.LogException("Eşleştirme yapılırken genel istisna fırlatıldı:");
#if DEBUG
                throw (ex);
#endif
            }
        }
Example #2
0
 private void frmMapIt_Load(object sender, EventArgs e)
 {
     if (!InternetCS.IsConnectedToInternet())
     {
         MessageBox.Show("No internet connection");
     }
     else if (this.IsRealTime)
     {
         this.frmMapitMapBtn.Enabled        = true;
         this.frmMapitStreetViewBtn.Enabled = true;
         this.frmMapitTrackBtn.Enabled      = true;
         int count = this.comm.dataGui.Positions.PositionList.Count;
         if (count > 0)
         {
             double latitude  = ((PositionInfo.PositionStruct) this.comm.dataGui.Positions.PositionList[count - 1]).Latitude;
             double longitude = ((PositionInfo.PositionStruct) this.comm.dataGui.Positions.PositionList[count - 1]).Longitude;
             if ((Math.Abs(latitude) > 0.05) && (Math.Abs(longitude) > 0.05))
             {
                 this.mapIt(latitude.ToString(), longitude.ToString());
             }
         }
     }
     else
     {
         this.frmMapitMapBtn.Enabled        = false;
         this.frmMapitStreetViewBtn.Enabled = false;
         this.frmMapitTrackBtn.Enabled      = false;
         this.plotTrack();
     }
 }
Example #3
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (InternetCS.IsConnectedToInternet() == true || InternetCS.Check_Connect_Internet() == true)
            {
                if (textBox1_sender.Text != "" & dataGridView1.RowCount > 0)
                {
                    Form_Email_send_Final f_e_d_f = new Form_Email_send_Final(this);
                    f_e_d_f.ShowDialog();
                }

                else if (textBox1_sender.Text == "")
                {
                    MessageBox.Show("تنضیمات ارسال پیام را انجام نشده است ");
                }

                if (dataGridView1.RowCount == 0)
                {
                    MessageBox.Show("هیچ انتخابی برای دریافت پیام صورت نگرفته است");
                }
            }

            else if (InternetCS.IsConnectedToInternet() == false)
            {
                MessageBox.Show("اتصال به اینترنت برقرار نیست");
            }
        }
        void timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            if (!InternetCS.IsConnectedToInternet())
            {
                return;
            }

            f_CekGonder();
        }
Example #5
0
 private void frmMapitTrackBtn_Click(object sender, EventArgs e)
 {
     if (!InternetCS.IsConnectedToInternet())
     {
         MessageBox.Show("No internet connection !", "Info:", MessageBoxButtons.OK);
     }
     else
     {
         this.plotTrack();
     }
 }
Example #6
0
 private void frmMapitStreetViewBtn_Click(object sender, EventArgs e)
 {
     if (!InternetCS.IsConnectedToInternet())
     {
         MessageBox.Show("No internet connection !", "Info:", MessageBoxButtons.OK);
     }
     else
     {
         int count = this.comm.dataGui.Positions.PositionList.Count;
         if (count > 1)
         {
             double latitude       = ((PositionInfo.PositionStruct) this.comm.dataGui.Positions.PositionList[count - 1]).Latitude;
             double longitude      = ((PositionInfo.PositionStruct) this.comm.dataGui.Positions.PositionList[count - 1]).Longitude;
             double headingDegrees = this.comm.dataGui.HeadingDegrees;
             double num5           = this.comm.dataGui.PitchDegrees * -1.0;
             string path           = ConfigurationManager.AppSettings["InstalledDirectory"] + @"\html\pov.html";
             string newValue       = string.Format("myLOC = new GLatLng({0:F7},{1:F7})", latitude, longitude);
             string str3           = "myPOV = {" + string.Format("yaw:{0:F7},pitch:{1:F7}", headingDegrees, num5) + "}";
             string str4           = string.Empty;
             try
             {
                 StringBuilder builder = new StringBuilder();
                 StreamReader  reader  = File.OpenText(path);
                 builder.Append(reader.ReadToEnd());
                 reader.Close();
                 string input    = builder.ToString();
                 Regex  regex    = new Regex(@"myLOC = new GLatLng\([+-]*[0-9]+.[0-9]+,[+-]*[0-9]+.[0-9]+\)");
                 string oldValue = regex.Match(input).ToString();
                 str4     = input.Replace(oldValue, newValue);
                 regex    = new Regex(@"myPOV = \{yaw:[+-]*[0-9]+.[0-9]+,pitch:[+-]*[0-9]+.[0-9]+\}");
                 oldValue = regex.Match(input).ToString();
                 str4     = str4.Replace(oldValue, str3);
                 StreamWriter writer = new StreamWriter(path);
                 writer.Write(str4);
                 writer.Close();
             }
             catch (Exception exception)
             {
                 MessageBox.Show(exception.Message.ToString(), "Error");
             }
             try
             {
                 StringBuilder builder2 = new StringBuilder();
                 builder2.Append(path);
                 this.webBrowser1.Navigate(builder2.ToString());
             }
             catch (Exception exception2)
             {
                 MessageBox.Show(exception2.Message.ToString(), "Error");
             }
         }
     }
 }
Example #7
0
 private void button_MapIt_Click(object sender, EventArgs e)
 {
     if (!InternetCS.IsConnectedToInternet())
     {
         MessageBox.Show("No internet connection!", "Info", MessageBoxButtons.OK);
     }
     else if (this.comm.dataGui.Positions.PositionList.Count >= 1)
     {
         if (MessageBox.Show("\"Location data\" is about to be sent to Google Maps... Proceed?", "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             this._SiRFMap = this.CreateGoogleMapWindow();
         }
     }
 }
Example #8
0
 private void frmMapitMapBtn_Click(object sender, EventArgs e)
 {
     if (!InternetCS.IsConnectedToInternet())
     {
         MessageBox.Show("No internet connection !", "Info:", MessageBoxButtons.OK);
     }
     else
     {
         int count = this.comm.dataGui.Positions.PositionList.Count;
         if (count > 0)
         {
             double latitude  = ((PositionInfo.PositionStruct) this.comm.dataGui.Positions.PositionList[count - 1]).Latitude;
             double longitude = ((PositionInfo.PositionStruct) this.comm.dataGui.Positions.PositionList[count - 1]).Longitude;
             if ((Math.Abs(latitude) > 0.05) && (Math.Abs(longitude) > 0.05))
             {
                 this.mapIt(latitude.ToString(), longitude.ToString());
             }
         }
     }
 }
Example #9
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                for (int i = 0; (i <= l1.Items.Count - 1); i++)
                {
                    if ((backgroundWorker1.CancellationPending == true))
                    {
                        e.Cancel = true;
                        break;
                    }
                    else
                    {
                        MailMessage mail        = new MailMessage();
                        MailAddress mailAddress = new MailAddress(Class1.AddressSender);
                        mail.To.Add(l1.Items[i].ToString());
                        mail.From = mailAddress;

                        mail.Subject = f_e_d_m.textBox2_subject.Text;
                        mail.Body    = f_e_d_m.textBox4_MsgTxT.Text;

                        string sendEmailsFrom         = Class1.user;
                        string sendEmailsFromPassword = Class1.password;
                        // string sendEmailsFrom = "*****@*****.**";
                        //   string sendEmailsFromPassword = "******";
                        NetworkCredential credentials = new NetworkCredential(sendEmailsFrom, sendEmailsFromPassword);


                        SmtpClient mailClient = new SmtpClient(Class1.SmtpMaileServer, int.Parse(Class1.Port));
                        mailClient.Credentials    = credentials;
                        mailClient.EnableSsl      = Class1.True_False_SSL;
                        mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;


                        if (f_e_d_m.textBox3_attach.Text != "")
                        {
                            mail.Attachments.Add(new Attachment(@f_e_d_m.textBox3_attach.Text));
                        }


                        mailClient.Send(mail);

                        cldbSql.CallDB("insert into send_email(فرستنده,گیرنده,موضوع,تاریخ_ارسال,فایل_پیوست,متن_پیام,us,کد_عضویت)values( '" + Class1.AddressSender + "', '" + l1.Items[i].ToString() + "' ,'" + f_e_d_m.textBox2_subject.Text + "','" + f_e_d_m.textBox5_Tarikh.Text + "' , '" + f_e_d_m.textBox3_attach.Text + "' , '" + f_e_d_m.textBox4_MsgTxT.Text + "'  ,'" + m1.label11.Text + "' ,  '" + int.Parse(l4.Items[i].ToString()) + "' )");

                        l3.Items.Insert(i, i);
                        Tedade_Ersal_Shodeha = i + 1;
                        label5.Text          = Tedade_Ersal_Shodeha.ToString();

                        listBox1.Items.Insert(i, "  ارسال پیام انجام شد --->" + l2.Items[i].ToString());

                        // MessageBox.Show(SmtpDeliveryMethod.Network.ToString());

                        System.Threading.Thread.Sleep(500);
                        backgroundWorker1.ReportProgress((i));
                    }
                }

                MessageBox.Show("عملیات ارسال پیام با موفقیت به پایان رسید");
            }

            catch (Exception ex) {
                if (InternetCS.IsConnectedToInternet() == true || InternetCS.Check_Connect_Internet() == true)
                {
                    MessageBox.Show(" اتصال به اینترنت برقرار نیست  یا  اتصال به اینترنت ضعیف است");
                }

                MessageBox.Show(ex.Message.ToString());

                MessageBox.Show("عملیات ارسال پیام با خطا مواجعه شد");
            }
        }