Esempio n. 1
0
    protected void btnAdd2_Click(object sender, EventArgs e)
    {
        try
        {
            //string ids = getStudentID();
            string ids = getStudentIDs(gvStudents);
            if (ids != "")
            {
                STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent();
                sTD_ClassStudent.ClassStudentName = "";
                sTD_ClassStudent.StudentID = ids;
                sTD_ClassStudent.ClassID = int.Parse("1");
                sTD_ClassStudent.AddedBy = Profile.card_id;
                sTD_ClassStudent.AddedDate = DateTime.Now;
                sTD_ClassStudent.UpdatedBy = Profile.card_id;
                sTD_ClassStudent.UpdateDate = DateTime.Now;
                int resutl = STD_ClassStudentManager.InsertSTD_ClassStudent_List_KeepStudentInMultipleClassActive(sTD_ClassStudent);

                string message = resutl + " New Entry Created";
                ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Message", "alert('" + message + "');", true);

                txtStudentIDs.Text = "";
                //Response.Redirect("ClassSubjectAddStudent.aspx?ID=" + ddlClassID.SelectedValue);
            }
        }
        catch (Exception ex)
        {
            ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Message", "alert('" + ex.Message.ToString() + "');", true);
        }
    }
Esempio n. 2
0
 public static STD_ClassStudent GetSTD_ClassStudentByClassStudentID(int ClassStudentID)
 {
     STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent();
     SqlSTD_ClassStudentProvider sqlSTD_ClassStudentProvider = new SqlSTD_ClassStudentProvider();
     sTD_ClassStudent = sqlSTD_ClassStudentProvider.GetSTD_ClassStudentByClassStudentID(ClassStudentID);
     return sTD_ClassStudent;
 }
Esempio n. 3
0
 protected void btnUpdate_Click(object sender, EventArgs e)
 {
     try
     {
     STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent ();
     sTD_ClassStudent.ClassStudentID=  int.Parse(Request.QueryString["ID"].ToString());
     sTD_ClassStudent.ClassStudentName=  txtClassStudentName.Text;
     sTD_ClassStudent.StudentID=  ddlStudentID.SelectedValue;
     sTD_ClassStudent.ClassID=  int.Parse(ddlClassID.SelectedValue);
     sTD_ClassStudent.AddedBy=  Profile.card_id;
     sTD_ClassStudent.AddedDate=  DateTime.Now;
     sTD_ClassStudent.UpdatedBy=  Profile.card_id;
     sTD_ClassStudent.UpdateDate = DateTime.Now;
     bool  resutl =STD_ClassStudentManager.UpdateSTD_ClassStudent(sTD_ClassStudent);
     }catch(Exception ex){}Response.Redirect("AdminDisplaySTD_ClassStudent.aspx");
 }
Esempio n. 4
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        try
        {
            STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent();
            //	sTD_ClassStudent.ClassStudentID=  int.Parse(ddlClassStudentID.SelectedValue);
            sTD_ClassStudent.ClassStudentName = txtClassStudentName.Text;
            sTD_ClassStudent.StudentID = ddlStudentID.SelectedValue;
            sTD_ClassStudent.ClassID = int.Parse(ddlClassID.SelectedValue);
            sTD_ClassStudent.AddedBy = Profile.card_id;
            sTD_ClassStudent.AddedDate = DateTime.Now;
            sTD_ClassStudent.UpdatedBy = Profile.card_id;
            sTD_ClassStudent.UpdateDate = DateTime.Now;
            sTD_ClassStudent.RowStatusID = 1;
            int resutl = STD_ClassStudentManager.InsertSTD_ClassStudent(sTD_ClassStudent);
        }
        catch (Exception ex)
        {
        }

        Response.Redirect("AdminDisplaySTD_ClassStudent.aspx");
    }
Esempio n. 5
0
 public static int InsertSTD_ClassStudent_List_KeepStudentInMultipleClassActive(STD_ClassStudent sTD_ClassStudent)
 {
     SqlSTD_ClassStudentProvider sqlSTD_ClassStudentProvider = new SqlSTD_ClassStudentProvider();
     return sqlSTD_ClassStudentProvider.InsertSTD_ClassStudent_List_KeepStudentInMultipleClassActive(sTD_ClassStudent);
 }
Esempio n. 6
0
 public static int InsertSTD_ClassStudent_List(STD_ClassStudent sTD_ClassStudent)
 {
     SqlSTD_ClassStudentProvider sqlSTD_ClassStudentProvider = new SqlSTD_ClassStudentProvider();
     return sqlSTD_ClassStudentProvider.InsertSTD_ClassStudent_List(sTD_ClassStudent);
 }
Esempio n. 7
0
 public static STD_ClassStudent GetSTD_StudentByStudentID(string StudentID)
 {
     STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent();
     SqlSTD_ClassStudentProvider sqlSTD_ClassStudentProvider = new SqlSTD_ClassStudentProvider();
     sTD_ClassStudent = sqlSTD_ClassStudentProvider.GetSTD_ClassStudentByStudentID(StudentID);
     return sTD_ClassStudent;
 }
Esempio n. 8
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {

            string ids = getStudentID();
            if (ids != "")
            {
                string[] words = ids.Split(',');
                foreach (string word in words)
                {
                    if (word != "")
                    {
                        STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent();
                        sTD_ClassStudent.ClassStudentName = ddlSubjectID.SelectedItem.Text;
                        sTD_ClassStudent.StudentID = word;
                        sTD_ClassStudent.ClassID = int.Parse(ddlSubjectID.SelectedValue);
                        sTD_ClassStudent.AddedBy = Profile.card_id;
                        sTD_ClassStudent.AddedDate = DateTime.Now;
                        sTD_ClassStudent.UpdatedBy = Profile.card_id;
                        sTD_ClassStudent.UpdateDate = DateTime.Now;
                        int resutl = STD_ClassStudentManager.InsertSTD_ClassStudent(sTD_ClassStudent);
                    }
                }
            }
        }
        catch (Exception ex) { }
        Response.Redirect("ClassSubjectAddStudent.aspx?ID=" + ddlSubjectID.SelectedValue); //loadGrid();
        //btnUpdate.Visible = false;
    }
Esempio n. 9
0
    protected void btnEnrollment_Click(object sender, EventArgs e)
    {
        bool isAlreadyAdded= false;
        int classSubjectID = 0;
        foreach (GridViewRow gvr in gvSTD_Class.Rows)
        {
            HiddenField hfClassID = (HiddenField)gvr.FindControl("hfClassID");
            HiddenField hfIsHistory = (HiddenField)gvr.FindControl("hfIsHistory");

            if (!bool.Parse(hfIsHistory.Value) && ddlClassID.SelectedValue == hfClassID.Value)
            {
                isAlreadyAdded = true;
                break;
            }
        }

        if (!isAlreadyAdded)
        {
            STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent();
            sTD_ClassStudent.ClassStudentName = "";
            sTD_ClassStudent.StudentID = hfStudentID.Value;
            sTD_ClassStudent.ClassID = int.Parse(ddlClassID.SelectedValue);
            sTD_ClassStudent.AddedBy = Profile.card_id;
            sTD_ClassStudent.AddedDate = DateTime.Now;
            sTD_ClassStudent.UpdatedBy = Profile.card_id;
            sTD_ClassStudent.UpdateDate = DateTime.Now;
            sTD_ClassStudent.RowStatusID = 1;
            classSubjectID = STD_ClassStudentManager.InsertSTD_ClassStudent(sTD_ClassStudent);
        }

        foreach (GridViewRow item in gvSubjects.Rows)
        {
            CheckBox chkSubject = (CheckBox)item.FindControl("chkSubject");
            //HiddenField hfClassSubjectID = (HiddenField)item.FindControl("hfClassSubjectID");

            if (chkSubject.Checked)
            {
                STD_ClassSubjectStudent sTD_ClassSubjectStudent = new STD_ClassSubjectStudent();
                //	sTD_ClassSubjectStudent.ClassSubjectStudentID=  int.Parse(ddlClassSubjectStudentID.SelectedValue);
                sTD_ClassSubjectStudent.ClassSubjectStudentName = "";
                sTD_ClassSubjectStudent.StudentID = hfStudentID.Value;
                sTD_ClassSubjectStudent.ClassSubjectID = int.Parse(((HiddenField)item.FindControl("hfClassSubjectID")).Value);
                sTD_ClassSubjectStudent.AddedBy = Profile.card_id;
                sTD_ClassSubjectStudent.AddedDate = DateTime.Now;
                sTD_ClassSubjectStudent.UpdatedBy = Profile.card_id;
                sTD_ClassSubjectStudent.UpdateDate = DateTime.Now;
                sTD_ClassSubjectStudent.RowStatusID = 1;
                int resutl = STD_ClassSubjectStudentManager.InsertSTD_ClassSubjectStudent(sTD_ClassSubjectStudent);
            }
        }

        btnVarify_OnClick(this, new EventArgs());
        ddlClassID.SelectedIndex=0;
        ddlClassID_SelectedIndexChanged(this,new EventArgs());
    }
Esempio n. 10
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (Session["id"] != null)
            {
                string[] id = Session["id"].ToString().Split(',');

                for (int i = 0; i < id.Length-1; i++)
                {
                    STD_ClassSubjectStudent sTD_ClassSubjectStudent = STD_ClassSubjectStudentManager.GetSTD_ClassSubjectStudentByClassSubjectStudentID(Convert.ToInt32(id[i]));
                    sTD_ClassSubjectStudent.RowStatusID = 3;
                    STD_ClassSubjectStudentManager.UpdateSTD_ClassSubjectStudent(sTD_ClassSubjectStudent);
                }

            }
            //insert the classes which are not assigned for that student
            string classIDsNeedtoAddinDataBase = "";

            hfclassIDs.Value = "";
            DataSet ds = STD_ClassStudentManager.GetSTD_ClassStudentByStudentID(hfStudentID.Value, true);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                hfclassIDs.Value += dr["ClassID"].ToString() + "-";
            }

            if (Session["ClassSubjectStudents"] != null)
            {
                List<STD_ClassSubjectStudent> ClassSubjectStudents = new List<STD_ClassSubjectStudent>();
                ClassSubjectStudents = (List<STD_ClassSubjectStudent>)Session["ClassSubjectStudents"];

                foreach (STD_ClassSubjectStudent classSubjectStudent in ClassSubjectStudents)
                {
                    if (!hfclassIDs.Value.Contains(classSubjectStudent.ClassID.ToString()))
                    {
                        classIDsNeedtoAddinDataBase += classSubjectStudent.ClassID.ToString() + "-";
                    }
                }

                if (classIDsNeedtoAddinDataBase != "")
                {
                    string[] ids = classIDsNeedtoAddinDataBase.Split('-');
                    foreach (string id in ids)
                    {
                        if (id != "" && id != "-")
                        {
                            STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent();
                            //	sTD_ClassStudent.ClassStudentID=  int.Parse(ddlClassStudentID.SelectedValue);
                            sTD_ClassStudent.ClassStudentName = "";
                            sTD_ClassStudent.StudentID = hfStudentID.Value;
                            sTD_ClassStudent.ClassID = int.Parse(id);
                            sTD_ClassStudent.AddedBy = Profile.card_id;
                            sTD_ClassStudent.AddedDate = DateTime.Now;
                            sTD_ClassStudent.UpdatedBy = Profile.card_id;
                            sTD_ClassStudent.UpdateDate = DateTime.Now;
                            sTD_ClassStudent.RowStatusID = 1;
                            int resutl = STD_ClassStudentManager.InsertSTD_ClassStudent(sTD_ClassStudent);
                        }
                    }
                }

                //Need to add the ClassSubject Student

                //insert the classes which are not assigned for that student
                string classSubjectIDsNeedtoAddinDataBase = "";

                hfclassIDs.Value = "";
                DataSet dsclassSubject = STD_ClassSubjectStudentManager.GetSTD_ClassSubjectStudentByStudentID(hfStudentID.Value);
                foreach (DataRow dr in dsclassSubject.Tables[0].Rows)
                {
                    hfclassSubjectIDs.Value += dr["ClassSubjectID"].ToString() + "-";
                }

                foreach (STD_ClassSubjectStudent classSubjectStudent in ClassSubjectStudents)
                {
                    if (!hfclassSubjectIDs.Value.Contains(classSubjectStudent.ClassSubjectID.ToString()))
                    {
                        classSubjectIDsNeedtoAddinDataBase += classSubjectStudent.ClassSubjectID.ToString() + "-";
                    }
                }

                if (classSubjectIDsNeedtoAddinDataBase != "")
                {
                    string[] ids = classSubjectIDsNeedtoAddinDataBase.Split('-');
                    foreach (string id in ids)
                    {
                        if (id != "" && id != "-")
                        {
                            STD_ClassSubjectStudent sTD_ClassSubjectStudent = new STD_ClassSubjectStudent();
                            //	sTD_ClassSubjectStudent.ClassSubjectStudentID=  int.Parse(ddlClassSubjectStudentID.SelectedValue);
                            sTD_ClassSubjectStudent.ClassSubjectStudentName = "";
                            sTD_ClassSubjectStudent.StudentID = hfStudentID.Value;
                            sTD_ClassSubjectStudent.ClassSubjectID = int.Parse(id);
                            sTD_ClassSubjectStudent.AddedBy = Profile.card_id;
                            sTD_ClassSubjectStudent.AddedDate = DateTime.Now;
                            sTD_ClassSubjectStudent.UpdatedBy = Profile.card_id;
                            sTD_ClassSubjectStudent.UpdateDate = DateTime.Now;
                            sTD_ClassSubjectStudent.RowStatusID = 1;
                            int resutl = STD_ClassSubjectStudentManager.InsertSTD_ClassSubjectStudent(sTD_ClassSubjectStudent);

                        }
                    }
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Message", "alert('Save successfully.')", true);
                }
                else
                {
                    foreach (STD_ClassSubjectStudent classSubjectStudent in ClassSubjectStudents)
                    {
                        classSubjectStudent.RowStatusID = 1;
                        STD_ClassSubjectStudentManager.UpdateSTD_ClassSubjectStudent(classSubjectStudent);
                    }
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Message", "alert('Save successfully.')", true);
                }
            }

        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 11
0
    public int InsertSTD_ClassStudent_List_KeepStudentInMultipleClassActive(STD_ClassStudent sTD_ClassStudent)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("InsertSTD_ClassStudent_List_KeepStudentInMultipleClassActive", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@Count", SqlDbType.Int).Direction = ParameterDirection.Output;
            cmd.Parameters.Add("@StudentIDs", SqlDbType.NVarChar).Value = sTD_ClassStudent.StudentID;
            cmd.Parameters.Add("@ClassID", SqlDbType.Int).Value = sTD_ClassStudent.ClassID;
            cmd.Parameters.Add("@AddedBy", SqlDbType.NVarChar).Value = sTD_ClassStudent.AddedBy;
            cmd.Parameters.Add("@AddedDate", SqlDbType.DateTime).Value = sTD_ClassStudent.AddedDate;
            cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = sTD_ClassStudent.UpdatedBy;
            cmd.Parameters.Add("@UpdateDate", SqlDbType.DateTime).Value = sTD_ClassStudent.UpdateDate;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return (int)cmd.Parameters["@Count"].Value;
        }
    }
Esempio n. 12
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            //insert the classes which are not assigned for that student
            string classIDsNeedtoAddinDataBase = "";

            hfclassIDs.Value = "";
            DataSet ds = STD_ClassStudentManager.GetSTD_ClassStudentByStudentID(hfStudentID.Value, true);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                hfclassIDs.Value += dr["ClassID"].ToString() + "-";
            }

            List<STD_ClassSubjectStudent> ClassSubjectStudents = new List<STD_ClassSubjectStudent>();
            ClassSubjectStudents = (List<STD_ClassSubjectStudent>)Session["ClassSubjectStudents"];

            foreach (STD_ClassSubjectStudent classSubjectStudent in ClassSubjectStudents)
            {
                if (!hfclassIDs.Value.Contains(classSubjectStudent.ClassID.ToString()))
                {
                    classIDsNeedtoAddinDataBase += classSubjectStudent.ClassID.ToString() + "-";
                }
            }

            if (classIDsNeedtoAddinDataBase != "")
            {
                string[] ids = classIDsNeedtoAddinDataBase.Split('-');
                foreach (string id in ids)
                {
                    if (id != "" && id != "-")
                    {
                        STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent();
                        //	sTD_ClassStudent.ClassStudentID=  int.Parse(ddlClassStudentID.SelectedValue);
                        sTD_ClassStudent.ClassStudentName = "";
                        sTD_ClassStudent.StudentID = hfStudentID.Value;
                        sTD_ClassStudent.ClassID = int.Parse(id);
                        sTD_ClassStudent.AddedBy = Profile.card_id;
                        sTD_ClassStudent.AddedDate = DateTime.Now;
                        sTD_ClassStudent.UpdatedBy = Profile.card_id;
                        sTD_ClassStudent.UpdateDate = DateTime.Now;
                        sTD_ClassStudent.RowStatusID = 1;
                        int resutl = STD_ClassStudentManager.InsertSTD_ClassStudent(sTD_ClassStudent);
                    }
                }
            }

            //Need to add the ClassSubject Student

            //insert the classes which are not assigned for that student
            string classSubjectIDsNeedtoAddinDataBase = "";

            hfclassIDs.Value = "";
            DataSet dsclassSubject = STD_ClassSubjectStudentManager.GetSTD_ClassSubjectStudentByStudentID(hfStudentID.Value);
            foreach (DataRow dr in dsclassSubject.Tables[0].Rows)
            {
                hfclassSubjectIDs.Value += dr["ClassSubjectID"].ToString() + "-";
            }

            foreach (STD_ClassSubjectStudent classSubjectStudent in ClassSubjectStudents)
            {
                if (!hfclassSubjectIDs.Value.Contains(classSubjectStudent.ClassSubjectID.ToString()))
                {
                    classSubjectIDsNeedtoAddinDataBase += classSubjectStudent.ClassSubjectID.ToString() + "-";
                }
            }

            if (classSubjectIDsNeedtoAddinDataBase != "")
            {
                string[] ids = classSubjectIDsNeedtoAddinDataBase.Split('-');
                foreach (string id in ids)
                {
                    if (id != "" && id != "-")
                    {
                        STD_ClassSubjectStudent sTD_ClassSubjectStudent = new STD_ClassSubjectStudent();
                        //	sTD_ClassSubjectStudent.ClassSubjectStudentID=  int.Parse(ddlClassSubjectStudentID.SelectedValue);
                        sTD_ClassSubjectStudent.ClassSubjectStudentName = "";
                        sTD_ClassSubjectStudent.StudentID = hfStudentID.Value;
                        sTD_ClassSubjectStudent.ClassSubjectID = int.Parse(id);
                        sTD_ClassSubjectStudent.AddedBy = Profile.card_id;
                        sTD_ClassSubjectStudent.AddedDate = DateTime.Now;
                        sTD_ClassSubjectStudent.UpdatedBy = Profile.card_id;
                        sTD_ClassSubjectStudent.UpdateDate = DateTime.Now;
                        sTD_ClassSubjectStudent.RowStatusID = 1;

                        int resutl = STD_ClassSubjectStudentManager.InsertSTD_ClassSubjectStudent(sTD_ClassSubjectStudent);
                    }
                }
            }
        }
        catch (Exception ex)
        {
        }
    }
Esempio n. 13
0
 private void showSTD_ClassStudentData()
 {
     STD_ClassStudent sTD_ClassStudent  = new STD_ClassStudent ();
      	sTD_ClassStudent = STD_ClassStudentManager.GetSTD_ClassStudentByClassStudentID(Int32.Parse(Request.QueryString["ID"]));
      	txtClassStudentName.Text =sTD_ClassStudent.ClassStudentName.ToString();
      	ddlStudentID.SelectedValue  =sTD_ClassStudent.StudentID.ToString();
      	ddlClassID.SelectedValue  =sTD_ClassStudent.ClassID.ToString();
 }
Esempio n. 14
0
    public bool UpdateSTD_ClassStudent(STD_ClassStudent sTD_ClassStudent)
    {
        using (SqlConnection connection = new SqlConnection(this.ConnectionString))
        {
            SqlCommand cmd = new SqlCommand("UpdateSTD_ClassStudent", connection);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@ClassStudentID", SqlDbType.Int).Value = sTD_ClassStudent.ClassStudentID;
            cmd.Parameters.Add("@ClassStudentName", SqlDbType.NVarChar).Value = sTD_ClassStudent.ClassStudentName;
            cmd.Parameters.Add("@StudentID", SqlDbType.NVarChar).Value = sTD_ClassStudent.StudentID;
            cmd.Parameters.Add("@ClassID", SqlDbType.Int).Value = sTD_ClassStudent.ClassID;
            //cmd.Parameters.Add("@ClassID", SqlDbType.Int).Value = sTD_ClassStudent.ClassID;
            //cmd.Parameters.Add("@ClassID", SqlDbType.Int).Value = sTD_ClassStudent.ClassID;
            cmd.Parameters.Add("@UpdatedBy", SqlDbType.NVarChar).Value = sTD_ClassStudent.UpdatedBy;
            cmd.Parameters.Add("@UpdateDate", SqlDbType.DateTime).Value = sTD_ClassStudent.UpdateDate;
            cmd.Parameters.Add("@RowStatusID", SqlDbType.Int).Value = sTD_ClassStudent.RowStatusID;
            connection.Open();

            int result = cmd.ExecuteNonQuery();
            return result == 1;
        }
    }
Esempio n. 15
0
 public static bool UpdateSTD_ClassStudent(STD_ClassStudent sTD_ClassStudent)
 {
     SqlSTD_ClassStudentProvider sqlSTD_ClassStudentProvider = new SqlSTD_ClassStudentProvider();
     return sqlSTD_ClassStudentProvider.UpdateSTD_ClassStudent(sTD_ClassStudent);
 }
Esempio n. 16
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //add Subject
        STD_Class sTD_Class = new STD_Class();
        try
        {

            //	sTD_Class.ClassID=  int.Parse(ddlClassID.SelectedValue);
            sTD_Class.ClassName = txtClassName.Text;
            sTD_Class.CourseID = int.Parse(ddlCourseID.SelectedValue);
            sTD_Class.ClassTypeID = 2;
            sTD_Class.ClassStatusID = 1;
            sTD_Class.AddedBy = Profile.card_id;
            sTD_Class.AddedDate = DateTime.Now;
            sTD_Class.UpdatedBy = Profile.card_id;
            sTD_Class.UpdateDate = DateTime.Now;
            sTD_Class.ClassID = STD_ClassManager.InsertSTD_Class(sTD_Class);
        }
        catch (Exception ex) { }

        //Add Student
        try {
            string ids = getStudentIDs(gvStudents);
            if (ids != "")
            {
                STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent();
                sTD_ClassStudent.ClassStudentName = "";
                sTD_ClassStudent.StudentID = ids;
                sTD_ClassStudent.ClassID = sTD_Class.ClassID;
                sTD_ClassStudent.AddedBy = Profile.card_id;
                sTD_ClassStudent.AddedDate = DateTime.Now;
                sTD_ClassStudent.UpdatedBy = Profile.card_id;
                sTD_ClassStudent.UpdateDate = DateTime.Now;
                int resutl = STD_ClassStudentManager.InsertSTD_ClassStudent_List_KeepStudentInMultipleClassActive(sTD_ClassStudent);

                //string message = resutl + " New Entry Created";
                //ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "Message", "alert('" + message + "');", true);

            }
        }
        catch (Exception ex) { }

        //Class Subject
        try
        {
            //delete all the rows for the
            STD_ClassSubjectManager.DeleteSTD_ClassSubjectByClassID(sTD_Class.ClassID);

            foreach (GridViewRow gr in gvSubject.Rows)
            {
                CheckBox chkSelect = (CheckBox)gr.FindControl("chkSelect");

                HiddenField hfSubjectID = (HiddenField)gr.FindControl("hfSubjectID");
                DropDownList ddlTeacherID = (DropDownList)gr.FindControl("ddlTeacherID");
                TextBox txtStartDate = (TextBox)gr.FindControl("txtStartDate");
                TextBox txtEndDate = (TextBox)gr.FindControl("txtEndDate");

                if (chkSelect.Checked)
                {
                    STD_ClassSubject sTD_ClassSubject = new STD_ClassSubject();
                    sTD_ClassSubject.ClassSubjectName = "1";
                    sTD_ClassSubject.SubjectID = int.Parse(hfSubjectID.Value);
                    sTD_ClassSubject.ClassID = sTD_Class.ClassID;
                    sTD_ClassSubject.ExtraField1 = txtStartDate.Text;
                    sTD_ClassSubject.ExtraField2 = txtEndDate.Text;
                    sTD_ClassSubject.ExtraField3 = "";
                    sTD_ClassSubject.ExtraField4 = "";
                    sTD_ClassSubject.ExtraField5 = "";
                    sTD_ClassSubject.AddedBy = Profile.card_id;
                    sTD_ClassSubject.AddedDate = DateTime.Now;
                    sTD_ClassSubject.UpdatedBy = Profile.card_id;
                    sTD_ClassSubject.UpdateDate = DateTime.Now;
                    sTD_ClassSubject.ClassSubjectID = STD_ClassSubjectManager.InsertSTD_ClassSubject(sTD_ClassSubject);

                    if (ddlTeacherID.SelectedIndex != 0)
                    {
                        STD_ClassSubjectEmployee sTD_ClassSubjectEmployee = new STD_ClassSubjectEmployee();
                        //	sTD_ClassSubjectEmployee.ClassSubjectEmployeeID=  int.Parse(ddlClassSubjectEmployeeID.SelectedValue);
                        sTD_ClassSubjectEmployee.ClassSubjectEmployeeName = "Need to fix later";
                        sTD_ClassSubjectEmployee.EmployeeID = ddlTeacherID.SelectedValue;
                        sTD_ClassSubjectEmployee.ClassSubjectID = sTD_ClassSubject.ClassSubjectID;
                        sTD_ClassSubjectEmployee.AddedBy = Profile.card_id;
                        sTD_ClassSubjectEmployee.AddedDate = DateTime.Now;
                        sTD_ClassSubjectEmployee.UpdatedBy = Profile.card_id;
                        sTD_ClassSubjectEmployee.UpdateDate = DateTime.Now;
                        sTD_ClassSubjectEmployee.ClassSubjectEmployeeID = STD_ClassSubjectEmployeeManager.InsertSTD_ClassSubjectEmployee(sTD_ClassSubjectEmployee);
                    }

                    //Add Student
                    try
                    {
                        string ids = getStudentIDs(gvStudents);
                        if (ids != "")
                        {
                            STD_ClassSubjectStudent sTD_ClassSubjectStudent = new STD_ClassSubjectStudent();
                            sTD_ClassSubjectStudent.ClassSubjectStudentName = "Need to fix later";
                            sTD_ClassSubjectStudent.StudentID = ids;
                            sTD_ClassSubjectStudent.ClassSubjectID = sTD_ClassSubject.ClassSubjectID;
                            sTD_ClassSubjectStudent.AddedBy = Profile.card_id;
                            sTD_ClassSubjectStudent.AddedDate = DateTime.Now;
                            sTD_ClassSubjectStudent.UpdatedBy = Profile.card_id;
                            sTD_ClassSubjectStudent.UpdateDate = DateTime.Now;
                            int resutl = STD_ClassSubjectStudentManager.InsertSTD_ClassSubjectStudent_List_KeepStudentInMultipleClassActive(sTD_ClassSubjectStudent);
                        }
                    }
                    catch (Exception ex) { }
                }
            }

        }
        catch (Exception ex) { }

        Response.Redirect("Enrollment.aspx?Message=Saved succfully..");
    }
Esempio n. 17
0
    public STD_ClassStudent GetSTD_ClassStudentFromReader(IDataReader reader)
    {
        try
        {
            STD_ClassStudent sTD_ClassStudent = new STD_ClassStudent
                (

                     DataAccessObject.IsNULL<int>(reader["ClassStudentID"]),
                     DataAccessObject.IsNULL<string>(reader["ClassStudentName"]),
                     DataAccessObject.IsNULL<string>(reader["StudentID"].ToString()),
                     DataAccessObject.IsNULL<int>(reader["ClassID"]),
                     DataAccessObject.IsNULL<string>(reader["AddedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["AddedDate"]),
                     DataAccessObject.IsNULL<string>(reader["UpdatedBy"].ToString()),
                     DataAccessObject.IsNULL<DateTime>(reader["UpdateDate"]),
                     DataAccessObject.IsNULL<int>(reader["RowStatusID"])
                );
             return sTD_ClassStudent;
        }
        catch(Exception ex)
        {
            return null;
        }
    }