예제 #1
0
        private void Manager_cat_del_Click(object sender, EventArgs e)
        {
            del = true;
            SQL sql = new SQL();

            if (Selected_cat != null)
            {
                sql.ExecuteNonQuery("DELETE FROM CAT WHERE " + "ID = " + Selected_cat.id);
                sql.ExecuteNonQuery("DELETE FROM COINS WHERE " + "CAT = " + Selected_cat.id);
                for (int i = 0; i < cat.Count; i++)
                {
                    if (cat[i].id == Selected_cat.id)
                    {
                        cat.RemoveAt(i);

                        refreshCat();

                        // select();
                    }
                }
            }
            Program.mainform.refreshCatList();
            del = false;
        }
예제 #2
0
        private void Manager_del_Click(object sender, EventArgs e)
        {
            del = true;
            SQL sql = new SQL();

            if (!isLastAdmin())
            {
                sql.ExecuteNonQuery("DELETE FROM PERSONAL WHERE " + "USER_LOGIN = '******'");
                for (int i = 0; i < pers.Count; i++)
                {
                    if (pers[i].login == personal.login)
                    {
                        pers.RemoveAt(i);
                        Manager_personal_list.Items.RemoveAt(i);
                        refreshPers();
                        Manager_personal_list.SetSelected(0, true);
                        select();
                    }
                }
            }
            del = false;
        }
예제 #3
0
        private void Manager_addpersonal_Click(object sender, EventArgs e)
        {
            Personal p = new Personal();

            if (isadd)
            {
                if (isLoginOk())
                {
                    isadd = false;
                    Manager_addpersonal.Text = "Добавить";
                    SQL sql = new SQL();
                    int add_int;
                    int change_int;
                    int dl_int;
                    int create_int;
                    int admin_int;
                    if (Manger_chk_add.Checked)
                    {
                        add_int = 1;
                    }
                    else
                    {
                        add_int = 0;
                    }
                    if (Manger_chk_change.Checked)
                    {
                        change_int = 1;
                    }
                    else
                    {
                        change_int = 0;
                    }
                    if (Manger_chk_download.Checked)
                    {
                        dl_int = 1;
                    }
                    else
                    {
                        dl_int = 0;
                    }
                    if (Manger_chk_createPDF.Checked)
                    {
                        create_int = 1;
                    }
                    else
                    {
                        create_int = 0;
                    }
                    if (Manger_chk_admin.Checked)
                    {
                        admin_int = 1;
                    }
                    else
                    {
                        admin_int = 0;
                    }

                    sql.ExecuteNonQuery("INSERT INTO PERSONAL (USER_LOGIN,PASS,ADD_COIN,CREATE_PDF,CHANGE,DOWNLOAD,ADMIN_RULE,NAME,LAST_NAME,TITLE) VALUES('" + Manager_login_txt.Text + "','" + Manager_pass_txt.Text + "'," + add_int + "," + create_int + "," + change_int + "," + dl_int + "," + admin_int + ",'" + Manager_name_txt.Text + "','" + Manage_lastname_txt.Text + "','" + Manager_title_txt.Text + "')");
                    p            = pers[pers.Count - 1];
                    p.login      = Manager_login_txt.Text;
                    p.pass       = Manager_pass_txt.Text;
                    p.add        = Manger_chk_add.Checked;
                    p.change     = Manger_chk_change.Checked;
                    p.download   = Manger_chk_download.Checked;
                    p.create_pdf = Manger_chk_createPDF.Checked;
                    p.admin      = Manger_chk_admin.Checked;
                    p.Name       = Manager_name_txt.Text;
                    p.scndName   = Manage_lastname_txt.Text;
                    p.title      = Manager_title_txt.Text;
                    refreshPers();
                    Manager_personal_list.SetSelected(Manager_personal_list.Items.Count - 1, true);
                    select();
                }
                else
                {
                    MessageBox.Show("Два пользователя с одним логином");
                }
            }
            else
            {
                isadd = true;

                Manager_personal_list.Items.Add("Пользователь");
                Manager_personal_list.SetSelected(Manager_personal_list.Items.Count - 1, true);
                p.login = "******";
                // p.scndName = "Пользователь ";
                pers.Add(p);
                select();
                Manager_addpersonal.Text = "Cохранить";
            }
        }
예제 #4
0
파일: Info.cs 프로젝트: rolaleks/Coins
        private void Info_change_Click(object sender, EventArgs e)
        {
            if (isLoginOk())
            {
                if (name != Info_name_txt.Text || number != Info_number_txt.Text || catName != Info_cat_txt.Text || jpg != Info_jpg.Image || tag != Info_tags.Text ||
                    (picbox.coin.date.Day + "." + picbox.coin.date.Month + "." + picbox.coin.date.Year) != Info_date_txt.Text)
                {
                    int catid   = GetCatID(Info_cat_txt.Text);
                    int catid_f = GetCatID(catName);
                    SQL sql     = new SQL();
                    if (Info_number_txt.Text == "")
                    {
                        Info_number_txt.Text = "0";
                    }

                    String new_jpg_path = JPGName;
                    String new_cdr_path = CDRName;

                    if (bm != null)
                    {
                        bm = ResizeBitmap(bm);
                    }



                    WebClient wc = new WebClient();


                    int sec = picbox.coin.sec;

                    /*
                     * if (picbox.coin.image != Info_jpg.Image)
                     * {
                     *  wc.UploadFile(Program.JPGserver + JPGName + sec, "STOR", JPGPath);
                     *  JPGName += "" + sec;
                     *
                     * }
                     * else
                     * {
                     *  JPGName = picbox.coin.JPGPath;
                     *
                     * }*/
                    if (JPGPath != null)
                    {
                        bm.Save(Application.StartupPath + "\\" + new_jpg_path);
                        wc.UploadFile(Program.JPGserver + new_jpg_path + sec, "STOR", Application.StartupPath + "\\" + new_jpg_path);
                        System.IO.File.Delete(Application.StartupPath + "\\" + new_jpg_path);
                        new_jpg_path       += "" + sec;
                        picbox.coin.JPGPath = new_jpg_path;
                        picbox.coin.image   = (Bitmap)bm;
                        picbox.Image        = picbox.coin.image;
                    }
                    else
                    {
                        new_jpg_path = picbox.coin.JPGPath;
                    }
                    if (CDRPath != null)
                    {
                        wc.UploadFile(Program.CDRserver + new_cdr_path + sec, "STOR", CDRPath);
                        new_cdr_path       += "" + sec;
                        picbox.coin.CDRPath = new_cdr_path;
                    }
                    else
                    {
                        new_cdr_path = picbox.coin.CDRPath;
                    }
                    String day   = "";
                    String month = "";
                    String year  = "";
                    String date  = "";
                    if ((picbox.coin.date.Day + "." + picbox.coin.date.Month + "." + picbox.coin.date.Year) != Info_date_txt.Text)
                    {
                        try
                        {
                            String tmp;
                            day   = Info_date_txt.Text.Substring(0, Info_date_txt.Text.IndexOf("."));
                            tmp   = Info_date_txt.Text.Substring(Info_date_txt.Text.IndexOf(".") + 1, Info_date_txt.Text.Length - Info_date_txt.Text.IndexOf(".") - 1);
                            month = tmp.Substring(0, tmp.IndexOf("."));
                            tmp   = tmp.Substring(tmp.IndexOf(".") + 1, tmp.Length - tmp.IndexOf(".") - 1);
                            year  = tmp;
                            date  = int.Parse(month) + "/" + int.Parse(day) + "/" + int.Parse(year);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                    }
                    else
                    {
                        date = picbox.coin.date.Month + "/" + picbox.coin.date.Day + "/" + picbox.coin.date.Year;
                    }
                    String test11 = "";
                    test11 = "UPDATE COINS SET NAME = '" + Info_name_txt.Text + "'" + ", \"DATE\" = '" + date + ", TAG = '" + Info_tags.Text + "', NUMBER = " + int.Parse(Info_number_txt.Text) + ", CAT = " + catid + ", IMAGE_JPG = '" + new_jpg_path + "'" + ", IMAGE_CDR = '" + new_cdr_path + "'" + " WHERE " + "NAME = '" + name + "'AND NUMBER = " + int.Parse(number) + "AND CAT = " + catid_f;
                    sql.ExecuteNonQuery("UPDATE COINS SET NAME = '" + Info_name_txt.Text + "'" + ", \"DATE\" = '" + date + "', TAG = '" + Info_tags.Text + "', NUMBER = " + int.Parse(Info_number_txt.Text) + ", CAT = " + catid + ", IMAGE_JPG = '" + new_jpg_path + "'" + ", IMAGE_CDR = '" + new_cdr_path + "'" + " WHERE " + "NAME = '" + name + "'AND NUMBER = " + int.Parse(number) + "AND CAT = " + catid_f);

                    picbox.coin.name   = Info_name_txt.Text;
                    picbox.coin.number = int.Parse(Info_number_txt.Text);
                    picbox.coin.tag    = Info_tags.Text;
                    if ((picbox.coin.date.Day + "." + picbox.coin.date.Month + "." + picbox.coin.date.Year) != Info_date_txt.Text)
                    {
                        picbox.coin.date.AddDays(int.Parse(day));
                        picbox.coin.date.AddMonths(int.Parse(month));
                        picbox.coin.date.AddYears(int.Parse(year));
                    }
                    Program.mainform.refreshCoinIdtoName();
                    Program.mainform.sort();
                }
            }
        }
예제 #5
0
        private void Manager_change_Click(object sender, EventArgs e)
        {
            if (isLoginOk())
            {
                if (personal.login != Manager_login_txt.Text || personal.pass != Manager_pass_txt.Text ||
                    personal.add != Manger_chk_add.Checked || personal.change != Manger_chk_change.Checked ||
                    personal.download != Manger_chk_download.Checked || personal.create_pdf != Manger_chk_createPDF.Checked ||
                    personal.admin != Manger_chk_admin.Checked || personal.Name != Manager_name_txt.Text ||
                    personal.scndName != Manage_lastname_txt.Text || personal.title != Manager_title_txt.Text
                    )
                {
                    int add_int;
                    int change_int;
                    int dl_int;
                    int create_int;
                    int admin_int;
                    if (Manger_chk_add.Checked)
                    {
                        add_int = 1;
                    }
                    else
                    {
                        add_int = 0;
                    }
                    if (Manger_chk_change.Checked)
                    {
                        change_int = 1;
                    }
                    else
                    {
                        change_int = 0;
                    }
                    if (Manger_chk_download.Checked)
                    {
                        dl_int = 1;
                    }
                    else
                    {
                        dl_int = 0;
                    }
                    if (Manger_chk_createPDF.Checked)
                    {
                        create_int = 1;
                    }
                    else
                    {
                        create_int = 0;
                    }
                    if (Manger_chk_admin.Checked)
                    {
                        admin_int = 1;
                    }
                    else
                    {
                        admin_int = 0;
                    }



                    SQL sql = new SQL();
                    sql.ExecuteNonQuery("UPDATE PERSONAL SET USER_LOGIN = '******', PASS = '******', ADD_COIN = " + add_int + ", CREATE_PDF = " + create_int + ", CHANGE = " + change_int + ", DOWNLOAD = " + dl_int + ", ADMIN_RULE = " + admin_int + ", NAME = '" + Manager_name_txt.Text + "'" + ", LAST_NAME = '" + Manage_lastname_txt.Text + "'" + ", TITLE = '" + Manager_title_txt.Text + "'" + " WHERE " + "USER_LOGIN = '******'");
                    personal.login      = Manager_login_txt.Text;
                    personal.pass       = Manager_pass_txt.Text;
                    personal.add        = Manger_chk_add.Checked;
                    personal.change     = Manger_chk_change.Checked;
                    personal.download   = Manger_chk_download.Checked;
                    personal.create_pdf = Manger_chk_createPDF.Checked;
                    personal.admin      = Manger_chk_admin.Checked;
                    personal.Name       = Manager_name_txt.Text;
                    personal.scndName   = Manage_lastname_txt.Text;
                    personal.title      = Manager_title_txt.Text;
                }
            }
            else
            {
                MessageBox.Show("Два пользователя с одним логином");
            }
        }
예제 #6
0
파일: AddCat.cs 프로젝트: rolaleks/Coins
 private void ConfirmAddCat_Click(object sender, EventArgs e)
 {
     sql.ExecuteNonQuery("INSERT INTO CAT (CAT) VALUES('" + AddCatTxt.Text + "')");
     Program.addcoinform.RefreshCat();
     this.Close();
 }
예제 #7
0
파일: AddCoin.cs 프로젝트: rolaleks/Coins
        private void button1_Click(object sender, EventArgs e)
        {
            if (isLoginOk())
            {
                int catid = GetCatID(CoinCat.Text);
                SQL sql   = new SQL();
                if (CoinNumberTxt.Text == "")
                {
                    CoinNumberTxt.Text = "0";
                }
                Random rnd = new Random();
                int    sec = rnd.Next(1000000);
                coin   cn  = new coin();
                if (bm != null)
                {
                    bm       = ResizeBitmap(bm);
                    cn.image = bm;
                }
                cn.name   = CoinNameTxt.Text;
                cn.cat    = catid;
                cn.number = int.Parse(CoinNumberTxt.Text);
                cn.date   = Calendar.Value;
                cn.sec    = sec;
                cn.tag    = Info_tags.Text;
                //cn.date.AddDays(Calendar.SelectionStart.Day);
                //cn.date.AddMonths(Calendar.SelectionStart.Month);
                // cn.date.AddYears(Calendar.SelectionStart.Year);

                String date = Calendar.Value.Month + "/" + Calendar.Value.Day + "/" + Calendar.Value.Year;

                WebClient wc           = new WebClient();
                String    new_jpg_path = JPGName;
                String    new_cdr_path = CDRName;
                if (JPGPath != null)
                {
                    bm.Save(Application.StartupPath + "\\" + new_jpg_path);
                    wc.UploadFile(Program.JPGserver + new_jpg_path + sec, "STOR", Application.StartupPath + "\\" + new_jpg_path);
                    System.IO.File.Delete(Application.StartupPath + "\\" + new_jpg_path);
                    new_jpg_path += "" + sec;
                    cn.JPGPath    = new_jpg_path;
                }
                else
                {
                    new_jpg_path = "";
                    cn.JPGPath   = new_jpg_path;
                }
                if (CDRPath != null)
                {
                    wc.UploadFile(Program.CDRserver + new_cdr_path + sec, "STOR", CDRPath);
                    new_cdr_path += "" + sec;
                    cn.CDRPath    = new_cdr_path;
                }
                else
                {
                    new_cdr_path = "";
                    cn.CDRPath   = new_cdr_path;
                }



                PicBox pb = new PicBox(cn, Program.mainform.ItemSizeX, Program.mainform.ItemSizeY);
                pb.Click += new System.EventHandler(Program.mainform.pictureBox1_Click);



                sql.ExecuteNonQuery("INSERT INTO COINS (NAME,NUMBER,CAT,IMAGE_JPG,IMAGE_CDR,\"DATE\",SECURE,TAG) VALUES('" + CoinNameTxt.Text + "'," + int.Parse(CoinNumberTxt.Text) + "," + catid + ",'" + new_jpg_path + "','" + new_cdr_path + "','" + date + "'," + sec + ",'" + Info_tags.Text + "')");
                Program.mainform.All.Add(pb);
                Program.mainform.refreshIdToName();
                Program.mainform.refreshCoinIdtoName();
                Program.mainform.refreshCatList();
                Program.mainform.sort();
                //INSERT INTO COINS (ID, NAME, NUMBER, CAT, IMAGE_JPG, IMAGE_CDR, "DATE") VALUES (14, 'le;flsd', 34234, 4, 'C:\Users\Public\Pictures\Sample Pictures\Desert.jpg', 'None', '2-MAR-2012');
            }
        }
예제 #8
0
파일: Info.cs 프로젝트: rolaleks/Coins
        private void Info_change_Click(object sender, EventArgs e)
        {
            if (isLoginOk())
            {
                if (name != Info_name_txt.Text || number != Info_number_txt.Text || catName != Info_cat_txt.Text || jpg != Info_jpg.Image || tag != Info_tags.Text
                    || (picbox.coin.date.Day+"."+picbox.coin.date.Month+"."+picbox.coin.date.Year)!=Info_date_txt.Text)
                {
                    int catid = GetCatID(Info_cat_txt.Text);
                    int catid_f = GetCatID(catName);
                    SQL sql = new SQL();
                    if (Info_number_txt.Text == "")
                    {
                        Info_number_txt.Text = "0";
                    }

                    String new_jpg_path = JPGName;
                    String new_cdr_path = CDRName;

                    if (bm != null)
                    {
                        bm = ResizeBitmap(bm);

                    }

                    WebClient wc = new WebClient();

                    int sec = picbox.coin.sec;
                    /*
                    if (picbox.coin.image != Info_jpg.Image)
                    {
                        wc.UploadFile(Program.JPGserver + JPGName + sec, "STOR", JPGPath);
                        JPGName += "" + sec;

                    }
                    else
                    {
                        JPGName = picbox.coin.JPGPath;

                    }*/
                    if (JPGPath != null)
                    {
                        bm.Save(Application.StartupPath + "\\" + new_jpg_path);
                        wc.UploadFile(Program.JPGserver + new_jpg_path + sec, "STOR", Application.StartupPath + "\\" + new_jpg_path);
                        System.IO.File.Delete(Application.StartupPath + "\\" + new_jpg_path);
                        new_jpg_path += "" + sec;
                        picbox.coin.JPGPath = new_jpg_path;
                        picbox.coin.image = (Bitmap)bm;
                        picbox.Image = picbox.coin.image;

                    }
                    else
                    {
                        new_jpg_path = picbox.coin.JPGPath;

                    }
                    if (CDRPath != null)
                    {
                        wc.UploadFile(Program.CDRserver + new_cdr_path + sec, "STOR", CDRPath);
                        new_cdr_path += "" + sec;
                        picbox.coin.CDRPath = new_cdr_path;
                    }
                    else
                    {

                        new_cdr_path = picbox.coin.CDRPath;
                    }
                    String day = "";
                    String month = "";
                    String year = "";
                    String date="";
                    if ((picbox.coin.date.Day + "." + picbox.coin.date.Month + "." + picbox.coin.date.Year) != Info_date_txt.Text)
                    {
                        try
                        {

                            String tmp;
                             day = Info_date_txt.Text.Substring(0, Info_date_txt.Text.IndexOf("."));
                            tmp = Info_date_txt.Text.Substring(Info_date_txt.Text.IndexOf(".") + 1, Info_date_txt.Text.Length - Info_date_txt.Text.IndexOf(".") - 1);
                             month = tmp.Substring(0, tmp.IndexOf("."));
                            tmp = tmp.Substring(tmp.IndexOf(".") + 1, tmp.Length - tmp.IndexOf(".") - 1);
                             year = tmp;
                             date = int.Parse(month) + "/" + int.Parse(day) + "/" + int.Parse(year);
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);

                        }
                    }
                    else {
                         date = picbox.coin.date.Month + "/" + picbox.coin.date.Day + "/" + picbox.coin.date.Year;

                    }
                    String test11 = "";
                     test11 = "UPDATE COINS SET NAME = '" + Info_name_txt.Text + "'" + ", \"DATE\" = '" + date + ", TAG = '" + Info_tags.Text + "', NUMBER = " + int.Parse(Info_number_txt.Text) + ", CAT = " + catid + ", IMAGE_JPG = '" + new_jpg_path + "'" + ", IMAGE_CDR = '" + new_cdr_path + "'" + " WHERE " + "NAME = '" + name + "'AND NUMBER = " + int.Parse(number) + "AND CAT = " + catid_f;
                    sql.ExecuteNonQuery("UPDATE COINS SET NAME = '" + Info_name_txt.Text + "'"+", \"DATE\" = '" + date +"', TAG = '" + Info_tags.Text + "', NUMBER = " + int.Parse(Info_number_txt.Text) + ", CAT = " + catid + ", IMAGE_JPG = '" + new_jpg_path + "'" + ", IMAGE_CDR = '" + new_cdr_path + "'" + " WHERE " + "NAME = '" + name + "'AND NUMBER = " + int.Parse(number) + "AND CAT = " + catid_f);

                    picbox.coin.name = Info_name_txt.Text;
                    picbox.coin.number = int.Parse(Info_number_txt.Text);
                    picbox.coin.tag = Info_tags.Text;
                    if ((picbox.coin.date.Day + "." + picbox.coin.date.Month + "." + picbox.coin.date.Year) != Info_date_txt.Text)
                    {
                        picbox.coin.date.AddDays(int.Parse(day));
                        picbox.coin.date.AddMonths(int.Parse(month));
                        picbox.coin.date.AddYears(int.Parse(year));
                    }
                    Program.mainform.refreshCoinIdtoName();
                    Program.mainform.sort();
                }
            }
        }
예제 #9
0
파일: Manager.cs 프로젝트: rolaleks/Coins
        private void Manager_addpersonal_Click(object sender, EventArgs e)
        {
            Personal p = new Personal();
            if (isadd) {
                if (isLoginOk())
                {
                    isadd = false;
                    Manager_addpersonal.Text = "Добавить";
                    SQL sql = new SQL();
                    int add_int;
                    int change_int;
                    int dl_int;
                    int create_int;
                    int admin_int;
                    if (Manger_chk_add.Checked)
                    {
                        add_int = 1;
                    }
                    else
                    {
                        add_int = 0;
                    }
                    if (Manger_chk_change.Checked)
                    {
                        change_int = 1;
                    }
                    else
                    {
                        change_int = 0;
                    }
                    if (Manger_chk_download.Checked)
                    {
                        dl_int = 1;
                    }
                    else
                    {
                        dl_int = 0;
                    }
                    if (Manger_chk_createPDF.Checked)
                    {
                        create_int = 1;
                    }
                    else
                    {
                        create_int = 0;
                    }
                    if (Manger_chk_admin.Checked)
                    {
                        admin_int = 1;
                    }
                    else
                    {
                        admin_int = 0;
                    }

                    sql.ExecuteNonQuery("INSERT INTO PERSONAL (USER_LOGIN,PASS,ADD_COIN,CREATE_PDF,CHANGE,DOWNLOAD,ADMIN_RULE,NAME,LAST_NAME,TITLE) VALUES('" + Manager_login_txt.Text + "','" + Manager_pass_txt.Text + "'," + add_int + "," + create_int + "," + change_int + "," + dl_int + "," + admin_int + ",'" + Manager_name_txt.Text + "','" + Manage_lastname_txt.Text + "','" + Manager_title_txt.Text + "')");
                    p = pers[pers.Count - 1];
                    p.login = Manager_login_txt.Text;
                    p.pass = Manager_pass_txt.Text;
                    p.add = Manger_chk_add.Checked;
                    p.change = Manger_chk_change.Checked;
                    p.download = Manger_chk_download.Checked;
                    p.create_pdf = Manger_chk_createPDF.Checked;
                    p.admin = Manger_chk_admin.Checked;
                    p.Name = Manager_name_txt.Text;
                    p.scndName = Manage_lastname_txt.Text;
                    p.title = Manager_title_txt.Text;
                    refreshPers();
                    Manager_personal_list.SetSelected(Manager_personal_list.Items.Count - 1, true);
                    select();
                }
                else {
                    MessageBox.Show("Два пользователя с одним логином");

                }

            }else{
                  isadd=true;

                  Manager_personal_list.Items.Add("Пользователь");
                  Manager_personal_list.SetSelected(Manager_personal_list.Items.Count-1,true);
                  p.login = "******";
                 // p.scndName = "Пользователь ";
                  pers.Add(p);
                  select();
                  Manager_addpersonal.Text = "Cохранить";

            }
        }
예제 #10
0
파일: Manager.cs 프로젝트: rolaleks/Coins
        private void Manager_del_Click(object sender, EventArgs e)
        {
            del = true;
            SQL sql = new SQL();
               if(!isLastAdmin()){
            sql.ExecuteNonQuery("DELETE FROM PERSONAL WHERE " + "USER_LOGIN = '******'");
            for (int i = 0; i < pers.Count; i++)
            {
                if (pers[i].login==personal.login)
                {
                    pers.RemoveAt(i);
                    Manager_personal_list.Items.RemoveAt(i);
                    refreshPers();
                    Manager_personal_list.SetSelected(0, true);
                    select();
                }

            }
               }
               del = false;
        }
예제 #11
0
파일: Manager.cs 프로젝트: rolaleks/Coins
        private void Manager_change_Click(object sender, EventArgs e)
        {
            if (isLoginOk())
            {
                if (personal.login != Manager_login_txt.Text || personal.pass != Manager_pass_txt.Text
                    || personal.add != Manger_chk_add.Checked || personal.change != Manger_chk_change.Checked
                    || personal.download != Manger_chk_download.Checked || personal.create_pdf != Manger_chk_createPDF.Checked
                    || personal.admin != Manger_chk_admin.Checked || personal.Name != Manager_name_txt.Text
                    || personal.scndName != Manage_lastname_txt.Text || personal.title != Manager_title_txt.Text
                    )
                {
                    int add_int;
                    int change_int;
                    int dl_int;
                    int create_int;
                    int admin_int;
                    if (Manger_chk_add.Checked)
                    {
                        add_int = 1;
                    }
                    else
                    {
                        add_int = 0;
                    }
                    if (Manger_chk_change.Checked)
                    {
                        change_int = 1;
                    }
                    else
                    {
                        change_int = 0;
                    }
                    if (Manger_chk_download.Checked)
                    {
                        dl_int = 1;
                    }
                    else
                    {
                        dl_int = 0;
                    }
                    if (Manger_chk_createPDF.Checked)
                    {
                        create_int = 1;
                    }
                    else
                    {
                        create_int = 0;
                    }
                    if (Manger_chk_admin.Checked)
                    {
                        admin_int = 1;
                    }
                    else
                    {
                        admin_int = 0;
                    }

                    SQL sql = new SQL();
                    sql.ExecuteNonQuery("UPDATE PERSONAL SET USER_LOGIN = '******', PASS = '******', ADD_COIN = " + add_int + ", CREATE_PDF = " + create_int + ", CHANGE = " + change_int + ", DOWNLOAD = " + dl_int + ", ADMIN_RULE = " + admin_int + ", NAME = '" + Manager_name_txt.Text + "'" + ", LAST_NAME = '" + Manage_lastname_txt.Text + "'" + ", TITLE = '" + Manager_title_txt.Text + "'" + " WHERE " + "USER_LOGIN = '******'");
                    personal.login = Manager_login_txt.Text;
                    personal.pass = Manager_pass_txt.Text;
                    personal.add = Manger_chk_add.Checked;
                    personal.change = Manger_chk_change.Checked;
                    personal.download = Manger_chk_download.Checked;
                    personal.create_pdf = Manger_chk_createPDF.Checked;
                    personal.admin = Manger_chk_admin.Checked;
                    personal.Name = Manager_name_txt.Text;
                    personal.scndName = Manage_lastname_txt.Text;
                    personal.title = Manager_title_txt.Text;

                }
            }
            else {

                MessageBox.Show("Два пользователя с одним логином");

            }
        }
예제 #12
0
파일: Manager.cs 프로젝트: rolaleks/Coins
        private void Manager_cat_del_Click(object sender, EventArgs e)
        {
            del = true;
            SQL sql = new SQL();
            if (Selected_cat!=null)
            {
                sql.ExecuteNonQuery("DELETE FROM CAT WHERE " + "ID = " + Selected_cat.id);
                sql.ExecuteNonQuery("DELETE FROM COINS WHERE " + "CAT = " + Selected_cat.id);
                for (int i = 0; i < cat.Count; i++)
                {
                    if (cat[i].id == Selected_cat.id)
                    {
                        cat.RemoveAt(i);

                        refreshCat();

                       // select();
                    }

                }
            }
            Program.mainform.refreshCatList();
            del = false;
        }