protected void BindDDL()
 {
     gvInstitute.DataSource = objCCWeb.BindDataSet("EXEC ClientCompany");
     gvInstitute.DataBind();
     if (gvInstitute.Rows.Count > 0)
     {
         gvInstitute.HeaderRow.Cells[0].HorizontalAlign = HorizontalAlign.Right;
         for (int intLoop = 0; intLoop < gvInstitute.Rows.Count; intLoop++)
         {
             gvInstitute.Rows[intLoop].Cells[0].HorizontalAlign = HorizontalAlign.Right;
         }
     }
 }
Пример #2
0
 protected void BindDDL()
 {
     txtAcaSession1.Text        = "";
     txtAcaSession2.Text        = "";
     txtSessionStart.Text       = "";
     txtSessionEnd.Text         = "";
     chkShowParentLogin.Checked = false;
     chkPayGatewayFlag.Checked  = false;
     txtAcaSession2.ReadOnly    = true;
     hidFlag.Value = "^";
     gvAcademicSession.DataSource = objCCWeb.BindDataSet("EXEC spBindGrid 'MTAcademicSessionMaster'");
     gvAcademicSession.DataBind();
     if (Session["Type"] == "2")
     {
         if (gvAcademicSession.Rows.Count > 0)
         {
             for (int intLoop = 0; intLoop < gvAcademicSession.Rows.Count; intLoop++)
             {
                 gvAcademicSession.HeaderRow.Cells[0].HorizontalAlign     = HorizontalAlign.Left;
                 gvAcademicSession.Rows[intLoop].Cells[0].HorizontalAlign = HorizontalAlign.Left;
                 gvAcademicSession.HeaderRow.Cells[1].HorizontalAlign     = HorizontalAlign.Right;
                 gvAcademicSession.Rows[intLoop].Cells[1].HorizontalAlign = HorizontalAlign.Right;
                 gvAcademicSession.HeaderRow.Cells[2].HorizontalAlign     = HorizontalAlign.Right;
                 gvAcademicSession.Rows[intLoop].Cells[2].HorizontalAlign = HorizontalAlign.Right;
                 gvAcademicSession.HeaderRow.Cells[3].HorizontalAlign     = HorizontalAlign.Right;
                 gvAcademicSession.Rows[intLoop].Cells[3].HorizontalAlign = HorizontalAlign.Right;
                 gvAcademicSession.HeaderRow.Cells[4].HorizontalAlign     = HorizontalAlign.Right;
                 gvAcademicSession.Rows[intLoop].Cells[4].HorizontalAlign = HorizontalAlign.Right;
             }
         }
     }
     if (gvAcademicSession.Rows.Count > 0)
     {
         varData = objCCWeb.ReturnSingleValue("DECLARE @varSelected AS VARCHAR(2000); SET @varSelected=''; SELECT @varSelected=@varSelected+'^'+ Caption" + Session["Type"].ToString() + "  " +
                                              " FROM MTFormControlMaster WHERE ControlName LIKE 'gvAcademicSession%'  AND FormID=101 ORDER BY PriorityNo  SELECT CASE WHEN LEN(@varSelected)>1  THEN SUBSTRING(@varSelected,1,LEN(@varSelected)) " +
                                              " ELSE '0' END AS  GridDetails");
         string[] StrData = varData.ToString().Split('^');
         gvAcademicSession.HeaderRow.Cells[0].Text = StrData[1];
         gvAcademicSession.HeaderRow.Cells[1].Text = StrData[2];
         gvAcademicSession.HeaderRow.Cells[2].Text = StrData[3];
         gvAcademicSession.HeaderRow.Cells[3].Text = StrData[4];
         gvAcademicSession.HeaderRow.Cells[4].Text = StrData[5];
     }
 }
Пример #3
0
    protected void btnDoubleClick_Click(object sender, EventArgs e)
    {
        try
        {
            string strDate = DateTime.Today.ToString("dd/MM/yyyy");
            txtDate.Text = strDate;
            int checkedClasses = 0;

            SqlDataReader rdr = objCCWeb.BindReader("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 EventClass    " +
                                                    " 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(strDate) + "') " +
                                                    " WHERE SYD.SchoolID=" + Session["SchoolID"] + " AND SYD.AcaStart=" + Session["AcaStart"] + " AND  CM.PriorityNo<>0  ORDER BY CM.PriorityNo");


            chkClassSection.Items.Clear();
            while (rdr.Read())
            {
                chkClassSection.Items.Add(new ListItem(rdr.GetValue(2).ToString(), rdr.GetValue(1).ToString()));
                if (rdr.GetValue(3).ToString() != "")
                {
                    chkClassSection.Items[chkClassSection.Items.Count - 1].Selected = true;
                }
            }



            rdr.Close();
            rdr.Dispose();


            gvEventDetails.DataSource = objCCWeb.BindDataSet(" EXEC spEvent '" + objCCWeb.ChangeYYYYMMDD(strDate) + "'");
            gvEventDetails.DataBind();
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "displayFill", "<script language=javascript>alert('" + ex.Message + "')</script>");
        }
    }
Пример #4
0
        public DataSet GetTop5UnreadMail(dalCommon objCommonPara, string eMailType)
        {
            CCWeb   ObjccWeb = new CCWeb();
            DataSet ds       = new DataSet();

            try
            {
                string Query = " Exec SpMessageBind  " + objCommonPara.UID + ",'UR'";
                ds = ObjccWeb.BindDataSet(Query);
                return(ds);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                ds            = null;
                objCommonPara = null;
                ObjccWeb      = null;
            }
        }
Пример #5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strID = "";

        txtMessage.Text = ObjccWeb.fReplaceChars(txtMessage.Text);
        for (int i = 0; i < gvDetails.Rows.Count; i++)
        {
            if (((CheckBox)gvDetails.Rows[i].Cells[0].FindControl("ChbSelect")).Checked == true)
            {
                strID = strID + gvDetails.Rows[i].Cells[1].Text.Trim() + ",";
            }
        }

        if (strID != "")
        {
            strID = strID.Remove(strID.Length - 1);

            if (ddlSelect.SelectedValue == "D")
            {
                //if (ObjccWeb.ReturnSingleValue("select distinct status from MessageSendDetails where MessageID in (" + strID + ")") == "S")
                //{
                //    ObjccWeb.ExecuteQuery("DELETE FROM MessageSendDetails where MessageID in (" + strID + ")");
                //}
                //else
                //{
                //    ObjccWeb.ExecuteQuery("Update MessageSendDetails set Status='D' where MessageID in (" + strID + ")");
                //}
            }

            if (ddlSelect.SelectedValue == "S")
            {
                //   ObjccWeb.ExecuteQuery("Update MessageSendDetails set Status='S' where MessageID in (" + strID + ")");
            }
            if (ddlSelect.SelectedValue == "UR")
            {
                //  ObjccWeb.ExecuteQuery("Update MessageSendDetails set ReadUnread='UR' where MessageID in (" + strID + ")");
            }
            if (ddlSelect.SelectedValue == "R")
            {
                //ObjccWeb.ExecuteQuery("Update MessageSendDetails set ReadUnread='R' where MessageID in (" + strID + ")");
            }

            if (ddlSelect.SelectedValue == "I")
            {
                // ObjccWeb.ExecuteQuery("Update MessageSendDetails set Status='' where MessageID in (" + strID + ")");
            }
        }
        gvDetails.DataSource = ObjccWeb.BindDataSet(" Exec SpMessageBind  " + Session["UID"] + ",'I'");
        gvDetails.DataBind();
        HidType.Value = "I";
    }
Пример #6
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");
        }
    }