Exemplo n.º 1
0
        private void delSchedBtn_Click(object sender, EventArgs e)
        {
            Department schedDept = new Department(); schedDept.id = new Guid(chooseDept.SelectedValue.ToString());
            Job        schedJob  = new Job(); schedJob.id = new Guid(chooseJob.SelectedValue.ToString());
            Schedule   delSched  = new Schedule();

            delSched.dept = schedDept; delSched.job = schedJob;
            string where  = "fk_department=" + dbConnect.Transform(delSched.dept.id.ToString()) + " and fk_job=" + dbConnect.Transform(delSched.job.id.ToString());
            List <string>[] selection = DBConnect.SendMessageFromSocket(dbConnect.Select("schedule", "", where));
            if (!selection.Length.Equals(0))
            {
                DBConnect.SendMessageFromSocket(dbConnect.Delete("schedule", where));
                MessageBox.Show("Расписание удалено");
                foreach (CheckedListBox sub in cbAllControl)
                {
                    for (int a = 0; a < sub.Items.Count; a++)
                    {
                        sub.SetItemChecked(a, false);
                    }
                }
            }
            else
            {
                MessageBox.Show("Для вашего запроса расписание ещё не назначено");
            }
            ScheduleForm_Load(sender, e);
        }
Exemplo n.º 2
0
        private void deleteJobBtn_Click(object sender, EventArgs e)
        {
            Job delJob = new Job(chooseJob.Text, (string)rankCB.SelectedItem, (int)salaryRank.Value);

            delJob.id    = (Guid)chooseJob.SelectedValue;
            string where = "idjob=" + dbConnect.Transform(delJob.id.ToString());
            dbConnect.Delete("job", where);
            JobForm_Load(sender, e);
        }
        private void deleteDepBtn_Click(object sender, EventArgs e)
        {
            Department delDept = new Department(chooseDept.Text, jobs);

            delDept.id   = new Guid(chooseDept.SelectedValue.ToString());
            string where = "iddept=" + dbConnect.Transform(delDept.id.ToString());
            DBConnect.SendMessageFromSocket(dbConnect.Delete("department", where));
            DepartmentForm_Load(sender, e);
        }
 private void minusPersonBtn_Click(object sender, EventArgs e)
 {
     try {
         string where = "idperson= " + dbConnect.Transform(infTable.SelectedRows[0].Cells[0].Value.ToString());
         List <string>[] selection = dbConnect.Select("person", 13, "", where);
         dbConnect.Delete("person", where);
     }
     catch (Exception) { MessageBox.Show("Выделите всю строку"); };
     OperationsForm_Load(sender, e);
 }