예제 #1
0
    protected void ddlBoard_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlBoard.SelectedValue != "0")
        {
            DataSet ds = new DataSet();

            SYS_Board_BLogic objSys_Board = new SYS_Board_BLogic();
            ds = objSys_Board.BAL_SYS_Medium_BySchoolIDBoardID(Convert.ToInt32(ddlSchool.SelectedValue), Convert.ToInt32(ddlBoard.SelectedValue));

            DropDownFill DdlFilling = new DropDownFill();
            DdlFilling.BindDropDownByTable(ddlMedium, ds.Tables[0], "Medium", "MediumID");



            DDLDisable(ddlMedium, true);
            DDLDisable(ddlStandard, false);
            DDLDisable(ddlsubject, false);
            DDLDisable(ddltopic, false);
            DDLDisable(ddlchapter, false);
        }
        else
        {
            DDLDisable(ddlMedium, false);
            DDLDisable(ddlStandard, false);
            DDLDisable(ddlsubject, false);
            DDLDisable(ddltopic, false);
            DDLDisable(ddlchapter, false);
        }
    }
    protected void ddlSchool_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlSchool.SelectedIndex != 0)
        {
            DataSet ds = new DataSet();

            SYS_Board_BLogic objSys_Board = new SYS_Board_BLogic();
            ds = objSys_Board.BAL_SYS_Board_BySchoolID(Convert.ToInt32(ddlSchool.SelectedValue));

            DropDownFill DdlFilling = new DropDownFill();
            DdlFilling.BindDropDownByTable(ddlBoard, ds.Tables[0], "Board", "BoardID");
            ddlBoard.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
            ddlBoard.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
            Session["SchoolID"]     = Convert.ToInt32(ddlSchool.SelectedValue);
            Session["SchoolName"]   = ddlSchool.SelectedItem.ToString();
            ddlDisable(ddlBoard, true);
        }
        else
        {
            ddlDisable(ddlBoard, false);
            ddlDisable(ddlMedium, false);
            ddlDisable(ddlStandard, false);
            ddlDisable(ddlDivision, false);
        }
    }
예제 #3
0
    private void bindgrvSYS_Boarddetail()
    {
        SYS_Board     = new SYS_Board();
        BAL_SYS_Board = new SYS_Board_BLogic();

        DataSet dsSelect = new DataSet();

        dsSelect = BAL_SYS_Board.BAL_SYS_Board_Select(SYS_Board, "SelectAll");
        if (dsSelect.Tables.Count > 0)
        {
            string searchCondition = string.Empty;
            if (txtBoardSearch.Text != string.Empty)
            {
                searchCondition = "Board like '%" + txtBoardSearch.Text + "%'";
            }

            if (txtCodeSearch.Text != string.Empty)
            {
                if (searchCondition != string.Empty)
                {
                    searchCondition = searchCondition + " and ";
                }

                searchCondition = searchCondition + " Code like '%" + txtCodeSearch.Text + "%'";
            }

            if (rlstActive.SelectedValue == "0")
            {
                if (searchCondition != string.Empty)
                {
                    searchCondition = searchCondition + " and ";
                }

                searchCondition = searchCondition + " IsActive = 0";
            }
            else if (rlstActive.SelectedValue == "1")
            {
                if (searchCondition != string.Empty)
                {
                    searchCondition = searchCondition + " and ";
                }

                searchCondition = searchCondition + " IsActive = 1";
            }

            DataView dv = new DataView(dsSelect.Tables[0]);
            dv.RowFilter = searchCondition;

            DataSet dsSelectSub = new DataSet();
            dsSelectSub.Tables.Add(dv.ToTable());

            GridViewOperations GrvOperation = new GridViewOperations();
            GrvOperation.BindGridWithSorting(grvSYS_Boarddetail, dsSelectSub, this.SortField, this.SortDirection);
        }
        else
        {
            grvSYS_Boarddetail.DataSource = null;
            grvSYS_Boarddetail.DataBind();
        }
    }
예제 #4
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         SYS_Board             = new SYS_Board();
         BAL_SYS_Board         = new SYS_Board_BLogic();
         SYS_Board.board       = txtBoard.Text;
         SYS_Board.code        = txtCode.Text;
         SYS_Board.description = txtDescription.Text;
         SYS_Board.createdby   = Convert.ToInt32(Session["EmpolyeeID"]);
         SYS_Board.modifiedby  = Convert.ToInt32(Session["EmpolyeeID"]);
         int status = BAL_SYS_Board.BAL_SYS_Board_Insert(SYS_Board, "Insert");
         if (status == 1)
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record successfully inserted.')</script>", false);
         }
         else
         {
             ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record not inserted.')</script>", false);
         }
         bindgrvSYS_Boarddetail();
         RefereshPageControls();
         ClearControls();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     ////finally
     ////{ }
 }
    protected void ddlBoard_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlBoard.SelectedValue != "0")
        {
            DataSet ds = new DataSet();

            SYS_Board_BLogic objSys_Board = new SYS_Board_BLogic();
            ds = objSys_Board.BAL_SYS_Medium_BySchoolIDBoardID(Convert.ToInt32(ddlSchool.SelectedValue), Convert.ToInt32(ddlBoard.SelectedValue));

            DropDownFill DdlFilling = new DropDownFill();
            DdlFilling.BindDropDownByTable(ddlMedium, ds.Tables[0], "Medium", "MediumID");
            ddlMedium.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
            ddlMedium.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
            ddlDisable(ddlMedium, true);
            //ddlMedium.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
        }
        else
        {
            ddlDisable(ddlMedium, false);
            ddlDisable(ddlStandard, false);
            ddlDisable(ddlSubject, false);
            ddlDisable(ddlChapter, false);
            ddlDisable(ddlTopic, false);
            ddlDisable(ddlDivision, false);
        }
    }
    private void BindSubjectChapterTopic(int Step)
    {
        DataSet ds = new DataSet();

        SYS_Board_BLogic objSys_Board = new SYS_Board_BLogic();

        ds = objSys_Board.BAL_SYS_StdSubChapTopic_BySchoolIDBoardIDMediumid(Convert.ToInt32(ddlSchool.SelectedValue), Convert.ToInt32(ddlBoard.SelectedValue), Convert.ToInt32(ddlMedium.SelectedValue), Convert.ToInt32(ddlStandard.SelectedValue), Convert.ToInt32(ddlsubject.SelectedValue), 0);

        DropDownFill DdlFilling = new DropDownFill();

        if (Step <= 1)
        {
            if (ds.Tables.Count > 0)
            {
                DdlFilling.BindDropDownByTable(ddlStandard, ds.Tables[0], "Standard", "StandardID");
                DDLDisable(ddlStandard, true);
            }
        }
        if (Step <= 2)
        {
            if (ds.Tables.Count > 1)
            {
                DdlFilling.BindDropDownByTable(ddlsubject, ds.Tables[1], "Subject", "SubjectID");
                DDLDisable(ddlsubject, true);
            }
        }
    }
    protected void ddlMediumSecond_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (ddlMediumSecond.SelectedIndex != 0)
        {
            DataSet ds = new DataSet();

            SYS_Board_BLogic objSys_Board = new SYS_Board_BLogic();
            ds = objSys_Board.BAL_SYS_StdSubChapTopic_BySchoolIDBoardIDMediumid(this.SchoolID, Convert.ToInt32(ddlBoardSecond.SelectedValue), Convert.ToInt32(ddlMediumSecond.SelectedValue), Convert.ToInt32(null), Convert.ToInt32(null), Convert.ToInt32(null));

            DropDownFill DdlFilling = new DropDownFill();

            if (ds.Tables.Count > 0)
            {
                DdlFilling.BindDropDownByTable(ddlStandardSecond, ds.Tables[0], "Standard", "StandardID");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ddlStandardSecond.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
                    ddlStandardSecond.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
                    ddlDisable(ddlStandardSecond, true);
                }
            }
        }
        else
        {
            ddlDisable(ddlStandardSecond, false);
        }
    }
    private void BindSubjectChapterTopic(int Step)
    {
        DataSet ds = new DataSet();

        SYS_Board_BLogic objSys_Board = new SYS_Board_BLogic();

        ds = objSys_Board.BAL_SYS_StdSubChapTopic_BySchoolIDBoardIDMediumid(Convert.ToInt32(ddlSchool.SelectedValue), Convert.ToInt32(ddlBoard.SelectedValue), Convert.ToInt32(ddlMedium.SelectedValue), Convert.ToInt32(ddlStandard.SelectedValue), Convert.ToInt32(ddlSubject.SelectedValue), Convert.ToInt32(ddlChapter.SelectedValue));

        DdlFilling = new DropDownFill();
        if (Step <= 1)
        {
            if (ds.Tables.Count > 0)
            {
                DdlFilling.BindDropDownByTable(ddlStandard, ds.Tables[0], "Standard", "StandardID");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    ddlStandard.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
                    ddlStandard.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
                }
            }
        }
        if (Step <= 2)
        {
            if (ds.Tables.Count > 1)
            {
                DdlFilling.BindDropDownByTable(ddlSubject, ds.Tables[1], "Subject", "SubjectID");
                if (ds.Tables[1].Rows.Count > 0)
                {
                    ddlSubject.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
                    ddlSubject.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
                }
            }
        }
        if (Step <= 3)
        {
            if (ds.Tables.Count > 2)
            {
                DdlFilling.BindDropDownByTable(ddlChapter, ds.Tables[2], "Chapter", "ChapterID");
                if (ds.Tables[2].Rows.Count > 0)
                {
                    ddlChapter.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
                    ddlChapter.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
                }
            }
        }
        if (Step <= 4)
        {
            if (ds.Tables.Count > 3)
            {
                DdlFilling.BindDropDownByTable(ddlTopic, ds.Tables[3], "Topic", "TopicID");
                if (ds.Tables[3].Rows.Count > 0)
                {
                    ddlTopic.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
                    ddlTopic.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
                }
            }
        }
    }
    private void BindBoardDropdown(DropDownList ddlBoardSecond)
    {
        DataSet ds = new DataSet();

        SYS_Board_BLogic objSys_Board = new SYS_Board_BLogic();

        ds = objSys_Board.BAL_SYS_Board_BySchoolID(this.SchoolID);

        DropDownFill DdlFilling = new DropDownFill();

        DdlFilling.BindDropDownByTable(ddlBoardSecond, ds.Tables[0], "Board", "BoardID");
        ddlBoardSecond.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
        ddlBoardSecond.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
    }
    //protected void grdClassroomWiseAttendance_PageIndexChanging(object sender, GridViewPageEventArgs e)
    //{
    //    try
    //    {
    //        grdClassroomWiseAttendance.PageIndex = e.NewPageIndex;
    //        BindClassWiseAttendanceGrid();
    //    }
    //    catch (Exception ex)
    //    {
    //        WebMsg.Show(ex.Message);
    //    }
    //}

    //protected void ddlPageSelector_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    try
    //    {
    //        grdClassroomWiseAttendance.PageIndex = ((DropDownList)sender).SelectedIndex;
    //        BindClassWiseAttendanceGrid();
    //    }
    //    catch (Exception ex)
    //    {
    //        WebMsg.Show(ex.Message);
    //    }
    //}

    //protected void grdClassroomWiseAttendance_RowCreated(object sender, GridViewRowEventArgs e)
    //{
    //    try
    //    {
    //        if (e.Row.RowType == DataControlRowType.Pager)
    //        {
    //            GridViewOperations GrvOperation = new GridViewOperations();
    //            GrvOperation.SetPagerButtonStates(grdClassroomWiseAttendance, e.Row, this.Page);
    //        }
    //    }
    //    catch (Exception ex)
    //    {
    //        WebMsg.Show(ex.Message);
    //    }
    //}

    //protected void grdClassroomWiseAttendance_Sorting(object sender, GridViewSortEventArgs e)
    //{
    //    try
    //    {
    //        if (e.SortExpression.Trim() == this.SortField)
    //            this.SortDirection = (this.SortDirection == "descending" ? "ascending" : "descending");
    //        else
    //            this.SortDirection = "ascending";
    //        this.SortField = e.SortExpression;
    //        BindClassWiseAttendanceGrid();
    //        GridViewOperations GrvOperation = new GridViewOperations();
    //        GrvOperation.GrvSortingSetImage(e, grdClassroomWiseAttendance, this.SortDirection);
    //    }
    //    catch (Exception ex)
    //    {
    //        WebMsg.Show(ex.Message);
    //    }
    //}

    //protected void grdClassroomWiseAttendance_RowDataBound(object sender, GridViewRowEventArgs e)
    //{
    //    try
    //    {
    //        if (e.Row.RowType == DataControlRowType.DataRow)
    //        {
    //            for (int i = 1; i < e.Row.Cells.Count; i++)
    //            {
    //                e.Row.Cells[i].Text = "<a href='ClassroomAttendance.aspx?BMSID=" + DataBinder.Eval(e.Row.DataItem, "BMSID").ToString() + "&Division=" + DataBinder.Eval(e.Row.DataItem, "Division").ToString() + "&DivisionID=" + DataBinder.Eval(e.Row.DataItem, "DivisionID").ToString() + "&Attendance=" + DataBinder.Eval(e.Row.DataItem, "Attendance").ToString() + "'>" + e.Row.Cells[i].Text + "</a>";
    //            }
    //        }
    //    }
    //    catch (Exception ex)
    //    {
    //        WebMsg.Show(ex.Message.ToString());
    //    }
    //    finally
    //    {
    //    }
    //}

    #endregion

    #region "User Defined Functions"

    private void BindStandard(int Step)
    {
        DataSet ds = new DataSet();

        SYS_Board_BLogic objSys_Board = new SYS_Board_BLogic();

        ds = objSys_Board.BAL_SYS_Std_BySchoolIDBoardIDMediumid(Convert.ToInt32(ddlSchool.SelectedValue), Convert.ToInt32(ddlBoard.SelectedValue), Convert.ToInt32(ddlMedium.SelectedValue), Convert.ToInt32(ddlStandard.SelectedValue));

        DdlFilling = new DropDownFill();
        if (Step <= 1)
        {
            if (ds.Tables.Count > 0)
            {
                DdlFilling.BindDropDownByTable(ddlStandard, ds.Tables[0], "Standard", "StandardID");
                ddlStandard.Items.Insert(Convert.ToInt32(EnumFile.AssignValue.Zero), "-- Select --");
                ddlStandard.Items[0].Value = Convert.ToString((int)EnumFile.AssignValue.Zero);
                ddlDisable(ddlStandard, true);
            }
        }
    }
예제 #11
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        SYS_Board             = new SYS_Board();
        BAL_SYS_Board         = new SYS_Board_BLogic();
        SYS_Board.boardid     = Convert.ToInt32(ViewState["boardid"].ToString());
        SYS_Board.board       = txtBoardEdit.Text;
        SYS_Board.code        = txtCodeEdit.Text;
        SYS_Board.description = txtDescriptionEdit.Text;
        SYS_Board.createdby   = Convert.ToInt32(Session["EmpolyeeID"]);
        SYS_Board.modifiedby  = Convert.ToInt32(Session["EmpolyeeID"]);
        int status = BAL_SYS_Board.BAL_SYS_Board_Update(SYS_Board, "Update");

        if (status == 1)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record successfully updated.')</script>", false);
        }
        else
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Record not updated.')</script>", false);
        }
        RefereshPageControls();
    }
예제 #12
0
    protected void BtnActDeactSub_Click(object sender, EventArgs e)
    {
        int CountChecked = 0;

        string BoardIDStr = string.Empty;

        foreach (GridViewRow gr in grvSYS_Boarddetail.Rows)
        {
            CheckBox chk = new CheckBox();
            chk = (CheckBox)gr.FindControl("chkSelect");
            if (chk.Checked == true)
            {
                if (CountChecked == 0)
                {
                    BoardIDStr = grvSYS_Boarddetail.DataKeys[gr.RowIndex]["BoardID"].ToString();
                }
                else
                {
                    BoardIDStr = BoardIDStr + "," + grvSYS_Boarddetail.DataKeys[gr.RowIndex]["BoardID"].ToString();
                }

                CountChecked = CountChecked + 1;
            }
        }

        if (CountChecked == 0)
        {
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Please select one record to Active/Deactive.')</script>", false);
        }
        else
        {
            SYS_Board            = new SYS_Board();
            BAL_SYS_Board        = new SYS_Board_BLogic();
            SYS_Board.boardidStr = BoardIDStr;
            //////////////////////////////////////////
            if (rbActive.Checked == true)
            {
                SYS_Board.isactive = true;
            }

            if (rbDeactive.Checked == true)
            {
                SYS_Board.isactive = false;
            }

            status = BAL_SYS_Board.BAL_SYS_Board_Delete(SYS_Board, "UpdateStatus");
            if (status == 1)
            {
                string status1 = string.Empty;
                if (rbActive.Checked == true)
                {
                    status1 = "Active.";
                }
                else if (rbDeactive.Checked == true)
                {
                    status1 = "Deactive.";
                }
                string message = string.Format("Selected records successfully {0}", status1);
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('" + message + "')</script>", false);
                //////////////////////////////////////////////////
            }
            else
            {
                ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Message", "<script> alert('Selected record not Active/Deactive.')</script>", false);
            }
            RefereshPageControls();
        }
    }