Ejemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ClassMaster Obj_Add_Cls = new ClassMaster
            {
                ClassName        = className.Text,
                NumberOfStudents = Convert.ToInt32(numberOfStudents.Text),
                Section          = section.Text,
            };

            ClassMasterBuss.SaveClasses(Obj_Add_Cls);
            ClassesFill();
        }
Ejemplo n.º 2
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            ClassMaster Class = new ClassMaster
            {
                ID               = Convert.ToInt32(ddl_Class.SelectedValue),
                ClassName        = className.Text,
                NumberOfStudents = Convert.ToInt32(numberOfStudents.Text),
                Section          = section.Text
            };

            ClassMasterBuss.UpdateClass(Class);
            ClassesFill();
        }
Ejemplo n.º 3
0
        protected void ddl_Class_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <ClassMaster> Obj_Class = ClassMasterBuss.GetClassDetails(ddl_Class.SelectedValue);

            if (Obj_Class != null && Obj_Class.Count > 0)
            {
                for (int i = 0; i < Obj_Class.Count; i++)
                {
                    className.Text        = Obj_Class[i].ClassName;
                    numberOfStudents.Text = Convert.ToString(Obj_Class[i].NumberOfStudents);
                    section.Text          = Obj_Class[i].Section;
                }
            }
        }
Ejemplo n.º 4
0
        private void ClassesFill()
        {
            ClassMasterBuss    Obj_Class = new ClassMasterBuss();
            List <ClassMaster> Obj_Cls   = Obj_Class.GetClasses();

            if (Obj_Cls != null && Obj_Cls.Count > 0)
            {
                grd.DataSource = Obj_Cls;
                grd.DataBind();
            }
            else
            {
                grd.DataSource = null;
                grd.DataBind();
            }
        }
Ejemplo n.º 5
0
        private void ClassFill()
        {
            ClassMasterBuss    Obj_Cls      = new ClassMasterBuss();
            List <ClassMaster> Obj_Class_ID = Obj_Cls.GetClasses();

            if (Obj_Class_ID != null && Obj_Class_ID.Count > 0)
            {
                for (int i = 0; i < Obj_Class_ID.Count; i++)
                {
                    ddl_Class.Items.Add(Obj_Class_ID[i].ID.ToString());
                }
                ddl_Class.Items.Insert(0, new ListItem("Select Class", " "));
            }
            else
            {
                ddl_Class.Items.Clear();
            }
        }
Ejemplo n.º 6
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     ClassMasterBuss.DeleteClass(ddl_Class.SelectedValue);
     ClassesFill();
 }