Пример #1
0
        private void GridDataBind()
        {
            try
            {
                ApplicationResult objResult   = new ApplicationResult();
                SchoolBL          objSchoolBl = new SchoolBL();

                objResult = objSchoolBl.School_SelectAll(Convert.ToInt32(Session[ApplicationSession.TRUSTID]));
                if (objResult != null)
                {
                    if (objResult.resultDT.Rows.Count > 0)
                    {
                        gvSchool.DataSource = objResult.resultDT;
                        gvSchool.DataBind();
                        PanelGrid_VisibilityMode(1);
                    }
                    else
                    {
                        PanelGrid_VisibilityMode(2);
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }
Пример #2
0
        public void FetchImage()
        {
            try
            {
                #region Declaretion
                SchoolBL  objSchoolBl = new SchoolBL();
                DataTable dtSchool    = new DataTable();
                #endregion
                ApplicationResult objResultsEdit = new ApplicationResult();
                objResultsEdit = objSchoolBl.School_Select(Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));

                if (objResultsEdit != null)
                {
                    dtSchool = objResultsEdit.resultDT;
                    if (dtSchool.Rows.Count > 0)
                    {
                        ViewState["Bytes"] = dtSchool.Rows[0][SchoolBO.SCHOOL_SCHOOLLOGO];
                        if (ViewState["Bytes"].ToString() != "")
                        {
                            imgphoto.ImageUrl = "../Client.UI/GetImage.ashx?SchoolMID=" + Convert.ToInt32(Session[ApplicationSession.SCHOOLID]);
                        }
                        ViewState["Bytes"] = null;
                    }
                }
            }
            catch (Exception ex)
            {
                //DisplayErrorMsg("CommonError", ex);
            }
        }
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        private SchoolBL CreateSchoolBL()
        {
            var schoolRepository = new MockSchoolRepository();
            var schoolBL         = new SchoolBL(schoolRepository);

            schoolBL.InsertDepartment(new Department()
            {
                Name = "First Department", DepartmentID = 0, Administrator = 1, Person = new Instructor()
                {
                    FirstMidName = "Admin", LastName = "One"
                }
            });
            schoolBL.InsertDepartment(new Department()
            {
                Name = "Second Department", DepartmentID = 1, Administrator = 2, Person = new Instructor()
                {
                    FirstMidName = "Admin", LastName = "Two"
                }
            });
            schoolBL.InsertDepartment(new Department()
            {
                Name = "Third Department", DepartmentID = 2, Administrator = 3, Person = new Instructor()
                {
                    FirstMidName = "Admin", LastName = "Three"
                }
            });
            return(schoolBL);
        }
Пример #4
0
        public void bindSchool()
        {
            try
            {
                #region Bind School

                SchoolBL          objSchoolBL   = new SchoolBL();
                SchoolBO          objSchoolBO   = new SchoolBO();
                DocumentBL        objDocumentBl = new DocumentBL();
                Controls          objControls   = new Controls();
                ApplicationResult objResults    = new ApplicationResult();

                objResults = objSchoolBL.School_SelectAll_All();
                if (objResults != null)
                {
                    if (objResults.resultDT.Rows.Count > 0)
                    {
                        objControls.BindDropDown_ListBox(objResults.resultDT, ddlSchoolID, "SchoolNameEng", "SchoolMID");
                    }
                    ddlSchoolID.Items.Insert(0, new ListItem("-Select-", "-1"));
                }
                #endregion
            }
            catch (Exception ex)
            {
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }
Пример #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    #region Declaretion
                    SchoolBL  objSchoolBl = new SchoolBL();
                    DataTable dtSchool    = new DataTable();
                    #endregion
                    ApplicationResult objResultsEdit = new ApplicationResult();
                    objResultsEdit = objSchoolBl.School_Select(Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));

                    if (objResultsEdit != null)
                    {
                        dtSchool = objResultsEdit.resultDT;
                        if (dtSchool.Rows.Count > 0)
                        {
                            lblSchoolName.Text = dtSchool.Rows[0][SchoolBO.SCHOOL_SCHOOLNAMEENG].ToString();
                        }
                    }
                }
                catch (Exception ex)
                {
                    logger.Error("Error", ex);
                    ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
                }
            }
        }
Пример #6
0
        private void GridDataBind()
        {
            try
            {
                lblMsg.Visible = false;
                SchoolBL          objSchoolBL = new SchoolBL();
                ApplicationResult objResult   = new ApplicationResult();

                objResult = objSchoolBL.School_SelectAll(Convert.ToInt32(Session[ApplicationSession.TRUSTID]));
                if (objResult != null)
                {
                    DataTable dtCollege = new DataTable();
                    dtCollege = objResult.resultDT;
                    if (dtCollege.Rows.Count > 0)
                    {
                        grCollDetails.DataSource = dtCollege;
                        grCollDetails.DataBind();
                    }
                    else
                    {
                        lblMsg.Visible = true;
                        lblMsg.Text    = "No School Added";
                    }
                }
            }
            catch (Exception ex)
            {
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }
Пример #7
0
        public void BindEmployeeDataList()
        {
            ApplicationResult objResult   = new ApplicationResult();
            SchoolBL          objSchoolBl = new SchoolBL();

            objResult           = objSchoolBl.SchoolM_Select_InformationForReport(Convert.ToInt32(ddlSchoolName.SelectedValue));
            dlSchool.DataSource = objResult.resultDT;
            dlSchool.DataBind();
            dlSchool1.DataSource = objResult.resultDT;
            dlSchool1.DataBind();
            if (objResult.resultDT.Rows.Count > 0)
            {
                divSchool.Visible      = true;
                pnlSchoolInfo.Visible  = false;
                btnPrintDetail.Visible = true;
                btnBack1.Visible       = true;
            }
            else
            {
                divSchool.Visible      = false;
                btnPrintDetail.Visible = false;
                pnlSchoolInfo.Visible  = true;
                btnBack1.Visible       = false;
                ClearAll();
                ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('No Records Found.');", true);
            }
        }
        public void getSchoolName()
        {
            ApplicationResult objResult   = new ApplicationResult();
            Controls          objControls = new Controls();
            SchoolBL          objSchoolBl = new SchoolBL();

            objResult = objSchoolBl.School_SelectAll_ForDropDOwn(Convert.ToInt32(Session[ApplicationSession.TRUSTID]));
            if (objResult != null)
            {
                if (objResult.resultDT.Rows.Count > 0)
                {
                    objControls.BindDropDown_ListBox(objResult.resultDT, ddlSchool, "SchoolNameEng", "SchoolMID");
                }
                ddlSchool.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", ""));
            }
        }
Пример #9
0
        private void BindSchool()
        {
            SchoolBL          objSchoolBL = new SchoolBL();
            Controls          objControls = new Controls();
            ApplicationResult objResults  = new ApplicationResult();

            objResults = objSchoolBL.School_SelectAll(Convert.ToInt32(Session[ApplicationSession.TRUSTID]));
            if (objResults != null)
            {
                if (objResults.resultDT.Rows.Count > 0)
                {
                    objControls.BindDropDown_ListBox(objResults.resultDT, ddlSchool, "SchoolNameEng", "SchoolMID");
                }
                ddlSchool.Items.Insert(0, new ListItem("-Select-", ""));
            }
        }
Пример #10
0
        public void BindSchool()
        {
            var objSchoolBl = new SchoolBL();

            var objResult = objSchoolBl.School_SelectAll(Convert.ToInt32(ddlTrust.SelectedValue));

            if (objResult == null)
            {
                return;
            }
            if (objResult.resultDT.Rows.Count <= 0)
            {
                return;
            }

            _objControl.BindDropDown_ListBox(objResult.resultDT, ddlSchool, "SchoolNameEng", "SchoolMID");
            ddlSchool.Items.Insert(0, new ListItem("--Select--", ""));
        }
Пример #11
0
        public bool ValidateName()
        {
            SchoolBL          objSchoolBl = new SchoolBL();
            ApplicationResult objResults  = new ApplicationResult();

            if (ViewState["Mode"].ToString() == "Save")
            {
                objResults = objSchoolBl.School_ValidateName_SchoolName(txtSchoolName.Text, txtAbbreviation.Text, -1);
            }
            else
            {
                objResults = objSchoolBl.School_ValidateName_SchoolName(txtSchoolName.Text, txtAbbreviation.Text, Convert.ToInt32(ViewState["SchoolMID"].ToString()));
            }
            if (objResults.resultDT.Rows.Count > 0)
            {
                return(true);
            }
            return(false);
        }
Пример #12
0
        public void GetSchoolName()
        {
            ApplicationResult objResult   = new ApplicationResult();
            Controls          objControls = new Controls();
            SchoolBL          objSchoolBl = new SchoolBL();

            objResult = objSchoolBl.School_SelectAll_ForDropDOwn(Convert.ToInt32(Session[ApplicationSession.TRUSTID]));
            if (objResult != null)
            {
                objControls.BindDropDown_ListBox(objResult.resultDT, ddlSchoolName, "SchoolNameEng", "SchoolMID");
                if (objResult.resultDT.Rows.Count > 0)
                {
                }
                ddlSchoolName.Items.Insert(0, new ListItem("--Select--", ""));
                ddlClassName.Items.Insert(0, new ListItem("--Select--", ""));
                ddlSection.Items.Insert(0, new ListItem("--Select--", ""));
                ddlYear.Items.Insert(0, new ListItem("-Select-", "-1"));
                ddlDivisionName.Items.Insert(0, new ListItem("--Select--", ""));
            }
        }
Пример #13
0
        public void BindSchoolList()
        {
            ApplicationResult objResult   = new ApplicationResult();
            SchoolBL          objSchoolBL = new SchoolBL();

            objResult = objSchoolBL.School_M_ForListReport(Convert.ToInt32(Session[ApplicationSession.TRUSTID].ToString()));
            if (objResult.resultDT.Rows.Count > 0)
            {
                gvReport.DataSource = objResult.resultDT;
                gvReport.DataBind();

                divReport.Visible = true;
                //btnPrintDetail.Visible = true;
                lblTrust.Text = Session[ApplicationSession.TRUSTNAME].ToString();
            }
            else
            {
                divReport.Visible = false;
                ClearAll();
                ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('No Records Found.');", true);
            }
        }
Пример #14
0
        public void BindDEOReport()
        {
            ApplicationResult objResult   = new ApplicationResult();
            SchoolBL          objSchoolBL = new SchoolBL();

            objResult = objSchoolBL.SchoolWiseDEOReport_Patrak2(Convert.ToInt32(Session[ApplicationSession.SCHOOLID].ToString()));
            if (objResult.resultDT.Rows.Count > 0)
            {
                gvReport.DataSource = objResult.resultDT;
                gvReport.DataBind();
                gvReport1.DataSource = objResult.resultDT;
                gvReport1.DataBind();
                divReport.Visible  = true;
                lblTrustName.Text  = Session[ApplicationSession.TRUSTNAME].ToString();
                lblSchoolName.Text = Session[ApplicationSession.SCHOOLNAME].ToString();
                lblTrust.Text      = Session[ApplicationSession.TRUSTNAME].ToString();
                lblSchool.Text     = Session[ApplicationSession.SCHOOLNAME].ToString();
            }
            else
            {
                divReport.Visible = false;
                ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('No Records Found.');", true);
            }
        }
Пример #15
0
        public void BindAcademicYear()
        {
            try
            {
                #region Fetch Academic Month from School
                SchoolBL          objSchoolBl = new SchoolBL();
                ApplicationResult objResults  = new ApplicationResult();
                int intMonth = 0;

                objResults = objSchoolBl.School_Select(Convert.ToInt32(Session[ApplicationSession.SCHOOLID]));

                if (objResults != null)
                {
                    if (objResults.resultDT.Rows.Count > 0)
                    {
                        intMonth = Convert.ToInt32(objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ACADEMICMONTH].ToString());
                    }
                }
                #endregion

                Controls objControls  = new Controls();
                int      month        = System.DateTime.Now.Month;
                int      Year         = System.DateTime.Now.Year;
                int      lastTwoDigit = Year % 100;
                string   yr           = string.Empty;
                if (month >= intMonth)
                {
                    yr = (lastTwoDigit.ToString() + (lastTwoDigit + 1).ToString()).ToString();
                }
                else
                {
                    yr = ((lastTwoDigit - 1).ToString() + lastTwoDigit.ToString()).ToString();
                }

                int f = (Convert.ToInt32(yr.Substring(0, 2)));
                int l = (Convert.ToInt32(yr.Substring(2, 2)));

                DataTable dt = new DataTable();
                DataRow   dr = null;
                dt.Columns.Add(new DataColumn("AcademicYear", typeof(string)));

                for (int i = 0; i < 5; i++)
                {
                    dr = dt.NewRow();
                    if (i == 0)
                    {
                        dr["AcademicYear"] = Convert.ToString(f.ToString() + "-" + l.ToString());
                        dt.Rows.Add(dr);
                    }
                    else
                    {
                        if ((f - 1).ToString().Length < 2)
                        {
                            if (f.ToString().Length == 2)
                            {
                                dr["AcademicYear"] = Convert.ToString("0" + (f - 1).ToString() + "-" + (f).ToString());
                            }
                            else
                            {
                                dr["AcademicYear"] = Convert.ToString("0" + (f - 1).ToString() + "-" + "0" + (f).ToString());
                            }
                            dt.Rows.Add(dr);
                        }
                        else
                        {
                            dr["AcademicYear"] = Convert.ToString((f - 1).ToString() + "-" + (f).ToString());
                            dt.Rows.Add(dr);
                        }
                        f = f - 1;
                        l = f;
                    }
                }

                objControls.BindDropDown_ListBox(dt, ddlAcademicYear, "AcademicYear", "AcademicYear");
            }
            catch (Exception ex)
            {
                //logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }
Пример #16
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                RoleRightsBO      objRoleRightsBO  = new RoleRightsBO();
                RoleRightsBL      objRoleRightsBL  = new RoleRightsBL();
                ApplicationResult objResultsInsert = new ApplicationResult();
                ApplicationResult objResultsSelect = new ApplicationResult();
                ApplicationResult objResultsDelete = new ApplicationResult();
                DataTable         dtRoleRights     = new DataTable();
                int      j = 0;
                CheckBox chk;
                for (int i = 0; i < gvSelectRights.Rows.Count; i++)
                {
                    objResultsSelect = objRoleRightsBL.RoleRights_T_Select(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), 0, Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                    chk = (CheckBox)gvSelectRights.Rows[i].Cells[2].FindControl("chkRights");
                    if (chk.Checked == true)
                    {
                        if (rblSelect.SelectedValue == "0")
                        {
                            if (objResultsSelect != null)
                            {
                                if (objResultsSelect.resultDT.Rows.Count > 0)
                                {
                                }
                                else
                                {
                                    objRoleRightsBO.RoleID    = Convert.ToInt32(ddlRole.SelectedValue);
                                    objRoleRightsBO.TrustMID  = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                                    objRoleRightsBO.SchoolMID = 0;
                                    objRoleRightsBO.ScreenID  = Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text);
                                    objResultsInsert          = objRoleRightsBL.RoleRights_Insert(objRoleRightsBO);
                                    if (Convert.ToInt32(gvSelectRights.Rows[i].Cells[1].Text) == 1)
                                    {
                                        ApplicationResult objResults = new ApplicationResult();
                                        SchoolBL          objSchool  = new SchoolBL();
                                        objResults = objSchool.School_SelectAll(Convert.ToInt32(Session[ApplicationSession.TRUSTID]));
                                        if (objResults != null)
                                        {
                                            if (objResults.resultDT.Rows.Count > 0)
                                            {
                                                foreach (DataRow dt in objResults.resultDT.Rows)
                                                {
                                                    objRoleRightsBO.RoleID    = Convert.ToInt32(ddlRole.SelectedValue);
                                                    objRoleRightsBO.TrustMID  = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                                                    objRoleRightsBO.SchoolMID = Convert.ToInt32(dt[0].ToString());
                                                    objRoleRightsBO.ScreenID  = Convert.ToInt32(Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                                                    objResultsInsert          = objRoleRightsBL.RoleRights_Insert(objRoleRightsBO);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        else
                        {
                            objRoleRightsBO.RoleID    = Convert.ToInt32(ddlRole.SelectedValue);
                            objRoleRightsBO.TrustMID  = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                            objRoleRightsBO.SchoolMID = Convert.ToInt32(ViewState["SchoolMID"].ToString());
                            objRoleRightsBO.ScreenID  = Convert.ToInt32(Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                            objResultsInsert          = objRoleRightsBL.RoleRights_Insert(objRoleRightsBO);
                        }
                    }
                    else
                    {
                        if (rblSelect.SelectedValue == "0")
                        {
                            dtRoleRights = objResultsSelect.resultDT;
                            if (objResultsSelect.resultDT.Rows.Count > 0)
                            {
                                objResultsDelete = objRoleRightsBL.RoleRights_Delete(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), 0, Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                            }
                        }
                        else
                        {
                            objResultsDelete = objRoleRightsBL.RoleRights_Delete(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ViewState["SchoolMID"].ToString()), Convert.ToInt32(gvSelectRights.Rows[i].Cells[0].Text));
                        }
                    }
                }

                if (objResultsInsert.status == ApplicationResult.CommonStatusType.SUCCESS)
                {
                    ClearAll();
                    BindScreen();
                    lblMsg.Visible = true;
                    lblMsg.Text    = "Roles Applied Successfully";
                }

                //objResultsSelect = objRoleRightsBL.RoleRights_Select(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ViewState["SchoolMID"].ToString()));
                //if (objResultsSelect != null)
                //{
                //    dtRoleRights = objResultsSelect.resultDT;
                //    if (dtRoleRights.Rows.Count > 0)
                //    {
                //        // objResultsDelete = objRoleRightsBL.RoleRights_Delete(Convert.ToInt32(ddlRole.SelectedValue), Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ViewState["SchoolMID"].ToString()));
                //    }
                //}

                //for (int i = 0; i < gvSelectRights.Rows.Count; i++)
                //{
                //    chk = (CheckBox)gvSelectRights.Rows[i].Cells[2].FindControl("chkRights");
                //    if (chk.Checked == true)
                //    {
                //        objRoleRightsBO.RoleID = Convert.ToInt32(ddlRole.SelectedValue);
                //        objRoleRightsBO.TrustMID = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                //        objRoleRightsBO.SchoolMID = Convert.ToInt32(ViewState["SchoolMID"].ToString());
                //        objRoleRightsBO.ScreenID = Convert.ToInt32(gvSelectRights.Rows[i].Cells[1].Text);
                //        objResultsInsert = objRoleRightsBL.RoleRights_Insert(objRoleRightsBO);
                //    }
                //}

                //
            }
            catch (Exception ex)
            {
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical Problem. Contact to your Administrator.');</script>");
            }
        }
Пример #17
0
        public void ProcessRequest(HttpContext context)
        {
            DataTable         dtResult      = new DataTable();
            SchoolBL          objSchoolBL   = new SchoolBL();
            StudentBL         objStudentBL  = new StudentBL();
            EmployeeMBL       objEmployeeBL = new EmployeeMBL();
            TrustBL           objTrustBL    = new TrustBL();
            ApplicationResult objResult     = new ApplicationResult();
            Controls          objControl    = new Controls();

            byte[] imgByte = { };
            if (context.Request.QueryString["StudentMID"] != null)
            {
                objResult = objStudentBL.Student_Select(Convert.ToInt32(context.Request.QueryString["StudentMID"].ToString()), 0);
                if (objResult != null)
                {
                    if (objResult.resultDT.Rows.Count > 0)
                    {
                        imgByte = (byte[])objResult.resultDT.Rows[0]["StudentPhoto"];
                    }
                }
            }
            else if (context.Request.QueryString["SchoolMID"] != null)
            {
                objResult = objSchoolBL.School_Select(Convert.ToInt32(context.Request.QueryString["SchoolMID"].ToString()));
                if (objResult != null)
                {
                    if (objResult.resultDT.Rows.Count > 0)
                    {
                        imgByte = (byte[])objResult.resultDT.Rows[0]["SchoolLogo"];
                    }
                }
            }
            else if (context.Request.QueryString["EmployeeMID"] != null)
            {
                objResult = objEmployeeBL.EmployeeM_Select(Convert.ToInt32(context.Request.QueryString["EmployeeMID"].ToString()));
                if (objResult != null)
                {
                    if (objResult.resultDT.Rows.Count > 0)
                    {
                        imgByte = (byte[])objResult.resultDT.Rows[0]["Photo"];
                    }
                }
            }
            else
            {
                objResult = objTrustBL.Trust_Select(Convert.ToInt32(context.Request.QueryString["TrustMID"].ToString()));
                if (objResult != null)
                {
                    if (objResult.resultDT.Rows.Count > 0)
                    {
                        imgByte = (byte[])objResult.resultDT.Rows[0]["TrustLogo"];
                    }
                }
            }

            // objResult = objVisitorBL.Visitor_Select(1);


            context.Response.BinaryWrite(imgByte);
            context.Response.End();
            context.Response.Clear();
            context.Response.ClearHeaders();
            context.Response.ClearContent();
        }
Пример #18
0
        protected void ddlSchoolName_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                ApplicationResult objResult    = new ApplicationResult();
                Controls          objControls  = new Controls();
                SectionBL         objSectionBl = new SectionBL();

                objResult = objSectionBl.Section_SelectAll_ForDropDown(Convert.ToInt32(ddlSchoolName.SelectedValue));
                if (objResult != null)
                {
                    objControls.BindDropDown_ListBox(objResult.resultDT, ddlSection, "SectionName", "SectionMID");
                    if (objResult.resultDT.Rows.Count > 0)
                    {
                    }
                    ddlSection.Items.Insert(0, new ListItem("--Select--", ""));
                }

                #region Fetch Academic Month from School
                SchoolBL          objSchoolBl = new SchoolBL();
                ApplicationResult objResults  = new ApplicationResult();
                int intMonth = 0;

                objResults = objSchoolBl.School_Select(Convert.ToInt32(ddlSchoolName.SelectedValue));

                if (objResults != null)
                {
                    if (objResults.resultDT.Rows.Count > 0)
                    {
                        intMonth = Convert.ToInt32(objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ACADEMICMONTH].ToString());
                    }
                }
                #endregion


                int    month        = System.DateTime.Now.Month;
                int    Year         = System.DateTime.Now.Year;
                int    lastTwoDigit = Year % 100;
                string yr           = string.Empty;
                if (month >= intMonth)
                {
                    yr = (lastTwoDigit.ToString() + (lastTwoDigit + 1).ToString()).ToString();
                }
                else
                {
                    yr = ((lastTwoDigit - 1).ToString() + lastTwoDigit.ToString()).ToString();
                }

                int f = (Convert.ToInt32(yr.Substring(0, 2)));
                int l = (Convert.ToInt32(yr.Substring(2, 2)));

                DataTable dt = new DataTable();
                DataRow   dr = null;
                dt.Columns.Add(new DataColumn("AcademicYear", typeof(string)));

                for (int i = 0; i < 5; i++)
                {
                    dr = dt.NewRow();
                    if (i == 0)
                    {
                        dr["AcademicYear"] = Convert.ToString(f.ToString() + "-" + l.ToString());
                        dt.Rows.Add(dr);
                    }
                    else
                    {
                        if ((f - 1).ToString().Length < 2)
                        {
                            if (f.ToString().Length == 2)
                            {
                                dr["AcademicYear"] = Convert.ToString("0" + (f - 1).ToString() + "-" + (f).ToString());
                            }
                            else
                            {
                                dr["AcademicYear"] = Convert.ToString("0" + (f - 1).ToString() + "-" + "0" + (f).ToString());
                            }
                            dt.Rows.Add(dr);
                        }
                        else
                        {
                            dr["AcademicYear"] = Convert.ToString((f - 1).ToString() + "-" + (f).ToString());
                            dt.Rows.Add(dr);
                        }
                        f = f - 1;
                        l = f;
                    }
                }

                objControls.BindDropDown_ListBox(dt, ddlYear, "AcademicYear", "AcademicYear");
                ddlYear.Items.Insert(0, new ListItem("-Select-", "-1"));
            }
            catch (Exception)
            {
                throw;
            }
        }
Пример #19
0
        protected void gvSchool_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                SchoolBO          objSchoolBo = new SchoolBO();
                SchoolBL          objSchoolBl = new SchoolBL();
                TrustBL           objTrustBl  = new TrustBL();
                ApplicationResult objResults  = new ApplicationResult();
                BankAssociationBL objBankBl   = new BankAssociationBL();
                Controls          objControls = new Controls();

                ViewState["SchoolMID"] = Convert.ToInt32(e.CommandArgument.ToString());

                objResults = objTrustBl.Abbreviation_Validation(0, Convert.ToInt32(ViewState["SchoolMID"].ToString()), 0);

                if (objResults != null)
                {
                    if (objResults.resultDT.Rows.Count > 0)
                    {
                        txtAbbreviation.Enabled = false;
                    }
                    else
                    {
                        txtAbbreviation.Enabled = true;
                    }
                }
                objSchoolBo.TrustMID = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                if (e.CommandName.ToString() == "Edit1")
                {
                    // txtAccStartDate.Enabled = false;
                    objResults = objSchoolBl.School_Select(Convert.ToInt32(ViewState["SchoolMID"].ToString()));

                    if (objResults != null)
                    {
                        if (objResults.resultDT.Rows.Count > 0)
                        {
                            txtSchoolName.Text             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLNAMEENG].ToString();
                            txtSchoolNameGuj.Text          = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLNAMEGUJ].ToString();
                            txtSchoolTiming.Text           = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLTIMING].ToString();
                            ddlAcademicMonth.SelectedValue = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ACADEMICMONTH].ToString();
                            txtSchoolCode.Text             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLCODE].ToString();
                            ViewState["Bytes"]             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLLOGO];
                            if (ViewState["Bytes"].ToString() != "")
                            {
                                imgphoto.ImageUrl = "GetImage.ashx?SchoolMID=" + ViewState["SchoolMID"];
                            }
                            else
                            {
                                imgphoto.ImageUrl = "~/images/noimage-big.jpg";
                                //lbtnRemovePhoto.Visible = false;
                            }
                            txtAbbreviation.Text     = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLABBREVIATION].ToString();
                            txtAccStartDate.Text     = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ACCOUNTSTARTDATE].ToString();
                            txtSchoolAddress.Text    = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ADDRESSENG].ToString();
                            txtSchoolAddressGuj.Text = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ADDRESSGUJ].ToString();
                            if (objResults.resultDT.Rows[0][SchoolBO.SCHOOL_AREATYPE].ToString() == "")
                            {
                                //rblAreaType.SelectedItem.Text = "";
                            }
                            else
                            {
                                rblAreaType.SelectedValue = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_AREATYPE].ToString();
                            }
                            if (objResults.resultDT.Rows[0][SchoolBO.SCHOOL_AREASUBTYPE].ToString() == "")
                            {
                                //rblAreaSubType.SelectedItem.Text = "";
                            }
                            else
                            {
                                rblAreaSubType.SelectedValue = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_AREASUBTYPE].ToString();
                            }

                            txtTown.Text                = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_TOWNENG].ToString();
                            txtTownGuj.Text             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_TOWNGUJ].ToString();
                            txtATPOEng.Text             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ATPONOENG].ToString();
                            txtATPOGuj.Text             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ATPONOGUJ].ToString();
                            txtTalukaEng.Text           = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_TALUKAENG].ToString();
                            txttalukaGuj.Text           = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_TALUKAGUJ].ToString();
                            txtDistrict.Text            = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_DISTRICTENG].ToString();
                            txtDistrictGuj.Text         = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_DISTRICTGUJ].ToString();
                            txtState.Text               = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_STATEENG].ToString();
                            txtStateGuj.Text            = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_STATEGUJ].ToString();
                            txtCountry.Text             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_COUNTRYENG].ToString();
                            txtCountryGuj.Text          = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_COUNTRYGUJ].ToString();
                            txtPinCode.Text             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_PINCODE].ToString();
                            txtTelephoneNo.Text         = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_TELEPHONENO].ToString();
                            txtMobileNo.Text            = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_MOBILENO].ToString();
                            txtEmailID.Text             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_EMAILID].ToString();
                            txtAlternateEmail.Text      = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ALTERNATEEMAILID].ToString();
                            txtFax.Text                 = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_FAXNO].ToString();
                            txtWebsite.Text             = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_WEBSITE].ToString();
                            txtSSCIndexNo.Text          = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SSCINDEXNO].ToString();
                            txtCommerceIndexNo.Text     = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_HSCCOMMERCEINDEXNO].ToString();
                            txtScienceIndexNo.Text      = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_HSCSCIENCEINDEXNO].ToString();
                            txtArtsIndexNo.Text         = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_HSCARTSINDEXNO].ToString();
                            txtRegistrationCode.Text    = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_REGISTRATIONCODE].ToString();
                            txtRegistrationName.Text    = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_REGISTEREDNAMEENG].ToString();
                            txtRegistrationCodeGuj.Text = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_REGISTREREDNAMEGUJ].ToString();
                            // txtRegisteredAddress.Text = dtSchool.Rows[0][SchoolBO.SCHOOL_REGISTEREDADDRESSENG].ToString();
                            txtRegisteredddressGuj.Text = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_REGISTEREDADDRESSGUJ].ToString();
                            txtSchoolMotto.Text         = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLMOTTOENG].ToString();
                            txtSchoolMottoGuj.Text      = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLMOTTOGUJ].ToString();
                            txtSchoolVision.Text        = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLVISIONENG].ToString();
                            txtSchoolVisionGuj.Text     = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_SCHOOLVISIONGUJ].ToString();
                            if (Convert.ToInt32(objResults.resultDT.Rows[0][SchoolBO.SCHOOL_ISONRENT].ToString()) == 1)
                            {
                                chkIsRent.Checked = true;
                            }
                            else
                            {
                                chkIsRent.Checked = false;
                            }
                            txtOwnerName.Text        = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_OWNERNAMEENG].ToString();
                            txtOwnerNameGuj.Text     = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_OWNERNAMEGUJ].ToString();
                            txtOwnerAddress.Text     = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_OWNERADDRESSENG].ToString();
                            txtOwnerAddressGuj.Text  = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_OWNERADDRESSGUJ].ToString();
                            txtWordNo.Text           = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_WORDNO].ToString();
                            txtWordName.Text         = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_WORDNAMEENG].ToString();
                            txtWardNameGuj.Text      = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_WORDNAMEGUJ].ToString();
                            txtPlotNo.Text           = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_PLOTNO].ToString();
                            txtPlotArea.Text         = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_PLOTAREA].ToString();
                            ddlConstructionYear.Text = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_CONSTRUNCTIONYEAR].ToString();
                            txtNoOfFloor.Text        = objResults.resultDT.Rows[0][SchoolBO.SCHOOL_NOOFFLOORS].ToString();

                            ApplicationResult objResultsBankEdit = new ApplicationResult();
                            DataTable         dtBankAssociation  = new DataTable();
                            objResultsBankEdit = objBankBl.BankAssociation_Select_TrustMID(0, Convert.ToInt32(ViewState["SchoolMID"].ToString()));
                            if (objResultsBankEdit != null)
                            {
                                dtBankAssociation = objResultsBankEdit.resultDT;
                                if (dtBankAssociation.Rows.Count > 0)
                                {
                                    gvbankAssociation.Visible = true;

                                    gvbankAssociation.DataSource = dtBankAssociation;
                                    gvbankAssociation.DataBind();
                                }
                                ViewState["dtBank"] = dtBankAssociation;
                            }
                            ViewState["Mode"] = "Edit1";
                            PanelGrid_VisibilityMode(2);
                        }
                    }
                }
                else if ((e.CommandName.ToString() == "Delete1"))
                {
                    objControls.EnableControls(Master.FindControl("ContentPlaceHolder1"));

                    objResults = objSchoolBl.Validate_School_Delete(Convert.ToInt32(ViewState["SchoolMID"].ToString()));
                    if (objResults != null)
                    {
                        if (objResults.resultDT.Rows.Count > 0)
                        {
                            if (Convert.ToInt32(objResults.resultDT.Rows[1]["SchoolMID"]) == Convert.ToInt32(ViewState["SchoolMID"].ToString()))
                            {
                                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('There are Section(s)/Student(s) associated with this School. To delete this School you need to delete Section(s)/Student(s) first.');</script>");
                                goto Exit;
                            }
                        }
                    }
                    ApplicationResult objResultsDelete     = new ApplicationResult();
                    ApplicationResult objResultsBankDelete = new ApplicationResult();
                    objResultsDelete = objSchoolBl.School_Delete(Convert.ToInt32(e.CommandArgument.ToString()));
                    if (objResultsDelete.status == ApplicationResult.CommonStatusType.SUCCESS)
                    {
                        ClearAll();
                        ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script language='JavaScript'>alert('School deleted successfully.');</script>");
                        GridDataBind();
                    }
                }

                Exit :;
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }
Пример #20
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                ApplicationResult objResults  = new ApplicationResult();
                SchoolBO          objSchoolBo = new SchoolBO();
                SchoolBL          objSchoolBl = new SchoolBL();
                BankAssociationBL objBankBl   = new BankAssociationBL();
                DataTable         dt          = new DataTable();
                Controls          objControls = new Controls();

                objSchoolBo.TrustMID = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                //objSchoolBo.SchoolMID = Convert.ToInt32(ViewState["SchoolMID"].ToString());
                objSchoolBo.SchoolNameEng = txtSchoolName.Text;
                objSchoolBo.SchoolNameGuj = txtSchoolNameGuj.Text;
                objSchoolBo.SchoolTiming  = txtSchoolTiming.Text;
                objSchoolBo.AcademicMonth = Convert.ToInt32(ddlAcademicMonth.SelectedValue);
                objSchoolBo.SchoolCode    = txtSchoolCode.Text;
                if (ViewState["Bytes"] != null)
                {
                    objSchoolBo.SchoolLogo = (byte[])ViewState["Bytes"];
                }
                else
                {
                    objSchoolBo.SchoolLogo = ImageToByteArrayFromFilePath("../Images/NoImage-big.jpg");
                }
                objSchoolBo.SchoolAbbreviation = txtAbbreviation.Text;
                objSchoolBo.AccountStartDate   = txtAccStartDate.Text;
                objSchoolBo.AddressEng         = txtSchoolAddress.Text;
                objSchoolBo.AddressGuj         = txtSchoolAddressGuj.Text;
                if (rblAreaType.SelectedItem != null)
                {
                    objSchoolBo.AreaType = rblAreaType.SelectedItem.Text;
                    if (objSchoolBo.AreaType == "Village Area")
                    {
                        objSchoolBo.AreaTypeGuj = "ગ્રામ્ય પંચાયત";
                    }
                    else if (objSchoolBo.AreaType == "Town Area")
                    {
                        objSchoolBo.AreaTypeGuj = "નગર પંચાયત";
                    }
                    else if (objSchoolBo.AreaType == "City Area")
                    {
                        objSchoolBo.AreaTypeGuj = "નગર પાલિકા";
                    }
                    else if (objSchoolBo.AreaType == "Notified Area")
                    {
                        objSchoolBo.AreaTypeGuj = "સૂચિત વિસ્તાર";
                    }
                }
                else
                {
                    objSchoolBo.AreaType    = "";
                    objSchoolBo.AreaTypeGuj = "";
                }
                if (rblAreaSubType.SelectedItem != null)
                {
                    objSchoolBo.AreaSubType = rblAreaSubType.SelectedItem.ToString();
                    if (objSchoolBo.AreaSubType == "Non Adivasi Area")
                    {
                        objSchoolBo.AreaSubTypeGuj = "બિન આદિવાસી વિસ્તાર";
                    }
                    else if (objSchoolBo.AreaSubType == "Economically Backward Area")
                    {
                        objSchoolBo.AreaSubTypeGuj = "આર્થિક રીતે પછાત વિસ્તાર";
                    }
                    else if (objSchoolBo.AreaSubType == "Frontier Area")
                    {
                        objSchoolBo.AreaSubTypeGuj = "આર્થિક સરહદી વિસ્તાર";
                    }
                    //objSchoolBo.AreaSubTypeGuj = rblAreaSubType.SelectedValue.ToString();
                }
                else
                {
                    objSchoolBo.AreaSubType    = "";
                    objSchoolBo.AreaSubTypeGuj = "";
                }

                objSchoolBo.TownEng            = txtTown.Text;
                objSchoolBo.TownGuj            = txtTownGuj.Text;
                objSchoolBo.AtPoNoEng          = txtATPOEng.Text;
                objSchoolBo.AtPoNoGuj          = txtATPOGuj.Text;
                objSchoolBo.TalukaEng          = txtTalukaEng.Text;
                objSchoolBo.TalukaGuj          = txttalukaGuj.Text;
                objSchoolBo.DistrictEng        = txtDistrict.Text;
                objSchoolBo.DistrictGuj        = txtDistrictGuj.Text;
                objSchoolBo.StateEng           = txtState.Text;
                objSchoolBo.StateGuj           = txtStateGuj.Text;
                objSchoolBo.CountryEng         = txtCountry.Text;
                objSchoolBo.CountryGuj         = txtCountryGuj.Text;
                objSchoolBo.Pincode            = txtPinCode.Text;
                objSchoolBo.TelephoneNo        = txtTelephoneNo.Text;
                objSchoolBo.MobileNo           = txtMobileNo.Text;
                objSchoolBo.EmailID            = txtEmailID.Text;
                objSchoolBo.AlternateEmailID   = txtAlternateEmail.Text;
                objSchoolBo.FaxNo              = txtFax.Text;
                objSchoolBo.Website            = txtWebsite.Text;
                objSchoolBo.SSCindexNo         = txtSSCIndexNo.Text;
                objSchoolBo.HSCScienceIndexNo  = txtScienceIndexNo.Text;
                objSchoolBo.HSCCommerceIndexNo = txtCommerceIndexNo.Text;
                objSchoolBo.HSCArtsIndexNo     = txtArtsIndexNo.Text;
                objSchoolBo.RegistrationCode   = txtRegistrationCode.Text;
                objSchoolBo.RegisteredNameEng  = txtRegistrationName.Text;
                objSchoolBo.RegistreredNameGuj = txtRegistrationCodeGuj.Text;
                // objSchoolBo.RegisteredAddressEng = txtRegisteredAddress.Text;
                objSchoolBo.RegisteredAddressGuj = txtRegisteredddressGuj.Text;
                objSchoolBo.SchoolMottoEng       = txtSchoolMotto.Text;
                objSchoolBo.SchoolMottoGuj       = txtSchoolMottoGuj.Text;
                objSchoolBo.SchoolVisionEng      = txtSchoolVision.Text;
                objSchoolBo.SchoolVisionGuj      = txtSchoolVisionGuj.Text;
                if (chkIsRent.Checked == true)
                {
                    objSchoolBo.IsOnRent = 1;
                }
                else
                {
                    objSchoolBo.IsOnRent = 0;
                }
                objSchoolBo.OwnerNameEng      = txtOwnerName.Text;
                objSchoolBo.OwnerNameGuj      = txtOwnerNameGuj.Text;
                objSchoolBo.OwnerAddressEng   = txtOwnerAddress.Text;
                objSchoolBo.OwnerAddressGuj   = txtOwnerAddressGuj.Text;
                objSchoolBo.WordNo            = txtWordNo.Text;
                objSchoolBo.WordNameEng       = txtWordName.Text;
                objSchoolBo.WordNameGuj       = txtWardNameGuj.Text;
                objSchoolBo.PlotNo            = txtPlotNo.Text;
                objSchoolBo.PlotArea          = txtPlotArea.Text;
                objSchoolBo.ConstrunctionYear = ddlConstructionYear.SelectedItem.ToString();
                objSchoolBo.NoOfFloors        = txtNoOfFloor.Text;
                objSchoolBo.AuditList         = "";

                objSchoolBo.LastModifiedDate   = DateTime.UtcNow.AddHours(5.5).ToString();
                objSchoolBo.LastModifiedUserID = Convert.ToInt32(Session[ApplicationSession.USERID]);
                if (ValidateName() == true)
                {
                    ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('School Name " + txtSchoolName.Text + " Already Exists.');</script>");
                    goto Exit;
                }
                #region RollBack Transaction Starts

                DatabaseTransaction.OpenConnectionTransation();
                if (ViewState["Mode"].ToString() == "Save")
                {
                    objResults = objSchoolBl.School_Insert(objSchoolBo);
                    if (objResults != null)
                    {
                        if (objResults.resultDT.Rows.Count > 0)
                        {
                            ViewState["SchoolMID"] = Convert.ToInt32(objResults.resultDT.Rows[0][0].ToString());
                            InsertBank();

                            PanelGrid_VisibilityMode(1);
                            ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('School Created Successfully.');</script>");
                            ClearAll();
                        }
                    }
                }
                else
                {
                    objResults = objBankBl.BankAssociation_Delete_TrustMID(0, Convert.ToInt32(ViewState["SchoolMID"].ToString()));
                    if (objResults.status == ApplicationResult.CommonStatusType.SUCCESS)
                    {
                    }

                    InsertBank();
                    objSchoolBo.SchoolMID = Convert.ToInt32(ViewState["SchoolMID"].ToString());
                    objSchoolBo.TrustMID  = Convert.ToInt32(Session[ApplicationSession.TRUSTID]);
                    objResults            = objSchoolBl.School_Update(objSchoolBo);
                    if (objResults.status == ApplicationResult.CommonStatusType.SUCCESS)
                    {
                        ClearAll();
                        ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script language='JavaScript'>alert('School updated successfully');</script>");

                        // GridDataBind();

                        objControls.ClearForm(Master.FindControl("ContentPlaceHolder1"));
                        ViewState["Mode"] = "Save";
                        btnSave.Text      = "Save";
                    }
                }

                DatabaseTransaction.CommitTransation();
                //Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "Clear();", true);
                GridDataBind();
                #endregion
                Exit :;
            }
            catch (Exception ex)
            {
                DatabaseTransaction.RollbackTransation();
                logger.Error("Error", ex);
                ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "<script>alert('Oops! There is some technical issue. Please Contact to your administrator.');</script>");
            }
        }
        public void BindgvReport()
        {
            SchoolBL          objSchoolBL = new SchoolBL();
            ApplicationResult objResult   = new ApplicationResult();

            objResult = objSchoolBL.School_AccountingInfoReport(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ddlSchool.SelectedValue), 0);
            if (objResult != null)
            {
                dlSchoolInfoGujarati.DataSource  = null;
                dlSchoolInfoGujarati1.DataSource = null;

                if (objResult.resultDT.Rows.Count > 0)
                {
                    dlSchoolInfoGujarati.Visible  = true;
                    dlSchoolInfoGujarati1.Visible = true;
                }
                else
                {
                    ClearAll();
                    ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('No record found.');", true);
                }
            }

            dlSchoolInfoGujarati.DataSource = objResult.resultDT;
            dlSchoolInfoGujarati.DataBind();

            dlStaffInfo.DataSource = objResult.resultDT;
            dlStaffInfo.DataBind();

            dlStaffInfo1.DataSource = objResult.resultDT;
            dlStaffInfo1.DataBind();


            dlSchoolInfoGujarati1.DataSource = objResult.resultDT;
            dlSchoolInfoGujarati1.DataBind();


            //Bind PrePrimary Datalist

            objResult = objSchoolBL.School_AccountingInfoReport(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ddlSchool.SelectedValue), 1);
            if (objResult != null)
            {
                dlPrePrimary.DataSource  = null;
                dlPrePrimary1.DataSource = null;
                if (objResult.resultDT.Rows.Count > 0)
                {
                    dlPrePrimary.Visible  = true;
                    dlPrePrimary1.Visible = true;
                }
                else
                {
                    dlPrePrimary.Visible  = false;
                    dlPrePrimary1.Visible = false;
                }
            }
            dlPrePrimary.DataSource = objResult.resultDT;
            dlPrePrimary.DataBind();
            dlPrePrimary1.DataSource = objResult.resultDT;
            dlPrePrimary1.DataBind();

            //Bind Primary Datalist

            objResult = objSchoolBL.School_AccountingInfoReport(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ddlSchool.SelectedValue), 2);
            if (objResult != null)
            {
                dlPrimary.DataSource  = null;
                dlPrimary1.DataSource = null;
                if (objResult.resultDT.Rows.Count > 0)
                {
                    dlPrimary.Visible  = true;
                    dlPrimary1.Visible = true;
                }
                else
                {
                    dlPrimary.Visible  = false;
                    dlPrimary1.Visible = false;
                }
            }
            dlPrimary.DataSource = objResult.resultDT;
            dlPrimary.DataBind();
            dlPrimary1.DataSource = objResult.resultDT;
            dlPrimary1.DataBind();
            //Bind Secondary Datalist

            objResult = objSchoolBL.School_AccountingInfoReport(Convert.ToInt32(Session[ApplicationSession.TRUSTID]), Convert.ToInt32(ddlSchool.SelectedValue), 3);
            if (objResult != null)
            {
                dlSecondary.DataSource  = null;
                dlSecondary1.DataSource = null;
                if (objResult.resultDT.Rows.Count > 0)
                {
                    dlSecondary.Visible  = true;
                    dlSecondary1.Visible = true;
                }
                else
                {
                    dlSecondary.Visible  = false;
                    dlSecondary1.Visible = false;
                }
            }
            dlSecondary.DataSource = objResult.resultDT;
            dlSecondary.DataBind();
            dlSecondary1.DataSource = objResult.resultDT;
            dlSecondary1.DataBind();
        }