コード例 #1
0
ファイル: Form1.cs プロジェクト: SmokeVLG/FormationOfSchedule
        private void btn_Users_Click(object sender, EventArgs e)
        {
            if (operation == "INS")
            {
                if (tb_login.Text != "" && tb_fio.Text != "" && tb_PFM_users.Text != "" && tb_PFMname.Text != "")
                {
                    DataSaver ds = new DataSaver(login_, password_);
                    lb_status.Text = ds.AddUsers
                                                (tb_login.Text.Replace(" ","")
                                                , tb_fio.Text
                                                , tb_PFM_users.Text.Replace(" ", "")
                                                , tb_PFMname.Text
                                                , cb_groupUsers.SelectedValue.ToString()
                                                );
                    
                }
                else
                {
                    lb_status.Text = "Ошибка: Введите всю информацию!";
                }

                tb_login.Text = "";
                tb_fio.Text = "";
                tb_PFM_users.Text = "";
                tb_PFMname.Text = "";
            }
            else if (operation == "UPD")
            {
                if (tb_login.Text != "" && tb_fio.Text != "" && tb_PFM_users.Text != "" && tb_PFMname.Text != "")
                {
                    DataSaver ds = new DataSaver(login_, password_);
                    lb_status.Text = ds.UpdateUsers
                                                (tb_login.Text.Replace(" ", "")
                                                , tb_fio.Text
                                                , tb_PFM_users.Text.Replace(" ", "")
                                                , tb_PFMname.Text
                                                , cb_groupUsers.SelectedValue.ToString()
                                                , tb_users_ID.Text
                                                );
                    LimitsFill();
                    ActualPaymentsFill();
                    ContractsFill();
                    PlansFill();
                }
                else
                {
                    lb_status.Text = "Ошибка: Заполнены не все поля!";
                }
            }
            else if (operation == "DEL")
            {

                DataSaver ds = new DataSaver(login_, password_);
                lb_status.Text = ds.DeleteUsers(tb_users_ID.Text);
            }

            this.v_Users_GETTableAdapter.Fill(this.formationOfScheduleDataSet1.v_Users_GET);
        }