Ejemplo n.º 1
0
        public void DivisionTet(double first, double second, double expected)
        {
            ITwoArgumentsCalculator calculator = new ClassDivision();
            double result = calculator.Calculate(first, second);

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 2
0
 void BindData1()
 {
     ClassDivision d = new ClassDivision();
     DataTable dt = d.GetDivisionSearch(txtSearchDivisionID.Text, txtSearchDivisionName.Text, txtSearchCampusID.Text, txtSearchFacultyID.Text);
     GridView1.DataSource = dt;
     GridView1.DataBind();
     SetViewState(dt);
 }
Ejemplo n.º 3
0
 void BindData()
 {
     ClassDivision d = new ClassDivision();
     DataTable dt = d.GetDivision("", "", "", "");
     GridView1.DataSource = dt;
     GridView1.DataBind();
     SetViewState(dt);
 }
Ejemplo n.º 4
0
 protected void btnSearchRefresh_Click(object sender, EventArgs e)
 {
     ClearData();
     ClassDivision d = new ClassDivision();
     DataTable dt = d.GetDivision("", "", "", "");
     GridView1.DataSource = dt;
     GridView1.DataBind();
     SetViewState(dt);
 }
Ejemplo n.º 5
0
        protected void modDeleteCommand(Object sender, GridViewDeleteEventArgs e)
        {
            int id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value);
            ClassDivision d = new ClassDivision();
            d.DIVISION_ID = id;
            d.DeleteDivision();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('ลบข้อมูลเรียบร้อย')", true);

            GridView1.EditIndex = -1;
            BindData1();
        }
Ejemplo n.º 6
0
 public static void ShowFormPhanLop()
 {
     if (m_ClassDivision == null || m_ClassDivision.IsDisposed)
     {
         m_ClassDivision           = new ClassDivision();
         m_ClassDivision.MdiParent = MainForm.ActiveForm;
         m_ClassDivision.Show();
     }
     else
     {
         m_ClassDivision.Activate();
     }
 }
Ejemplo n.º 7
0
        protected void modUpdateCommand(Object sender, GridViewUpdateEventArgs e)
        {
            TextBox txtDivisionIDEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtDivisionIDEdit");
            TextBox txtDivisionNameEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtDivisionNameEdit");
            TextBox txtCampusIDEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtCampusIDEdit");
            TextBox txtFacultyIDEdit = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtFacultyIDEdit");

            ClassDivision d = new ClassDivision(Convert.ToInt32(txtDivisionIDEdit.Text)
                , txtDivisionNameEdit.Text
                , Convert.ToInt32(txtCampusIDEdit.Text)
                , Convert.ToInt32(txtFacultyIDEdit.Text));

            d.UpdateDivision();
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('อัพเดทข้อมูลเรียบร้อย')", true);
            GridView1.EditIndex = -1;
            BindData1();
        }
Ejemplo n.º 8
0
        protected void btnSearchDivision_Click(object sender, EventArgs e)
        {

            if (string.IsNullOrEmpty(txtSearchDivisionID.Text) && string.IsNullOrEmpty(txtSearchDivisionName.Text) && string.IsNullOrEmpty(txtSearchCampusID.Text) && string.IsNullOrEmpty(txtSearchFacultyID.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณากรอก คำค้นหา')", true);

                return;
            }
            else
            {
                ClassDivision d = new ClassDivision();
                DataTable dt = d.GetDivisionSearch(txtSearchDivisionID.Text, txtSearchDivisionName.Text, txtSearchCampusID.Text, txtSearchFacultyID.Text);
                GridView1.DataSource = dt;
                GridView1.DataBind();
                SetViewState(dt);
            }
        }
Ejemplo n.º 9
0
        protected void btnSubmitDivision_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtInsertDivisionID.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ รหัสกอง / สำนักงานเลขา / ภาควิชา')", true);
                return;
            }
            if (string.IsNullOrEmpty(txtInsertDivisionName.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ ชื่อกอง / สำนักงานเลขา / ภาควิชา')", true);
                return;
            }
            if (string.IsNullOrEmpty(txtInsertCampusID.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ รหัสวิทยาเขต')", true);
                return;
            }
            if (string.IsNullOrEmpty(txtInsertFacultyID.Text))
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('กรุณาใส่ รหัสสำนัก / สถาบัน / คณะ')", true);
                return;
            }
            ClassDivision d = new ClassDivision();
            d.DIVISION_ID = Convert.ToInt32(txtInsertDivisionID.Text);
            d.DIVISION_NAME = txtInsertDivisionName.Text;
            d.CAMPUS_ID = Convert.ToInt32(txtInsertCampusID.Text);
            d.FACULTY_ID = Convert.ToInt32(txtInsertFacultyID.Text);

            if (d.CheckUseDivisionID())
            {
                d.InsertDivision();
                BindData();
                ClearData();
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('เพิ่มข้อมูลเรียบร้อย')", true);
            }
            else
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('มีรหัสกอง / สำนักงานเลขา / ภาควิชา นี้อยู่ในระบบแล้ว !')", true);
            }
        }
Ejemplo n.º 10
0
        public void Edit(ClassDivision entity)
        {
            ClassDivisionDAL dalObject = new ClassDivisionDAL();

            dalObject.Edit(entity);
        }
Ejemplo n.º 11
0
        public void Add(ClassDivision entity)
        {
            ClassDivisionDAL dalObject = new ClassDivisionDAL();

            dalObject.Add(entity);
        }