Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
        Response.Cache.SetNoStore();
        Response.AddHeader("Cache-control", "no-store,must-revalidate,private,no-cache,no-store,pre-check=0,post-check=0,max-stale=0");
        Response.AddHeader("Pragma", "no-cache");
        Response.AddHeader("Expires", "0");

        if (Session["UID"] == null || Session["SchoolID"] == null)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_Parent');</script>");
            return;
        }
        if ((objCCWeb.ReturnNumericValue("SELECT Count(*) FROM MTUserLimitMaster WHERE UID=" + Session["UID"] + " AND ModuleID=1 AND MenuName='mnuAcademicSession'") == 0) || (objCCWeb.ReturnSingleValue("SELECT ISNULL(VisibleOption,'N') FROM MTUserLimitMaster WHERE UID=" + Session["UID"] + " AND ModuleID=1 AND MenuName='mnuAcademicSession'") == "N"))
        {
            Session.Clear();
            Response.Redirect("Logon.aspx");
            return;
        }
        if (objCCWeb.pCheckText(frmMTAcademicSessionMaster) == true)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_parent');</script>");
            return;
        }
        if ((Session["Type"] == null) || (Session["Type"].ToString() == "1"))
        {
            strType = "ltr";
        }
        else
        {
            strType = "rtl";
        }
        if (!IsPostBack)
        {
            hidCache.Value = "";
            gvAcademicSession.Attributes.Add("bordercolor", "#FFC1A4");
            txtAcaSession1.Attributes.Add("onkeypress", "javascript:return Restrict_Pincode(event);");
            txtAcaSession2.Attributes.Add("onkeypress", "javascript:return Restrict_Pincode(event);");
            txtSessionStart.Attributes.Add("onkeypress", "javascript:return Restrict_Date(event);");
            txtSessionEnd.Attributes.Add("onkeypress", "javascript:return Restrict_Date(event);");
            txtAcaSession1.Attributes.Add("onkeyup", "javascript:return f_OnChangeAcademicSession(event);");
            pGetOption();
            txtAcaSession1.Attributes.Add("AutoComplete", "off");
            txtAcaSession2.Attributes.Add("AutoComplete", "off");
            txtSessionEnd.Attributes.Add("AutoComplete", "off");
            txtSessionStart.Attributes.Add("AutoComplete", "off");
            BindDDL();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(this.GetType(), "disScript", "<script language='javascript'>" + strHideID + "</script>");
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
        Response.Cache.SetNoStore();
        Response.AddHeader("Cache-control", "no-store,must-revalidate,private,no-cache,no-store,pre-check=0,post-check=0,max-stale=0");
        Response.AddHeader("Pragma", "no-cache");
        Response.AddHeader("Expires", "0");

        if (Session["UID"] == null || Session["SchoolID"] == null)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_Parent');</script>");
            return;
        }
        if ((objCCWeb.ReturnNumericValue("SELECT Count(*) FROM MTUserLimitMaster WHERE UID=" + Session["UID"] + " AND ModuleID=1 AND MenuName='mnuInstitutionMaster'") == 0) || (objCCWeb.ReturnSingleValue("SELECT ISNULL(VisibleOption,'N') FROM MTUserLimitMaster WHERE UID=" + Session["UID"] + " AND ModuleID=1 AND MenuName='mnuInstitutionMaster'") == "N"))
        {
            Session.Clear();
            Response.Redirect("Logon.aspx");
            return;
        }
        if (objCCWeb.pCheckText(frmMTClientCompany) == true)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_parent');</script>");
            return;
        }
        //if ((Session["Type"] == null) || (Session["Type"].ToString() == "1"))
        //{
        //    strType = "ltr";
        //}
        //else
        //{
        //    strType = "rtl";
        //}
        if (!IsPostBack)
        {
            hidCache.Value = "";
            strAddPhoto    = "Add Photo";
            strRemovePhoto = "Remove Photo";
            strChangePhoto = "Change Photo";
            gvInstitute.Attributes.Add("bordercolor", "#FFC1A4");
            txtInstitution1.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtInstitution2.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            txtEmail.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtPincode.Attributes.Add("onkeypress", "javascript:return Restrict_Pincode(event);");
            //if (Session["Type"]== "1")
            //{
            txtAddress.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtReportHeader.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtCity.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtState.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtTelephone.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtFax.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtAffiliation.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtMedium.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtEstablishedOn.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtEstablishmentCode.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtBankACNo.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtMotto.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtDirector.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtDirPhone.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtPrincipal.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtPriPhone.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtVicePrincipal.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtVicePriPhone.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtAdministrator.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            txtAdmPhone.Attributes.Add("onkeypress", "javascript:return Restrict_Address(event);");
            //txtAffiliation.Attributes.Add("onkeyup", "javascript:return fFillListBox('FillAffiCode',event)");
            AutoCompleteExtender.CompletionSetCount = Convert.ToInt32(Session["SchoolID"].ToString() + "000" + Session["AcaStart"].ToString());

            //}
            //else
            //{
            //    txtAddress.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtReportHeader.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtCity.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtState.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtTelephone.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtFax.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtAffiliation.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtMedium.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtEstablishedOn.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtEstablishmentCode.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtBankACNo.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtMotto.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtDirector.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtDirPhone.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtPrincipal.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtPriPhone.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtVicePrincipal.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtVicePriPhone.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtAdministrator.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //    txtAdmPhone.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event);");
            //}
            PGetOption();
            BindDDL();
            foreach (Control C in frmMTClientCompany.Controls)
            {
                if (C.GetType().FullName == "System.Web.UI.WebControls.TextBox")
                {
                    ((TextBox)C).Attributes.Add("AutoComplete", "off");
                }
            }
            btnCancel_Click(sender, e);
            pDisplayType();
        }
    }
    //protected static string strHideID = " document.getElementById('trReportGroup').style.display='none';" +
    //    "if (document.getElementById('gvReportGroup')!=null){if (document.getElementById('gvReportGroup').rows.length>1) {for(var intForLoop=0;intForLoop<document.getElementById('gvReportGroup').rows.length;intForLoop++)" +
    //        " {  document.getElementById('gvReportGroup').rows[intForLoop].cells[1].style.display='none'; " +
    //       // " document.getElementById('gvReportGroup').rows[intForLoop].cells[4].style.display='none'; "  +
    //        "document.getElementById('divSelectDeSelect').style.display='none';}}}";

    //protected static string strHidepriority = "if(document.getElementById('gvReportGroup')!=null) " +
    //                               " if(document.getElementById('gvReportGroup').rows.length>1) " +
    //                               "  for(var varLoop= 0 ; varLoop<document.getElementById('gvReportGroup').rows.length;varLoop++) { " +
    //                               " document.getElementById('gvReportGroup').rows[varLoop].cells[5].style.display='none'; }";

    protected void Page_Load(object sender, EventArgs e)
    {
        //ClientScript.RegisterStartupScript(this.GetType(), "disScript", "<script language='javascript'>" + strHideID + "</script>");
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
        Response.Cache.SetNoStore();
        Response.AddHeader("Cache-control", "no-store,must-revalidate,private,no-cache,no-store,pre-check=0,post-check=0,max-stale=0");
        Response.AddHeader("Pragma", "no-cache");
        Response.AddHeader("Expires", "0");

        if (Session["UID"] == null || Session["SchoolID"] == null)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_Parent');</script>");
            return;
        }

        if ((objCCWeb.ReturnNumericValue("SELECT Count(*) FROM MTUserLimitMaster WHERE UID=" + Session["UID"] + " AND ModuleID=1 AND MenuName='mnuReportGroupMaster'") == 0) || (objCCWeb.ReturnSingleValue("SELECT ISNULL(VisibleOption,'N') FROM MTUserLimitMaster WHERE UID=" + Session["UID"] + " AND ModuleID=1 AND MenuName='mnuReportGroupMaster'") == "N"))
        {
            Session.Clear();
            Response.Redirect("Logon.aspx");
            return;
        }
        if (objCCWeb.pCheckText(frmReportGroupMaster) == true)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_Parent');</script>");
            return;
        }
        if ((Session["Type"] == null) || (Session["Type"].ToString() == "1"))
        {
            strType = "ltr";
        }
        else
        {
            strType = "rtl";
            pnlClassSection.HorizontalAlign = HorizontalAlign.Right;
        }
        if (!IsPostBack)
        {
            hidCache.Value = "";
            pGetOption();
            gvReportGroup.Attributes.Add("bordercolor", "#FFC1A4");
            txtReportGroupName1.Attributes.Add("onkeypress", "javascript:return Restrict_Name(event)");
            txtReportGroupName2.Attributes.Add("onkeypress", "javascript:return Restrict_NameArabic(event)");
            txtpriority.Attributes.Add("onkeypress", "javascript:return Restrict_Priority(event)");
            txtReportGroupName2.Style.Add("text-align", "right");
            txtReportGroupName1.Attributes.Add("AutoComplete", "off");
            txtReportGroupName2.Attributes.Add("AutoComplete", "off");
            gvReportGroup.Attributes.Add("onkeypress", "javascript:return searchName(event,'gvReportGroup',2)");
            objCCWeb.FillDDLs(ddlModuleID, "SELECT 0 AS ModuleID,'' AS ModuleName" + Session["Type"] + " UNION Select Distinct MTRM.ModuleID,MTUMM.ModuleNAME From MTReportMaster MTRM Inner JOIN MTUserModuleMaster MTUMM ON MTRM.ModuleID=MTUMM.ModuleID  WHERE MTRM.ModuleID>'0'  ORDER BY ModuleID ", "ModuleID", "ModuleName" + Session["Type"].ToString() + "", "");

            //objCCWeb.FillCheckedBoxList(chkReportName, "SELECT ReportID,ReportName" + Session["Type"] + " FROM MTReportMaster WHERE ReportID>0 ORDER BY ReportID, ReportName" + Session["Type"] + " ", "ReportID", "ReportName" + Session["Type"].ToString() + "", "");

            btnCancel_Click(sender, e);

            //pDisplayType();
            gvReportGroup.EmptyDataText = objCCWeb.pDisplayMessage("" + Session["Type"].ToString() + "", "1023", "");
            btnSelectAll.Attributes.Add("onclick", "javascript:return fClassSubject(1);");
            btnDeSelect.Attributes.Add("onclick", "javascript:return fClassSubject(0);");
            chkReportName.Attributes.Add("oncontextmenu", "javascript:return fSelectDeSelect(event)");
            if (ddlModuleID.Items.Count > 0)
            {
                ddlModuleID.Items[0].Text = objCCWeb.pDisplayMessage("" + Session["Type"].ToString() + "", "6", lblReportModuleID.Text);
            }

            ClientScript.RegisterStartupScript(this.GetType(), "DisplayScript", "<script language='javascript'>" + strHideID + "</script>");
            chkReportName.Items.Add(new ListItem("", ""));
        }
    }
Example #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
        Response.Cache.SetNoStore();
        Response.AddHeader("Cache-control", "no-store,must-revalidate,private,no-cache,no-store,pre-check=0,post-check=0,max-stale=0");
        Response.AddHeader("Pragma", "no-cache");
        Response.AddHeader("Expires", "0");

        if (Session["UID"] == null || Session["SchoolID"] == null)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_Parent');</script>");
            return;
        }
        if ((objCCWeb.ReturnNumericValue("SELECT Count(*) FROM MTUserLimitMaster WHERE UID=" + Session["UID"] + " AND ModuleID=26 AND MenuName='mnuEventAssigner'") == 0) || (objCCWeb.ReturnSingleValue("SELECT ISNULL(VisibleOption,'N') FROM MTUserLimitMaster WHERE UID=" + Session["UID"] + " AND ModuleID=26 AND MenuName='mnuEventAssigner'") == "N"))
        {
            Session.Clear();
            Response.Redirect("Logon.aspx");
            return;
        }
        if (objCCWeb.pCheckText(form1) == true)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_parent');</script>");
            return;
        }
        if (Request.QueryString["StrQuery"] != null)
        {
            string strResult = "";
            string strQuery  = "";
            if (Request.QueryString["StrQuery"] == "Event")
            {
                strQuery = " EXEC spEvent '" + objCCWeb.ChangeYYYYMMDD(Request.QueryString["Value"].ToString()) + "'";
            }
            SqlDataReader sqlRdr = objCCWeb.BindReader(strQuery);
            while (sqlRdr.Read())
            {
                for (int intForLoop = 0; intForLoop < sqlRdr.FieldCount; intForLoop++)
                {
                    strResult = strResult + sqlRdr.GetValue(intForLoop).ToString() + "^";
                }
                if (strResult != "")
                {
                    strResult = strResult.Remove(strResult.Length - 1);
                }
                strResult = strResult + "~";
            }

            if (strResult != "")
            {
                strResult = strResult.Remove(strResult.Length - 1);
            }
            sqlRdr.Close();
            sqlRdr.Dispose();
            Response.Clear();
            Response.ContentType = "text/xml";
            Response.Write(strResult);
            Response.End();
        }
        if (Request.QueryString["ControlID"] != null)
        {
            string strResult  = "";
            string strQuery   = "";
            string strControl = Request.QueryString["ControlID"].ToString();
            if (strControl == "chkClassSection")
            {
                strQuery = "SELECT ClassID,ClassName,EventClassID From(select DISTINCT CM.PriorityNo, CAST(CM.ClassID AS NVARCHAR)+'^'+CAST(SM.SectionID AS NVARCHAR) AS ClassID,CM.ClassName1+'-'+SM.SectionName1 AS ClassName,ISNULL(CAST(ECD.ClassID AS NVARCHAR)+'^'+CAST(ECD.SectionID AS NVARCHAR),'') AS EventClassID " +
                           " FROM SISTudentYearWiseDetails SYD  " +
                           " INNER JOIN MTClassMaster CM On SYD.ClassID= CM.ClassID  " +
                           " INNER JOIN MTSectionMAster SM ON SYD.SectionID= SM.SectionID  " +
                           " LEFT JOIN EventClassDetail ECD ON ECD.classID=SYD.ClassID AND ECD.SectionID=SYD.SectionID " +
                           " AND ECD.EventID IN(SELECT Top 1 EventID From EventMaster Where EventDate='" + objCCWeb.ChangeYYYYMMDD(Request["Value"].ToString()) + "') " +
                           " WHERE SYD.SchoolID=" + Session["SchoolID"] + " AND SYD.AcaStart=" + Session["AcaStart"] + " AND  CM.PriorityNo<>0)SUB  ORDER BY PriorityNo";
            }

            SqlDataReader rdrVal = objCCWeb.BindReader(strQuery);
            while (rdrVal.Read())
            {
                strResult = strResult + rdrVal.GetValue(0).ToString() + "," + rdrVal.GetValue(1).ToString() + "," + rdrVal.GetValue(2).ToString() + "~";
            }
            if (strResult != "")
            {
                strResult = strResult.Remove(strResult.Length - 1);
            }

            rdrVal.Close();
            Response.Clear();
            Response.ContentType = "text/xml";
            Response.Write(strResult);
            Response.End();
        }
        if (Request.QueryString["Flag"] != null)
        {
            string strQuery = "";
            if (Request.QueryString["Flag"] == "Report")
            {
                strQuery = "DECLARE @Var nvarchar(200) SET @Var=''  " +
                           " Select  @Var=@Var+  Class+',' From ( SELECT Distinct CAST(ECD.ClassID AS NVARCHAR)+'^'+CAST(ECD.SectionID AS NVARCHAR) AS Class " +
                           " FROM SISTudentYearWiseDetails SYD  " +
                           " INNER JOIN EventClassDetail ECD ON ECD.classID=SYD.ClassID AND ECD.SectionID=SYD.SectionID " +
                           " AND ECD.EventID IN(SELECT Top 1 EventID From EventMaster " +
                           " Where EventDate='" + objCCWeb.ChangeYYYYMMDD(Request.QueryString["Value"].ToString()) + "'))SUB " +
                           " SELECT CASE WHEN LEN(@Var )>1  THEN SUBSTRING(@Var,1,LEN(@Var)-1) ELSE '' END";
            }

            string strResult = objCCWeb.ReturnSingleValue(strQuery);
            Response.Clear();
            Response.ContentType = "text/xml";
            Response.Write(strResult);
            Response.End();
        }
        if (!IsPostBack)
        {
            hidCache.Value = "";
            gvEventDetails.Attributes.Add("bordercolor", "#FFC1A4");
            btnSelectAll.Attributes.Add("onclick", "javascript:return fClassSubject(1);");
            btnDeSelect.Attributes.Add("onclick", "javascript:return fClassSubject(0);");
            chkClassSection.Attributes.Add("oncontextmenu", "javascript:return fSelectDeSelect(event)");
            btnDoubleClick_Click(sender, e);
            ClientScript.RegisterStartupScript(this.GetType(), "dis", "<script language=javascript>fBindCheckBoxList('chkClassSection','" + DateTime.Now.ToString("dd/MM/yyyy") + "');</script>");
            //fBindCheckBoxList('chkClassSection',varDate);
        }
        pGetOption();
    }