Ejemplo n.º 1
0
    protected void lnkOnline_Click(object sender, EventArgs e)
    {
        int intAcastart = objCCWeb.ReturnNumericValue("Select MAX(AcaStart) From MTAcademicsessionmaster");

        Session["UserLogin"] = Session.SessionID;
        objCCWeb.ExecuteQuery("INSERT INTO MDUserLoginDetails(IPAddress,LoginTime,SessionDetails,UserAgent,Referrer,URL,LoggedOutTime,LoginSuccessStatus) VALUES ('" + Request.ServerVariables.Get("remote_addr").ToString() + "',GETDATE(),'" + Session.SessionID.ToString() + "','" + hidBrsr.Value.Trim().ToString() + "','" + Request.UrlReferrer.ToString() + "','" + Request.Url.ToString() + "',null,'Y')");
        ClientScript.RegisterStartupScript(this.GetType(), "displayScript", "<script language=\"javascript\">alert('Online Registration Not Started !');</script>");
        Response.Redirect("NewGuideline.aspx");
    }
Ejemplo n.º 2
0
    protected void BindDropDownStudent()
    {
        SchoolName = ObjccWeb.ReturnSingleValue("select SchoolName1 from MTClientCompany");
        if (ObjccWeb.ReturnNumericValue("Select UserTypeID from MTUserMaster Where UID=" + Session["UID"] + "") == 3)
        {
            ObjccWeb.FillDDLs(ddlStudent, "Select Distinct SM.StudentID As StudentID,FirstName From SIStudentMaster SM Inner Join SIStudentYearWiseDetails SYD on SYD.StudentID=SM.StudentID where " +
                              "ParentID=" + Session["ParentID"] + " AND StudentStatus='S' order by SM.StudentID", "StudentID", "Firstname", "");

            ObjccWeb.FillDDLs(ddlAcademic, "SELECT SYD.AcaStart AS AcaStart,CAST(SYD.AcaStart AS VARCHAR)+' - '+CAST(SYD.AcaStart+1 AS VARCHAR) AS AcademicSession From SIStudentYearwiseDetails SYD INNER JOIN MTAcademicSessionMaster ASM ON ASM.AcaStart=SYD.AcaStart" +
                              " WHERE SYD.AcaStart<>0 and StudentID=" + Session["StudentID"] + " AND ShowFlag='Y' ORDER BY SYD.AcaStart DESC", "AcaStart", "AcademicSession", "");
        }
    }
Ejemplo n.º 3
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();
        }
    }
Ejemplo n.º 4
0
        public int GetSectionID(dalCommon objCommonPara)
        {
            CCWeb  objCCWeb  = new CCWeb();
            int    SectionID = 0;
            string SQLQuery  = "Select SectionID From SistudentyearwiseDetails where StudentID=" + objCommonPara.StudEmp + " and AcaStart=" + objCommonPara.AcaStart + "";

            try
            {
                SectionID = objCCWeb.ReturnNumericValue(SQLQuery);

                return(SectionID);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                objCCWeb = null;
            }
        }
Ejemplo n.º 5
0
    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();
        }
    }
Ejemplo n.º 6
0
    protected int sendSMS(string phoneno, string smsmessage, string strUID)
    {
        int messageSendSuccessfully = 0;

        try
        {
            if (phoneno.Trim() == "" || smsmessage.Trim() == "")
            {
                return(messageSendSuccessfully);
            }

            List <string> lstArray           = new List <string>();
            int           intCreditAvailable = 0;
            string[]      strCheckNumber;
            string        strPhoneNumber = phoneno.Trim();
            CreditAvailable();

            SqlDataReader sqlRdr = objCCWeb.BindReader("SELECT SMSURL,UserName,Password,NumberPerSMS,CreditAvailable,TotalSMSSend,SenderNo FROM EMSMSSettingsMaster Where TransactionType='T'");

            if (sqlRdr.Read())
            {
                smsmessage         = "Dear Parents, " + smsmessage.Trim() + " Regards " + sqlRdr.GetValue(6).ToString();
                intCreditAvailable = 0;
                strCheckNumber     = strPhoneNumber.Split(',');
                for (int i = 0; i < strCheckNumber.Length; i++)
                {
                    if (strCheckNumber[i].Trim() != "" && strCheckNumber[i].Trim().Length == 12)
                    {
                        strPhoneNumber = strCheckNumber[i];
                        if (intCreditAvailable >= objCCWeb.ReturnNumericValue("SELECT CreditAvailable FROM EMSMSSettingsMaster  Where TransactionType='T'"))
                        {
                            return(messageSendSuccessfully);
                        }
                        else
                        {
                            string DecodedMessage = smsmessage.Trim();
                            string req            = "URL API";


                            req = sqlRdr.GetValue(0).ToString() + "?UserName="******"&Password="******"&Type=Individual&To=" + strPhoneNumber.Trim() + "&Mask=" + sqlRdr.GetValue(6).ToString() + "&Message=" + DecodedMessage + "";

                            try
                            {
                                HttpWebRequest         myReq            = (HttpWebRequest)WebRequest.Create(req);
                                HttpWebResponse        myResp           = (HttpWebResponse)myReq.GetResponse();
                                System.IO.StreamReader respStreamReader = new System.IO.StreamReader(myResp.GetResponseStream());
                                string responseString = respStreamReader.ReadToEnd();
                                myResp.Close();
                            }
                            catch
                            {
                            }

                            objCCWeb.ExecuteQuery("INSERT INTO EMSMSSendDetails (SMSSendID,SMSTo,PRLEmployeeID,StudentID,Content,SMSTemplateID,SMSDate,EntryUserID,EntryDate)" +
                                                  " SELECT ISNULL(MAX(SMSSendID),0)+1,'" + strPhoneNumber + "',0,0," +
                                                  " '" + DecodedMessage.Replace("'", "''") + "',0,GETDATE()," +
                                                  " " + strUID + ",GETDATE() FROM EMSMSSendDetails");

                            int msgCount = ((DecodedMessage.Length - 1) / 160) + 1;
                            objCCWeb.ExecuteQuery("UPDATE EMSMSSettingsMaster SET TotalSMSSend=TotalSMSSend+" + msgCount + ",CreditAvailable=CreditAvailable-" + msgCount + "  Where TransactionType='T'");
                            strPhoneNumber = "";
                            messageSendSuccessfully++;
                        }
                    }
                }
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "AlertMsg", "<script>alert('Please Enter Values In SMS Settings.'</script>");
                return(messageSendSuccessfully);
            }
        }
        catch (Exception ex)
        {
        }

        return(messageSendSuccessfully);
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UID"] == null)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_parent');</script>");
            return;
        }
        GetMenuData();
        int intUserTypeID = objCCWeb.ReturnNumericValue("Select UserTypeiD From  MTUserMaster Where UID=" + Session["UID"] + " ");//AND UserTypeiD NOT in(0,1,4)

        if (intUserTypeID == 3 || intUserTypeID == 2)
        {
            Response.Write("<script>window.open('PlParentLoginForm.aspx','_parent');</script>");
            return;
        }
        if (intUserTypeID == 6)
        {
            string UserID = objCCWeb.ReturnSingleValue("Select Case when UserId like 'SE%' then 'SE' else 'SR' end as UserID  from MTUserMaster Where  UID=" + Session["UID"] + "  AND UserTypeID=6");

            if (UserID == "SE")
            {
                Response.Write("<script>window.open('SRStudentonlineRegistration11.aspx','_parent');</script>");
            }
            else
            {
                Response.Write("<script>window.open('SRStudentonlineRegistration.aspx','_parent');</script>");
            }
            return;
        }
        if (Request.QueryString["Flag"] != null)
        {
            string strQuery = "";
            if (Request.QueryString["Flag"] == "DisplayID")
            {
                strQuery = "Declare @VarMinMark as Varchar(2000);SET @VarMinMark='';  Select @VarMinMark=@VarMinMark+Cast (DisplayID  as varchar)+'^'from MTDisplayMaster  ORDER BY  DisplayID  " +
                           "  Select CASE WHEN LEN(@VarMinMark)>1 THEN SubString(@VarMinMark,1,LEN(@VarMinMark)-1) ELSE '0' END as MinMark";
            }
            if (Request.QueryString["Flag"] == "OutTime")
            {
                strQuery = "UPDATE MDUserLoginDetails SET LoggedOutTime=GETDATE() WHERE LoggedOutTime IS NULL AND SessionDetails='" + Session["UserLogin"] + "'";
            }

            string strResult = objCCWeb.ReturnSingleValue(strQuery);
            Response.Clear();
            Response.ContentType = "text/xml";
            Response.Write(strResult);
            Response.End();
        }
        if (!IsPostBack)
        {
            if (Session["CollegeName"] != null)
            {
                Session["CollegeName"] = Session["CollegeName"].ToString().Replace(" ", "&nbsp;");
            }
            else
            {
                Session["CollegeName"] = "Campus Care";
            }
            if (Session["EmployeeID"] == null)
            {
                lnkPortal.Visible = false;
            }
            Session["Date"] = DateTime.Now.Date.ToString("yyyy/MM/dd");

            lblDate.Text = DateTime.Now.Date.ToString("dd/MM/yyyy");
            lblDate.Style.Add("text-align", "right");
            //imgbtnExpand.Attributes.Add("onclick", "javascript:return fResize()");
            btnAbout.Attributes.Add("onmouseover", "javascript:return fMouseOver(this)");
            btnAbout.Attributes.Add("onmouseout", "javascript:return fMouseOut(this)");
            lblUser.Text         = "WELCOME " + Session["UserName"].ToString();
            DataList1.DataSource = objCCWeb.BindReader("EXEC  spBindCaption " + Session["SchoolID"] + "," + Session["AcaStart"] + ",'" + DateTime.Now.Date.ToString("yyyy/MM/dd") + "',1," + Session["UID"] + " ");
            DataList1.DataBind();
            objCCWeb.FillDDLs(ddlSession, "SELECT AcaStart AS AcaStart,CAST(AcaStart AS VARCHAR)+' - '+CAST(AcaStart+1 AS VARCHAR) AS AcademicSession" +
                              " FROM MTAcademicSessionMaster WHERE AcaStart<>0 ORDER BY AcaStart", "AcaStart", "AcademicSession", "");
            objCCWeb.FillDDLs(ddlSchools, "SELECT SchoolID,SchoolName1 AS SchoolName FROM MTClientCompany WHERE SchoolID IN (SELECT SchoolID FROM MTUserInstitutionMaster WHERE UID=" + Convert.ToInt32(Session["UID"]) + ") ORDER BY SchoolName1", "SchoolID", "SchoolName", "");
            if (ddlSchools.Items.Count > 0)
            {
                ddlSchools.Visible = true;
                string q = Session["SchoolID"].ToString();
                ddlSchools.SelectedValue = Session["SchoolID"].ToString();
                q = ddlSchools.SelectedItem.ToString();
            }
            else
            {
                ddlSchools.Visible = false;
            }


            if (ddlSession.Items.Count > 0)
            {
                ddlSession.Visible = true;
                string q = Session["AcaStart"].ToString();
                ddlSession.SelectedValue = Session["AcaStart"].ToString();
                q = ddlSession.SelectedItem.ToString();
            }
            else
            {
                ddlSession.Visible = false;
            }

            lblSchoolName.Text = Session["SchoolName"].ToString();
        }
    }
Ejemplo n.º 8
0
    //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("", ""));
        }
    }
Ejemplo n.º 9
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)
        {
            Response.Write("<script>window.close();window.open('Logon.aspx','_parent');</script>");
            return;
        }
        if (Request.QueryString["Status"] != null)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "disScript", "<script>ChangeSchool('" + Session["SchoolName"].ToString() + "');</script>");
        }
        if (Request.QueryString["LinkPage"] != null)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "disScript", "<script>ChangeSchool(\"" + Session["SchoolName"].ToString().Replace("'", "\'") + "\");</script>");
            strLink    = Request.QueryString["LinkPage"].ToString();
            strCompany = Session["CompanyName"].ToString();
        }
        if (!IsPostBack)
        {
            if (Session["CompanyName"] != null)
            {
                strCompany = Session["CompanyName"].ToString();
            }
            imgPhoto.Attributes.Add("onError", "javascript:return AssignError();");
            imgPhoto.ImageUrl = "EmployeePhotos/NoImage.JPG";
            if (Session["SchoolID"] == null)
            {
                if (objCCWeb.ReturnNumericValue("SELECT Count(SchoolID) FROM MTUserInstitutionMaster WHERE UID=" + Session["UID"] + "") > 1)
                {
                    Session["SchoolID"] = "0";
                    Response.Redirect("MTChangeSchool.aspx");
                }
                else
                {
                    //Login1.DestinationPageUrl = "~/Default.aspx";
                    Session["SchoolID"] = objCCWeb.ReturnNumericValue("SELECT ISNULL(MAX(SchoolID),1) FROM MTUserInstitutionMaster WHERE UID=" + Session["UID"] + "");
                }
            }

            string strDate         = DateTime.Now.Date.ToString("yyyy/MM/dd");
            string strdateLastWeek = Convert.ToString(objCCWeb.ReturnSingleValue("Select convert(varchar,DateAdd(dd,-7,getdate()),111)"));

            // DLHeader.DataSource = objCCWeb.BindDataSet("SELECT Header,Detail,Remark FROM MTUserAppointmentMaster  WHERE ApDate='" + strDate + "' AND EntryUserID=" + Session["UID"] + "");
            DLHeader.DataSource = objCCWeb.BindDataSet("SELECT Header,Detail,Remark FROM MTUserAppointmentMaster  WHERE Display=1 AND EntryUserID=" + Session["UID"] + "");
            DLHeader.DataBind();
            //DLDetails.DataSource = objCCWeb.BindDataSet("SELECT Detail FROM MTUserAppointmentMaster  WHERE ApID>1");
            //DLDetails.DataBind();

            DLCaption.DataSource = objCCWeb.BindDataSet("SELECT MenuCaption1 FROM MTuserMEnuMaster UM INNER JOIN MTUserPriorityMaster UP ON UM.ModuleID=UP.ModuleID " +
                                                        " AND UM.RollNumber=UP.RollNumber AND UID=" + Session["UID"] + "");
            DLCaption.DataBind();

            ////////int NATodayFollowupCount = objCCWeb.ReturnNumericValue("SELECT COUNT(*) FROM SRStudentEnquiry WHERE FollowupUID=0  AND DateofEnquiry='" + strDate + "' AND ACASTART=" + Session["AcaStart"].ToString());
            ////////lblTodayEnquiry.Text = NATodayFollowupCount + " Today Enquiry";

            ////////int NALastWeekFollowupCount = objCCWeb.ReturnNumericValue("SELECT COUNT(*) FROM SRStudentEnquiry WHERE FollowupUID=0  AND DateofEnquiry>='" + strdateLastWeek + "' AND DateofEnquiry<='"+strDate+"' AND ACASTART=" + Session["AcaStart"].ToString());
            ////////lblLastWeekEnquiry.Text = NALastWeekFollowupCount + " Last Week Enquiry";


            ////////int NATodayRegFollowupCount = objCCWeb.ReturnNumericValue("SELECT COUNT(*) FROM SRStudentmaster WHERE FollowupUID=0  AND Convert(Varchar,DateOfSubmission,111)='" + strDate + "' AND ACASTART=" + Session["AcaStart"].ToString());
            ////////lblTodayRegistration.Text = NATodayRegFollowupCount + " Today Registration";

            ////////int NALastWeekRegFollowupCount = objCCWeb.ReturnNumericValue("SELECT COUNT(*) FROM SRStudentmaster WHERE FollowupUID=0  AND Convert(Varchar,DateOfSubmission,111)>='" + strdateLastWeek + "' AND Convert(Varchar,DateOfSubmission,111)<='" + strDate + "' AND ACASTART=" + Session["AcaStart"].ToString());
            ////////lblLastWeekRegistration.Text = NALastWeekRegFollowupCount + " Last Week Registration";


            int intEmpEnrolleeID = objCCWeb.ReturnNumericValue("SELECT EmployeeIDStudentID FROM MTuserMaster WHERE UID=" + Session["UID"] + "");
            int intUserType      = objCCWeb.ReturnNumericValue("SELECT UserTypeID FROM MTUserMaster WHERE UID=" + Session["UID"] + "");
            int inEmployeeID     = objCCWeb.ReturnNumericValue("SELECT EmployeeIDStudentID FROM MTuserMaster WHERE UID=" + Session["UID"] + " AND UserTypeID=1");
            int intStudentID     = objCCWeb.ReturnNumericValue("SELECT EmployeeIDStudentID FROM MTuserMaster WHERE UID=" + Session["UID"] + " AND UserTypeID=2");

            if (intUserType == 1)
            {
                strEmployeeCode = objCCWeb.ReturnSingleValue("SELECT Employeecode From PRLEmployeeMaster where PRLEmployeeID in(SELECT EmployeeIDStudentID FROM MTuserMaster WHERE UID=" + Session["UID"] + " AND UserTypeID=1)");
            }
            string strusertype = objCCWeb.ReturnSingleValue("Select  Usertype from MDMessageDetails Where Usertype='A'");
            if (intEmpEnrolleeID == 0)
            {
                //DLMessageList.DataSource = objCCWeb.BindDataSet("SELECT ISNULL(MessageTitle,'') AS MessageTitle,Message,ISNULL(NewsFileName,'') as NewsFileName,MessageDate AS Message from MTMessageMaster WHERE MessageStatus='Y'  AND  '" + strDate + "' between MessageDate And MessageTillDate  AND SchoolID=" + Session["SchoolID"].ToString() + " ORDER BY MessageDate desc");
                //DLMessageList.DataBind();

                //int unreadMessagesCount = objCCWeb.ReturnNumericValue("SELECT COUNT(*) FROM MESSAGESENDDETAILS WHERE TOUID=" + Session["UID"].ToString() + " AND READUNREAD='UR' AND ACASTART=" + Session["AcaStart"].ToString());
                //lblInboxStatus.Text = unreadMessagesCount + " Unread Messages";
            }
            else if (intEmpEnrolleeID > 0 && intUserType == 1 && strusertype == "A")
            {
                //DLMessageList.DataSource = objCCWeb.BindDataSet("SELECT distinct ISNULL(MessageTitle,'') AS MessageTitle," +
                //" Message AS Message,ISNULL(NewsFileName,'') as NewsFileName,MessageDate from MTMessageMaster MM INNER JOIN MDMessageDetails MD ON MD.MessageID=MM.MessageID " +
                //" WHERE (EmployeeID=" + intEmpEnrolleeID + " AND UserType='E') OR UserType='A' AND MessageStatus='Y' AND  '" + strDate + "' between MessageDate  And MessageTillDate  AND SchoolID=" + Session["SchoolID"].ToString() + " ORDER BY MessageDate desc");
                //DLMessageList.DataBind();

                imgPhoto.ImageUrl = "EmployeePhotos/E" + intEmpEnrolleeID + ".jpg?" + DateTime.Now.ToFileTimeUtc();

                //int unreadMessagesCount = objCCWeb.ReturnNumericValue("SELECT COUNT(*) FROM MESSAGESENDDETAILS WHERE TOUID=" + Session["UID"].ToString() + " AND READUNREAD='UR' AND ACASTART=" + Session["AcaStart"].ToString());
                //lblInboxStatus.Text = unreadMessagesCount + " Unread Messages";
                //int unreadMessagesCount = objCCWeb.ReturnNumericValue("SELECT COUNT(*) FROM MESSAGESENDDETAILS WHERE TOUID="+ Session["UID"].ToString() +" AND READUNREAD='UR'");
            }
            else if (intEmpEnrolleeID > 0 && intUserType == 1 && strusertype == "")
            {
                //DLMessageList.DataSource = objCCWeb.BindDataSet("SELECT distinct ISNULL(MessageTitle,'') AS MessageTitle," +
                //" Message AS Message,ISNULL(NewsFileName,'') as NewsFileName,MessageDate from MTMessageMaster MM INNER JOIN MDMessageDetails MD ON MD.MessageID=MM.MessageID " +
                //" WHERE EmployeeID=" + intEmpEnrolleeID + " AND UserType='E' OR UserType='A' AND MessageStatus='Y' AND  '" + strDate + "' between MessageDate  And MessageTillDate AND SchoolID=" + Session["SchoolID"].ToString() + "   ORDER BY MessageDate desc");
                //DLMessageList.DataBind();
                imgPhoto.ImageUrl = "EmployeePhotos/E" + intEmpEnrolleeID + ".jpg?" + DateTime.Now.ToFileTimeUtc();

                //int unreadMessagesCount = objCCWeb.ReturnNumericValue("SELECT COUNT(*) FROM MESSAGESENDDETAILS WHERE TOUID=" + Session["UID"].ToString() + " AND READUNREAD='UR' AND ACASTART=" + Session["AcaStart"].ToString());
                //lblInboxStatus.Text = unreadMessagesCount + " Unread Messages";
                //int unreadMessagesCount = objCCWeb.ReturnNumericValue("SELECT COUNT(*) FROM MESSAGESENDDETAILS WHERE TOUID="+ Session["UID"].ToString() +" AND READUNREAD='UR'");
            }

            else if (intEmpEnrolleeID > 0 && intUserType == 2 && strusertype == "A")
            {
                //DLMessageList.DataSource = objCCWeb.BindDataSet("SELECT distinct ISNULL(MessageTitle,'') AS MessageTitle," +
                //" Message AS Message,ISNULL(NewsFileName,'') as NewsFileName,MessageDate from MTMessageMaster MM INNER JOIN MDMessageDetails MD ON MD.MessageID=MM.MessageID" +
                //" WHERE  StudentID=" + intEmpEnrolleeID + "  AND  UserType='S' OR UserType='A' AND MessageStatus='Y' AND  '" + strDate + "' between MessageDate And MessageTillDate   AND SchoolID=" + Session["SchoolID"].ToString() + " ORDER BY MessageDate desc");
                //DLMessageList.DataBind();
                imgPhoto.ImageUrl = "StudentPhoto/S" + intEmpEnrolleeID + ".jpg?" + DateTime.Now.ToFileTimeUtc();
            }
            else if (intEmpEnrolleeID > 0 && intUserType == 2 && strusertype == "")
            {
                //DLMessageList.DataSource = objCCWeb.BindDataSet("SELECT distinct ISNULL(MessageTitle,'') AS MessageTitle," +
                //" Message AS Message,ISNULL(NewsFileName,'') as NewsFileName,MessageDate from MTMessageMaster MM INNER JOIN MDMessageDetails MD ON MD.MessageID=MM.MessageID" +
                //" WHERE  StudentID=" + intEmpEnrolleeID + "  AND  UserType='S' OR UserType='A' AND MessageStatus='Y' AND  '" + strDate + "' between MessageDate And MessageTillDate  AND SchoolID=" + Session["SchoolID"].ToString() + "  ORDER BY MessageDate desc");
                //DLMessageList.DataBind();
                imgPhoto.ImageUrl = "StudentPhoto/S" + intEmpEnrolleeID + ".jpg?" + DateTime.Now.ToFileTimeUtc();
            }
            int unreadMessagesCount = 0;//objCCWeb.ReturnNumericValue("exec [spMsgGrid]  " + Session["UID"].ToString() + ", " + Session["AcaStart"] + ", " + Session["SchoolID"].ToString() + ", 'EMPLOYEECOUNT',0  ");
            lblInboxStatus.Text = unreadMessagesCount + " Unread Messages";
            //MainImage.Attributes.Add("GALLERYIMG", "no");
        }
    }
Ejemplo n.º 10
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();
    }