예제 #1
0
        public bool UpdateProgramTest(
            [PexAssumeUnderTest] ProgramBLL target,
            string id,
            string programlevel,
            string programbranch,
            string programtype,
            string programtime,
            string programactor,
            string programvolume,
            string programprocess,
            int programpoint,
            int programsem,
            int programmark
            )
        {
            bool result = target.UpdateProgram(id, programlevel, programbranch, programtype, programtime,
                                               programactor, programvolume, programprocess, programpoint, programsem, programmark);

            return(result);
            // TODO: add assertions to method ProgramBLLTest.UpdateProgramTest(ProgramBLL, String, String, String, String, String, String, String, String, Int32, Int32, Int32)
        }
예제 #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            string level   = txtProgramLevel.Text;
            string branch  = txtProgramBranch.Text;
            string type    = txtProgramType.Text;
            string time    = txtProgramTime.Text;
            string actor   = txtProgramActor.Text;
            string vol     = txtProgramVolume.Text;
            string process = txtProgramProcess.Text;
            int    tc      = int.Parse(txtProgramPoint.Text);
            int    sem     = int.Parse(txtProgramSemester.Text);
            int    mark    = int.Parse(txtProgramMark.Text);

            bool isempty = false;

            if (level == "")
            {
                temp    = temp + dc.successupdateprogram("level") + "\n";
                isempty = true;
            }
            if (branch == "")
            {
                temp    = temp + dc.successupdateprogram("branch") + "\n";
                isempty = true;
            }
            if (type == "")
            {
                temp    = temp + dc.successupdateprogram("type") + "\n";
                isempty = true;
            }
            if (time == "")
            {
                temp    = temp + dc.successupdateprogram("time") + "\n";
                isempty = true;
            }
            if (actor == "")
            {
                temp    = temp + dc.successupdateprogram("actor") + "\n";
                isempty = true;
            }
            if (vol == "")
            {
                temp    = temp + dc.successupdateprogram("vol") + "\n";
                isempty = true;
            }
            if (process == "")
            {
                temp    = temp + dc.successupdateprogram("process") + "\n";
                isempty = true;
            }
            if (sem == 0)
            {
                temp    = temp + dc.successupdateprogram("sem") + "\n";
                isempty = true;
            }
            if (tc == 0)
            {
                temp    = temp + dc.successupdateprogram("tc") + "\n";
                isempty = true;
            }
            if (mark == 0)
            {
                temp    = temp + dc.successupdateprogram("10") + "\n";
                isempty = true;
            }
            if (isempty == false)
            {
                if (pro.UpdateProgram(id, level, branch, type, time, actor, vol, process, tc, sem, mark) == true)
                {
                    MessageBox.Show(dc.successupdateprogram("success"));
                    this.Close();
                }
                else
                {
                    MessageBox.Show(dc.successupdateprogram("else"));
                }
            }
            else
            {
                MessageBox.Show(temp + "\nVui lòng kiểm tra lại");
            }
        }