예제 #1
0
        private void ArticleClick(object sender, EventArgs e)
        {
            foreach (LinkLabel lab in arts)
            {
                if (sender.Equals(lab))
                {
                    List <String> ArticleInfo = SQLClass.Select(
                        "SELECT Header, Author, Category, Text, Picture FROM " + Tables.ARTICLES +
                        " WHERE header = '" + lab.Text + "'");

                    for (int artIndex = 0; artIndex < ArticleInfo.Count; artIndex += 5)
                    {
                        statiya stat = new statiya();
                        stat.name_statiya      = ArticleInfo[artIndex].ToString();
                        stat.name_author       = ArticleInfo[artIndex + 1].ToString();
                        stat.kategorita_statii = ArticleInfo[artIndex + 2].ToString();
                        stat.text_statii       = ArticleInfo[artIndex + 3].ToString();

                        //FIXME!!! Show ternarny operator
                        stat.picture = (ArticleInfo[artIndex + 4].ToString() != "") ?
                                       ArticleInfo[artIndex + 4].ToString() :
                                       null;

                        StatiyaForm OknoStatiya = new StatiyaForm(stat, true);
                        OknoStatiya.ShowDialog();
                    }
                }
            }
        }
        public static void Label3_Click(object sender, EventArgs e)
        {
            statiya     stat = statiya.Click1(((Label)sender).Text);
            StatiyaForm form = new StatiyaForm(stat);

            form.ShowDialog();
        }
예제 #3
0
        public StatiyaForm(statiya stat, bool YaAvtor = false)
        {
            InitializeComponent();

            avtor = YaAvtor;

            Kategoriatext.Enabled = avtor;
            Stattext.Enabled      = avtor;

            Maintext.Text      = stat.name_statiya;
            Kategoriatext.Text = stat.kategorita_statii;
            Stattext.Text      = stat.text_statii;

            Kategoriatext.Font = Configs.ZAGOLOVOK_FONT;

            Authortext.Font = Configs.ZAGOLOVOK_FONT;

            GetStata(labelLike, labeldis, Maintext.Text);

            try
            {
                pictureBox1.LoadAsync(stat.picture);
            }
            catch (Exception)
            {
                pictureBox1.Image = new Bitmap("defolt_statiy.jpg");
            }
            Authortext.Text = stat.name_author;

            pictureBoxLike.Image    = Properties.Resources.like;
            pictureBoxDislike.Image = Properties.Resources.Dislike;
        }
예제 #4
0
        private void label1_MouseEnter(object sender, EventArgs e)
        {
            statiya stat = statiya.Click1(((Label)sender).Text);

            pictureBox1.Visible = true;
            pictureBox1.Load(stat.picture);
            pictureBox1.Size = new Size(100, 100);
        }
예제 #5
0
        public VipStatiy(statiya stat)
        {
            InitializeComponent();

            name.Text      = stat.name_statiya;
            kategoriy.Text = stat.kategorita_statii;
            s           = stat.text_statii;
            label2.Text = stat.name_author;
        }
예제 #6
0
        void Label_Click(object sender, EventArgs e)
        {
            /* foreach (newPage Label_ in ListOfPages)
             * {*/

            statiya     stat = statiya.Click1(((Label)sender).Text);
            StatiyaForm form = new StatiyaForm(stat);

            form.ShowDialog();

            // }
        }
예제 #7
0
        private static void label1_MouseEnter(object sender, EventArgs e)
        {
            pictureBox1.Location = new Point(((Label)sender).Location.X + 120, ((Label)sender).Location.Y);
            statiya stat = statiya.Click1(((Label)sender).Text);

            if (!String.IsNullOrEmpty(stat.picture) && stat.picture != null)
            {
                pictureBox1.Visible       = true;
                pictureBox1.ImageLocation = stat.picture;
                pictureBox1.Load();
                pictureBox1.Size = new Size(90, 70);
            }
        }
예제 #8
0
 private void ArticleClick(object sender, EventArgs e)
 {
     foreach (LinkLabel lab in arts)
     {
         if (sender.Equals(lab))
         {
             statiya     stat        = statiya.Click1(((Label)sender).Text);
             StatiyaForm OknoStatiya = new StatiyaForm(stat);
             OknoStatiya.ShowDialog();
             Form1_Load(sender, e);
             break;
         }
     }
 }
예제 #9
0
 private void clik_na_pic(object sender, EventArgs e)
 {
     foreach (PictureBox lab in piccc)
     {
         if (sender.Equals(lab))
         {
             statiya stat = statiya.Click1(lab.Tag.ToString());
             //StatiyaForm OknoStatiya = new StatiyaForm(stat);
             VipStatiy OknoStatiya = new VipStatiy(stat);
             OknoStatiya.ShowDialog();
             Form1_Load(sender, e);
             break;
         }
     }
 }
예제 #10
0
        public static statiya Click1(String Text)
        {
            MySqlCommand    cmd = new MySqlCommand("SELECT Header, Author, Category, Text, Picture FROM " + Tables.ARTICLES + " WHERE `Header` = '" + Text + "'", SQLClass.CONN);
            MySqlDataReader rdr = cmd.ExecuteReader();

            rdr.Read();
            statiya stat = new statiya();

            stat.name_statiya      = rdr[0].ToString();
            stat.name_author       = rdr[1].ToString();
            stat.kategorita_statii = rdr[2].ToString();
            stat.text_statii       = rdr[3].ToString();
            if (rdr[4].ToString() != "")
            {
                stat.picture = rdr[4].ToString();
            }
            else
            {
                stat.picture = null;
            }
            rdr.Close();

            return(stat);
        }