Exemplo n.º 1
0
        private void ViewSearchedLocal()
        {
            int SelectedIndex___ = dataGridView1.CurrentCell.RowIndex;

            try
            {
                this.picbxLocal.Image = global::NumberDumber.Properties.Resources.defpic;
            }
            catch { }
            if (SelectedIndex___ < 0)
            {
                return;
            }
            if (this.lstbxLocal.SelectedIndex >= this.Dumbeds.Count)
            {
                return;
            }

            DumbedNumber d = this.SearchList[SelectedIndex___];

            chkbx_name_loadOnline.Visible = d.Has_Image();
            this.rtbxLocal.Text           = d.ToString(Environment.NewLine + Environment.NewLine + "-");
            string img_path = Application.StartupPath + "\\imgs\\" + d.CountryAbb.Trim() + "_" + d.number.Trim() + ".jpg";

            try
            {
                chkbx_name_loadOnline.Visible = false;
                if (File.Exists(img_path))
                {
                    this.picbxLocal.Image = Image.FromFile(img_path);
                }
                else if (chkbx_name_loadOnline.Checked)
                {
                    this.picbxLocal.Load(d.ImageLink);
                    this.picbxLocal.Image.Save(img_path);
                }
                else
                {
                    chkbx_name_loadOnline.Visible = true;
                }
            }
            catch
            {
            }
            gpx_Local_view.Visible = true;
        }
Exemplo n.º 2
0
        internal static void AddNew(DumbedNumber dn)
        {
            try
            {

                if (dataBasemanager.NumberExisted(dn.number) || dn==null)
                    return;
            }
            catch { }
            try
            {
                string d = "";
                if (File.Exists(settings.GetDbPath()))
                    d += File.ReadAllText(settings.GetDbPath());

                d += (Environment.NewLine + dn.ToString("     "));
                File.WriteAllText(settings.GetDbPath(), d);
            }
            catch { }
        }
Exemplo n.º 3
0
        internal static void AddNew(DumbedNumber dn)
        {
            try
            {
                if (dataBasemanager.NumberExisted(dn.number) || dn == null)
                {
                    return;
                }
            }
            catch { }
            try
            {
                string d = "";
                if (File.Exists(settings.GetDbPath()))
                {
                    d += File.ReadAllText(settings.GetDbPath());
                }

                d += (Environment.NewLine + dn.ToString("     "));
                File.WriteAllText(settings.GetDbPath(), d);
            }
            catch { }
        }
Exemplo n.º 4
0
        private void Check_Click(object sender, EventArgs e)
        {
            gpxInfo.Visible = false;
            try
            {
                try
                {
                    this.PICBXnumber.Image = global::NumberDumber.Properties.Resources.defpic;
                }
                catch { }

                /*//////*/
                lblNumberError.Visible = false;
                /*//////*/
                DumbedNumber d = new DumbedNumber();
                d.number = txbxNumber.Text.IntOnly();
                d.CountryAbb = DumbedNumber.Abb(cmbx_Check_countryAbb.SelectedIndex);
                d.TrueCallerInfo();
                /*//////*/
                rtxbxInfo_Of_number.Text = d.ToString(Environment.NewLine + Environment.NewLine + "-");
               if(d.ErrorType==NumberError.SessionError)
                rtxbxInfo_Of_number.Text += "\r\nPlease restart the session \r\n add cookie \r\n or \r\n log out and log in again ";

                gpxInfo.Text = d.name + "`s Info";
                gpxInfo.Visible = true;
                PICBXnumber.Image = DefaultImage();
                if (d.isValid() && onList(d)==false)
                    this.Dumbeds.Add(d);
                /*//////*/
                string ip = Application.StartupPath + "\\imgs\\" + d.CountryAbb.Trim() + "_" + d.number.Trim() + ".jpg";
                if (d.Has_Image())
                {
                    try
                    {
                        if (File.Exists(ip))
                            this.PICBXnumber.Image = Image.FromFile(ip);
                        else if (chkbx_name_loadOnline.Checked)
                        {
                            this.PICBXnumber.Load(d.ImageLink);
                            this.PICBXnumber.Image.Save(ip);
                        }

                    }
                    catch
                    {

                    }

                }
                /*//////*/
                dataBasemanager.AddNew(d);

                lblNumberError.Visible = d.HasError;
                lnkLblPlzSignIn.Visible = (d.ErrorType == NumberError.SessionError);

                gpxInfo.Visible=true;
            }
            catch {   }
        }
Exemplo n.º 5
0
        private void Check_Click(object sender, EventArgs e)
        {
            gpxInfo.Visible = false;
            try
            {
                try
                {
                    this.PICBXnumber.Image = global::NumberDumber.Properties.Resources.defpic;
                }
                catch { }

                /*//////*/
                lblNumberError.Visible = false;
                /*//////*/
                DumbedNumber d = new DumbedNumber();
                d.number     = txbxNumber.Text.IntOnly();
                d.CountryAbb = DumbedNumber.Abb(cmbx_Check_countryAbb.SelectedIndex);
                d.TrueCallerInfo();
                /*//////*/
                rtxbxInfo_Of_number.Text = d.ToString(Environment.NewLine + Environment.NewLine + "-");
                if (d.ErrorType == NumberError.SessionError)
                {
                    rtxbxInfo_Of_number.Text += "\r\nPlease restart the session \r\n add cookie \r\n or \r\n log out and log in again ";
                }

                gpxInfo.Text      = d.name + "`s Info";
                gpxInfo.Visible   = true;
                PICBXnumber.Image = DefaultImage();
                if (d.isValid() && onList(d) == false)
                {
                    this.Dumbeds.Add(d);
                }
                /*//////*/
                string ip = Application.StartupPath + "\\imgs\\" + d.CountryAbb.Trim() + "_" + d.number.Trim() + ".jpg";
                if (d.Has_Image())
                {
                    try
                    {
                        if (File.Exists(ip))
                        {
                            this.PICBXnumber.Image = Image.FromFile(ip);
                        }
                        else if (chkbx_name_loadOnline.Checked)
                        {
                            this.PICBXnumber.Load(d.ImageLink);
                            this.PICBXnumber.Image.Save(ip);
                        }
                    }
                    catch
                    {
                    }
                }
                /*//////*/
                dataBasemanager.AddNew(d);

                lblNumberError.Visible  = d.HasError;
                lnkLblPlzSignIn.Visible = (d.ErrorType == NumberError.SessionError);

                gpxInfo.Visible = true;
            }
            catch {   }
        }