none
Programování ve Forms/Console RRS feed

  • Question

  • Dobrý den, chtěl bych poprosit s jménem všech maturantům, zda by jste tuto diskusi nemazali, protože se v ní na nic neptám. Jedná se o to že do konce května maturujeme a můžeme používat microsoft.com, tak si sem dáváme "tahák". Byli bychom moc rádi za shovívavost a pochopení. Předem děkujeme.

    CONSOLE

    static void Main(string[] args)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("---------------------------------------------");
                Console.WriteLine("-             Počítačové hry                -");
                Console.WriteLine("---------------------------------------------");
                Console.WriteLine();
                Console.WriteLine("Pro vstup stiskněte ENTER.");
                Console.ForegroundColor = ConsoleColor.Gray;
                Console.ReadLine();

                string constr = "server=lsd.spsejecna.net;database=slabyo;user id=slabyo;pwd=maxik1597";
                conn = new SqlConnection(constr);
                conn.Open();

                char key = '0';

                do
                {
                    Console.Clear();

                    WriteTable("THra");

                    Console.Write("Možné akce:\nn - nový záznam\nv - vymazat záznam\nu - upravit záznam\nq - ukončit aplikaci\nVáš výběr: ");
                    Console.ForegroundColor = ConsoleColor.Gray;
                    key = Console.ReadKey().KeyChar;

                    Action(key);
                } while (key != 'q');

                conn.Close();

                //Console.Read();
            }

     static void WriteTable(string tablename)
            {
                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("---------------Tabulka "+tablename+"---------------\n");
                Console.ForegroundColor = ConsoleColor.Gray;

                string select = "SELECT * FROM " + tablename + ";";
                comm = new SqlCommand(select, conn);
                reader = comm.ExecuteReader();

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        for (int i = 0; i < reader.FieldCount; i++)//FieldCount -> počet sloupečků
                        {
                            Console.ForegroundColor = ConsoleColor.White;
                            Console.Write(ColumnNameToLabel(reader.GetName(i)) + ": ");
                            Console.ForegroundColor = ConsoleColor.DarkGray;
                            Console.WriteLine(reader.GetValue(i).ToString() + "\t");
                            Console.ForegroundColor = ConsoleColor.Gray;
                        }

                        Console.WriteLine();
                    }
                }

                reader.Close();



                Console.ForegroundColor = ConsoleColor.DarkYellow;
                Console.WriteLine("------------Konec Tabulky " + tablename + "-------------");
                Console.ForegroundColor = ConsoleColor.Green;
            }

     static void ModifyRow()
            {
                Console.WriteLine();
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.Write("Zadejte ID hry k úpravě: ");
                Console.ForegroundColor = ConsoleColor.Gray;
                string id = Console.ReadLine();

                Console.Clear();


                string cmd = "SELECT * FROM THra WHERE id_hra = " + id + ";";
                comm = new SqlCommand(cmd, conn);
                reader = comm.ExecuteReader();

                reader.Read();

                for (int i = 0; i < reader.FieldCount; i++)
                {
                    Console.ForegroundColor = ConsoleColor.White;
                    Console.Write(ColumnNameToLabel(reader.GetName(i)) + ": ");
                    Console.ForegroundColor = ConsoleColor.DarkGray;
                    Console.WriteLine(reader.GetValue(i).ToString() + "\t");
                    Console.ForegroundColor = ConsoleColor.Cyan;
                }

                object[] vals = new object[reader.FieldCount];//Připraví pole pro existujíci hodnoty

                reader.GetValues(vals);
                reader.Close();

                Console.WriteLine();

                Console.WriteLine("Všechny nevyplněné hodnoty zůstanou nezměněny.");


                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.Write("Zadejte název hry: ");
                Console.ForegroundColor = ConsoleColor.Gray;
                string nazev = GetInput<string>(true, (x) => x.Length <= 25); 
                nazev = nazev == "" ? vals[1].ToString() : nazev;
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.Write("Zadejte popis hry: ");
                Console.ForegroundColor = ConsoleColor.Gray;
                string popis = GetInput<string>(true, (x) => true); 
                popis = popis == "" ? vals[2].ToString() : popis;
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.Write("Zadejte datum vydání hry (formát mm-dd-rrrr) hry: ");
                Console.ForegroundColor = ConsoleColor.Gray;
                string dat_vyd = GetInput<string>(true, (x) => x.Length == 10); 
                dat_vyd = dat_vyd == "" ? vals[3].ToString() : dat_vyd;
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.Write("Zadejte doporučený věk hry: ");
                Console.ForegroundColor = ConsoleColor.Gray;
                string doporuc_vek = GetInput<int>(true, (x) => x <= 18 && x > 0); 
                doporuc_vek = doporuc_vek == "" ? vals[4].ToString() : doporuc_vek;

                WriteTable("TVyvojar");

                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.Write("Zadejte ID vývojáře hry: ");
                Console.ForegroundColor = ConsoleColor.Gray;
                string id_vyvoj = GetInput<int>(true, (x) => x > 0); 
                id_vyvoj = id_vyvoj == "" ? vals[5].ToString() : id_vyvoj;
                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.Write("Zadejte webové stránky hry: ");
                Console.ForegroundColor = ConsoleColor.Gray;
                string web = GetInput<string>(true, (x) => x.Length <= 20); 
                web = web == "" ? vals[6].ToString() : web;

                WriteTable("TEngine");

                Console.ForegroundColor = ConsoleColor.Cyan;
                Console.Write("Zadejte ID enginu hry: ");
                Console.ForegroundColor = ConsoleColor.Gray;
                string id_eng = GetInput<int>(true, (x) => x > 0); 
                id_eng = id_eng == "" ? vals[7].ToString() : id_eng;

                cmd = String.Format("UPDATE THra SET nazev='{0}', popis='{1}', dat_vyd='{2}', id_eng={3}, id_vyvoj={4}, web='{5}', doporuc_vek={6} WHERE id_hra={7};", nazev, popis, dat_vyd, id_eng, id_vyvoj, web, doporuc_vek, id);

                comm = new SqlCommand(cmd, conn);
                comm.ExecuteNonQuery();
            }

     static string GetInput<T>(bool allowempty, Func<T, bool> func)
            {
                MethodInfo parseMethod = null;
                
                if (typeof(T) != typeof(string))//Když to není string
                {
                    parseMethod = typeof(T).GetMethod("Parse", new Type[] {typeof(string)});
                }
                
                
                bool first = true;
                string output = "";
                T testing;//typ

                do
                {
                    if(!first)
                    {
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.Write("Neplatná hodnota! Zadejte znovu: ");
                        Console.ForegroundColor = ConsoleColor.Gray;
                    }
                    first = false;

                    output = Console.ReadLine();

                    if (output == "" && allowempty) break;
                    else if (output == "" && !allowempty) continue;

                    if (typeof(T) != typeof(string))
                    {
                        testing = (T)parseMethod.Invoke(null, new object[] { output });//ostani
                    }
                    else
                    {
                        testing = (T)(object)output;//string
                    }

                    if (func(testing)) break;

                } while(true);

                return output;
            }
    FORM-METODY


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Data;
    using System.Windows.Forms;
    using System.Text.RegularExpressions;//Onlzstring
    //using System.Data.SqlClient;

    namespace WindowsFormsApplication1
    {
        class MaskMetody
        {
            public static bool OnlyInt(string text)
            {
                int x;
                return int.TryParse(text, out x);
               /* bool pass = true;
                for (int i = 0; i < text.Length; i++)
                {
                    pass = pass && text[i] >= '0' && text[i] <= '9';
                }
                return pass;*/
            }
            public static bool OnlyString(string text)
            {
                return new Regex("^([A-ZĚŠČŘŽÝÁÍÉÚŮÓŤĎ]{1})([a-zěščřžýáíéůúťďó]*)").Match(text).Value == text;
                /*bool pass = true;
                for (int i = 0; i < text.Length; i++)
                {
                    if (i == 0)
                    {
                        pass = pass && ((text[i] >= 'A' && text[i] <= 'Z') || text[i] == 'Ř' || text[i] == 'Š' || text[i] == 'Č' || text[i] == 'Ž' || text[i] == 'Á' || text[i] == 'Í' || text[i] == 'É' || text[i] == 'Ď' || text[i] == 'Ť' || text[i] == 'Ň' || text[i] == 'Ú');
                    }
                    else
                    {
                        pass = pass && (text[i] >= 'a' && text[i] <= 'z' || text[i] >= 'á' && text[i] <= 'ž');
                    }
                }
                return pass;*/
            }
            public static bool OnlyStringCheck(string text) //Velká písmena
            {
                return new Regex("([A-ZĚŠČŘŽÝÁÍÉÚŮÓŤĎ]*)").Match(text).Value == text;
                /*bool pass = true;
                for (int i = 0; i < text.Length; i++)
                {
                    if (i == 0)
                    {
                        pass = pass && ((text[i] >= 'A' && text[i] <= 'Z') || text[i] == 'Ř' || text[i] == 'Š' || text[i] == 'Č' || text[i] == 'Ž' || text[i] == 'Á' || text[i] == 'Í' || text[i] == 'É' || text[i] == 'Ď' || text[i] == 'Ť' || text[i] == 'Ň' || text[i] == 'Ú');
                    }
                    else
                    {
                        pass = pass && (text[i] >= 'a' && text[i] <= 'z' || text[i] >= 'á' && text[i] <= 'ž');
                    }
                }
                return pass;*/
            }
            public static bool OnlyMesta(string text)
            {

                return new Regex("^([A-ZĚŠČŘŽÝÁÍÉÚŮÓŤĎ]{1})([a-zěščřžýáíéůúťďó0-9]*)").Match(text).Value == text;
                /*bool pass = true;
                for (int i = 0; i < text.Length; i++)
                {
                    if (i == 0)
                    {
                        pass = pass && ((text[i] >= 'A' && text[i] <= 'Z') || text[i] == 'Ř' || text[i] == 'Š' || text[i] == 'Č' || text[i] == 'Ž' || text[i] == 'Á' || text[i] == 'Í' || text[i] == 'É' || text[i] == 'Ď' || text[i] == 'Ť' || text[i] == 'Ň' || text[i] == 'Ú');
                    }
                    else
                    {
                        pass = pass && (text[i] >= 'a' && text[i] <= 'z' || text[i] >= 'á' && text[i] <= 'ž' || text[i] >= '0' && text[i] <= '9');
                    }
                }
                return pass;*/
            }
            public static string zk(string text) //Peníze
            {
                int pos = text.Length;
                for (int i = 0; i < text.Length; i++)
                {
                    if (text[i] == ',')
                    {
                        pos = i;
                        break;
                    }
                }
                string str = "";

                for (int i = 0; i < pos; i++)
                {
                    str += text[i];
                }

                return str;
            }

            public static bool existencVaz(DataGridView grid1, DataGridView grid2, DataGridView grid3)
            {
                bool zk = false;
                int a = (int)grid2.SelectedRows[0].Cells[0].Value;
                int b = (int)grid3.SelectedRows[0].Cells[0].Value;

                for (int i = 0; i < grid1.RowCount; i++)
                {
                    if ((int)grid1.Rows[i].Cells[3].Value == a)
                    {
                        if ((int)grid1.Rows[i].Cells[2].Value == b)
                        {
                            MessageBox.Show("Vazba už existuje v tabulce.");
                            zk = false;
                            break;
                        }
                        else
                        {
                            zk = true;
                            continue;
                        }
                    }
                    else
                    {
                        zk = true;
                        continue;
                    }
                }
                return zk;
            }
            public static bool existencRod(string text, DataGridView grid1)
            {
                bool zk = false;
                string c;

                //(c.CompareTo(a) == 0 ? true : false)
                //int aa = Convert.ToInt32(a);MessageBox.Show("Záznam(Pacinet/Lékař) už existuje v tabulce.");
                for (int i = 0; i < grid1.RowCount; i++)
                {
                    c = grid1.Rows[i].Cells[4].Value.ToString();
                    if (c.CompareTo(text) == 0 ? true : false/*text == c*/)
                    {
                        MessageBox.Show("Rodné číslo existuje v tabulce.");
                        zk = false;
                        break;
                    }
                    else
                    {
                       // MessageBox.Show("Rodné číslo existuje v tabulce.");
                        zk = true;
                        continue;
                    } 
                }
                return zk;
            }        
            public static bool existenceCisla(string a, DataGridView grid1)
            {
                bool zk = false;
                int b = Convert.ToInt32(a);
                for (int i = 0; i < grid1.RowCount; i++)
                {
                    if (b == (int)grid1.Rows[i].Cells[1].Value)
                    {
                        MessageBox.Show("Číslo už existuje.");
                        zk = false;
                        break;
                    }
                    else
                    {
                        zk = true;
                        continue;
                    }
                }
                return zk;
            }
            public static bool UpdateexistenceCisla(string a,string text, string text2, DataGridView grid1)
            {
                bool zk = false;
                int b = Convert.ToInt32(a);
                for (int i = 0; i < grid1.RowCount; i++)
                {
                    if (b == (int)grid1.Rows[i].Cells[1].Value && (text != grid1.Rows[i].Cells[2].Value.ToString() || text2 != grid1.Rows[i].Cells[3].Value.ToString()))
                    {
                        MessageBox.Show("Číslo už existuje.");
                        zk = false;
                        break;
                    }
                    else
                    {
                        zk = true;
                        continue;
                    }
                }
                return zk;
            }

            public static bool UpdateLekarCislo(string text, string text2,string text3, string text4,DataGridView grid1)
            {
                bool zk = false;

                for (int i = 0; i < grid1.RowCount; i++)
                {
                    if (text == grid1.Rows[i].Cells[1].Value.ToString() && text2 == grid1.Rows[i].Cells[2].Value.ToString() && text3 == grid1.Rows[i].Cells[3].Value.ToString() /*&& text4 == grid1.Rows[i].Cells[4].Value.ToString()*/)
                    {
                        zk = true;
                        break;
                    }
                    else
                    {
                        if (text == grid1.Rows[i].Cells[1].Value.ToString() && text2 != grid1.Rows[i].Cells[2].Value.ToString() && text3 != grid1.Rows[i].Cells[3].Value.ToString() /*text4 != grid1.Rows[i].Cells[4].Value.ToString()*/)
                        {
                            MessageBox.Show("Číslo lekaře jíž existuje.");
                            zk = false;
                            continue;
                        }
                    }//zk = true;
                }
                
                return zk;
            }
            public static bool UpdateLekarRod(string text, string text2, string text3, string text4, DataGridView grid1)
            {
                bool zk = false;

                for (int i = 0; i < grid1.RowCount; i++)
                {
                    if (/*text == grid1.Rows[i].Cells[1].Value.ToString() &&*/ text2 == grid1.Rows[i].Cells[2].Value.ToString() && text3 == grid1.Rows[i].Cells[3].Value.ToString() && text4 == grid1.Rows[i].Cells[4].Value.ToString())
                    {
                        zk = true;
                        break;
                    }
                    else
                    {
                        if (/*text != grid1.Rows[i].Cells[1].Value.ToString()*/text2 != grid1.Rows[i].Cells[2].Value.ToString() && text3 != grid1.Rows[i].Cells[3].Value.ToString() && text4 == grid1.Rows[i].Cells[4].Value.ToString())
                        {
                            MessageBox.Show("Rodné číslo jíž existuje.");
                            zk = false;
                            continue;
                        }
                    }
                }
                return zk;
            }
            
            public static bool existenceAtes(string a, DataGridView grid1)
            {
                bool zk = false;
                string b;

                for (int i = 0; i < grid1.RowCount; i++)
                {
                    b = grid1.Rows[i].Cells[1].Value.ToString();
                    if (b.CompareTo(a) == 0 ? true : false)
                    {
                        MessageBox.Show("Atestace jíž existuje v tabulce.");
                        zk = false;
                        break;
                    }
                    else
                    {
                        zk = true;
                        continue;
                    }
                    
                }return zk;
            }
            public static bool UpdateexistenceAtes(string a,string c, DataGridView grid1)
            {
                bool zk = false;
                string b;

                for (int i = 0; i < grid1.RowCount; i++)
                {
                    b = grid1.Rows[i].Cells[1].Value.ToString();
                    if (a == b && c == grid1.Rows[i].Cells[1].Value.ToString())
                    {
                        MessageBox.Show("Atestace jíž existuje v tabulce.");
                        zk = false;
                        break;
                    }
                    else
                    {
                        zk = true;
                        continue;
                    }

                } return zk;
            }
            public static bool existencAtestaceDel(DataGridView grid1, DataGridView grid2)
            {
                bool zk = false;
                int a = (int)grid1.SelectedRows[0].Cells[0].Value;


                for (int i = 0; i < grid2.RowCount; i++)
                {
                    if ((int)grid2.Rows[i].Cells[2].Value == a)
                    {
                        MessageBox.Show("Atestace, kterou chcete smazat je ve vazbě.");
                        zk = false;
                        break;
                    }
                    else
                    {
                        zk = true;
                        continue;
                    }
                }
                return zk;
            }

        }
    }
    FORM - SQL

    public static void LekarPridat(string a, string b, string c, string d, string e, string f, string g, string h, string i, string j, string k, string l, SqlConnection s)
            {
                string com = String.Format("INSERT INTO TLekar(cislo_lek,jmeno_lek,prijmeni_lek,datum_nar_lek,tel_cislo_lek,mob_cislo_lek,email_lek,mesto_lek,ulice_lek,psc_lek,plat_lek,souk_sluzby_lek) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}');"
                    ,a,b,c,d,e,f,g,h,i,j,k,l);
                SqlCommand con = new SqlCommand(com, s);
                con.ExecuteNonQuery();
            }
            public static void LekarUpdate(string a,string b, string c, string d, string e,string f, string g, string h, string i, string j, string k, string l,string m, SqlConnection s)//NAUCIT
            {
                    string com = String.Format("UPDATE TLekar SET cislo_lek = {0}, jmeno_lek = '{1}', prijmeni_lek = '{2}', datum_nar_lek = '{3}', tel_cislo_lek = '{4}', mob_cislo_lek = '{5}', email_lek = '{6}',mesto_lek='{7}', ulice_lek='{8}', psc_lek = '{9}', plat_lek={10}, souk_sluzby_lek = '{11}' WHERE id_lek = {12}", a, b, c, d, e, f,g, h, i, j,k, /*numericUpDown1.Value.ToString()*/l,m);
                    SqlCommand con = new SqlCommand(com, s);

                    con.ExecuteNonQuery();
            }
            public static void LekarDelete(string a, SqlConnection s)
            {
                
               // SqlCommand vaz = new SqlCommand("DELETE FROM TLekarVazAtestace where lek_id = "+a+ ";",s);
                //SqlCommand pac = new SqlCommand("UPDATA TPacient set lek_id=null where lek_id = " + a + ";", s);
                SqlCommand con = new SqlCommand("DELETE FROM TLekar WHERE id_lek = " + a + ";", s);
                //vaz.ExecuteNonQuery();
                //pac.ExecuteNonQuery();
                con.ExecuteNonQuery();
            }
            public static void LekarLoad(DataGridView dataGridView1, SqlConnection s)
            {
                dataGridView1.Columns.Clear();
                dataGridView1.Rows.Clear();

                SqlCommand conn = new SqlCommand("SELECT * from TLekar", s);
                SqlDataReader rdn = conn.ExecuteReader();

                for (int i = 0; i < rdn.FieldCount; i++)
                    dataGridView1.Columns.Add(rdn.GetName(i), ColumnNameToLabel(rdn.GetName(i)));

                object[] vals = new object[rdn.FieldCount];

                while (rdn.Read())
                {
                    rdn.GetValues(vals);
                    dataGridView1.Rows.Add(vals);
                }

                rdn.Close();
            }

      public static string tran(SqlConnection s) //Nepřímá transakce
            {
                SqlCommand com = new SqlCommand("exec mp_ates @vysledek = @vysledek output", s);
                SqlParameter par = com.Parameters.Add("@vysledek", SqlDbType.NVarChar,50);
                par.Direction = ParameterDirection.Output;
                com.ExecuteNonQuery();
                return(string)par.Value;
            }
            public static bool transaction_command(string command, SqlConnection s) //Příma transkace
            {
                SqlTransaction tran = s.BeginTransaction();
                SqlCommand cmd = new SqlCommand(command, s);
                cmd.Transaction = tran;

                try
                {
                    cmd.ExecuteNonQuery();
                    tran.Commit();
                    return true;
                }
                catch (Exception e)
                {
                    Console.WriteLine("//////////////////" + command + "//////////////////");
                    Console.WriteLine(e.ToString());
                    try
                    {
                        tran.Rollback();
                    }
                    catch (Exception f)
                    {
                        Console.WriteLine(f.ToString());
                        return false;
                    }
                    return false;
                }
            }

     public static void Zkouska(DataGridView dataGridView1, SqlConnection s, int a)
            {
                dataGridView1.Columns.Clear();
                dataGridView1.Rows.Clear();

                SqlCommand com = new SqlCommand("SELECT * FROM TLekar inner join TLekarVazAtestace on TLekar.id_lek = TLekarVazAtestace.lek_id Inner join TAtestace on TAtestace.id_ates = TLekarVazAtestace.ates_id WHERE TLekar.id_lek = "+a, s);
                SqlDataReader rdn = com.ExecuteReader();

                for (int i = 0; i < rdn.FieldCount; i++)
                {
                    dataGridView1.Columns.Add(rdn.GetName(i), ColumnNameToLabel(rdn.GetName(i)));
                }

                object[] vals = new object[rdn.FieldCount];

                while (rdn.Read())
                {
                    rdn.GetValues(vals);
                    dataGridView1.Rows.Add(vals);

                }
                rdn.Close();

            }

     static string ColumnNameToLabel(string name)
            {
                switch (name)
                {
                    case "id_lek":
                        return "ID lekare";
                    case "cislo_lek":
                        return "Cislo lékaře";

                    default:
                        return name;
                }
            }

    declare @gynekologu int;

    begin transaction
    set @gynekologu = (SELECT count(*) FROM TAtestace WHERE nazev_ates = 'Gynekologie');
    set @gynekologu += @@ERROR;
    INSERT INTO TAtestace(nazev_ates) VALUES('Gynekologie');

    if @gynekologu <> 0
    begin 
    set @vysledek = 'Transakce se nepovedla';
    rollback;
    end
    else
    begin
    set @vysledek = 'Transakce se povedla';
    commit
    end

    private void dataGridView1_SelectionChanged(object sender, EventArgs e)
            {
                
                if (dataGridView1.SelectedRows.Count == 0) return;

                textBox2.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
                textBox3.Text = dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
                textBox4.Text = dataGridView1.SelectedRows[0].Cells[3].Value.ToString();
                textBox5.Text = dataGridView1.SelectedRows[0].Cells[4].Value.ToString();
                textBox8.Text = dataGridView1.SelectedRows[0].Cells[5].Value.ToString();
                textBox9.Text = dataGridView1.SelectedRows[0].Cells[6].Value.ToString();
                textBox10.Text = dataGridView1.SelectedRows[0].Cells[7].Value.ToString();

                richTextBox1.Text = dataGridView1.SelectedRows[0].Cells[9].Value.ToString();
                richTextBox2.Text = dataGridView1.SelectedRows[0].Cells[10].Value.ToString();

               
                textBox2.BackColor = Color.White;
                textBox3.BackColor = Color.White;
                textBox4.BackColor = Color.White;
                textBox5.BackColor = Color.White;
                textBox8.BackColor = Color.White;
                textBox9.BackColor = Color.White;
                textBox10.BackColor = Color.White;

                dataGridView2.ClearSelection();
                foreach (DataGridViewRow row in dataGridView2.Rows)
                {
                    if ((int)row.Cells[0].Value == (int)dataGridView1.SelectedRows[0].Cells[8].Value)
                        row.Selected = true;
                }

                dataGridView3.ClearSelection();
                foreach (DataGridViewRow row in dataGridView3.Rows)
                {
                    if ((int)row.Cells[0].Value == (int)dataGridView1.SelectedRows[0].Cells[11].Value)
                        row.Selected = true;
                }
            }






     
    Tuesday, May 13, 2014 4:53 AM

All replies

  • Hi Looks like you have posted the question in wrong forum also if you can post the question in english we may be able to point you in right direction 

    This forum is specifically for Project Server application related customizations, if it is not related to project server would suggest posting it to other forums like visual studio forums or so


    Thanks | Sunil Kr Singh | http://epmxperts.wordpress.com

    • Proposed as answer by John - Project Wednesday, May 14, 2014 3:50 PM
    Tuesday, May 13, 2014 2:27 PM
    Moderator
  • epmXperts,

    For reference, this forum is NOT only for Project Server customization, it is for all versions of Project, whether in a server environment or not.

    John

    Tuesday, May 13, 2014 2:58 PM
  • Thanks for pointing out John, but if i look closely at the bread crumb navigation, looks like this thread has been posted under Project Server customization forum and that's why i said so, correct me if i am wrong


    Thanks | Sunil Kr Singh | http://epmxperts.wordpress.com

    Tuesday, May 13, 2014 3:04 PM
    Moderator
  • empXperts,

    Unfortunately the URL indeed says "projectserver" but in fact the forum itself is simply "Project customization and programming". The description is:

    Discuss customizations and programming for Project Web App, Project Server, Project Professional and Project Standard. Includes User Interface (UI) customizations, Project Server Interface (PSI) and Visual Basic for Applications (VBA) Programming.

    As you can see it covers all versions of Project.

    John

    Wednesday, May 14, 2014 1:52 AM
  • Not that this needs to be discussed here or i mean any offense but for my clarification i am asking this, as far as i know, this current thread posted here has been posted to customization forum as we know there are 4 project server forums and its not the URL rather the query string which identifies the forum as below

    http://social.technet.microsoft.com/Forums/projectserver/en-US/home?forum=projectserver2010general

    http://social.technet.microsoft.com/Forums/projectserver/en-US/home?forum=projserv2010setup

    http://social.technet.microsoft.com/Forums/projectserver/en-US/home?forum=projectonline

    http://social.msdn.microsoft.com/Forums/en-US/home?forum=project2010custprog

    and we do understand which forum deals with what type of questions

    Not sure by "covers all versions of Project." what do you mean ?

    I understand that for any versions(2003/2007/2010/2013) or any interface(MPP/PWA/Console/ etc...) related to any customization for project server this would be the intended forum

    Also its been quite few years, since i have been moderating these forums as per my understanding stated above

    let me know if this doesn't sounds right 

    Thanks | Sunil Kr Singh | http://epmxperts.wordpress.com

    Wednesday, May 14, 2014 1:04 PM
    Moderator
  • epmXperts,

    You're right, we've gone a little astray from the original post, which by the way, you were exactly right in that the poster definitely posted to the wrong forum. However, in responding that this forum is "...specifically for Project Server application related customization...", I believe is a misstatement. This forum is for questions related to customization and programming of ALL Project versions (i.e. Server, Pro and Standard) as is stated in the forum description.

    Years ago, before the forums were created, there were multiple Microsoft newsgroups that covered the Project environment. One of those was the Project VBA newsgroup. When Microsoft indicated the newsgroups would no longer be supported and the new forums would take over, there was a concern from some of us that the Project VBA community would be left out. As I recall, the Project MVPs at the time were assured that the customization and programming forum (i.e. this one) would cover that. Unfortunately the forum titles (i.e. what a user sees in the URL) all indicate project server, and further, they all elude to Project 2010. The fact is, except for the Project Server General forum, ("projectserver2010general"), the main Project forum, ("projectprofessional2010general"), is applicable to all versions of Project (i.e. Project 98 through Project 2013, server, pro and standard). The same applies to this forum (i.e. customization and programming for all versions).

    As a non-server Project user myself, I'm perhaps sensitized to this issue.

    Enough said.

    John

    Wednesday, May 14, 2014 3:50 PM
  • Let me translate the first paraghraph, so you can have a little laugh with me :-)

    Good day, on behalf of all high school students about to graduate this year, I would like to ask you not to delete this post although I am not asking anything. During the month of may we have our graduation exam, and we are allowed to use microsoft.com. So we are using it to store a little "help" here. We ask you for your leniency (not sure if correct translation) and understanding. Thank you very much.
    Sunday, May 25, 2014 12:29 AM