예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["TypeName"] != null)
         {
             string srtTypeID;
             if (Request.QueryString["TypeName"] == "InstitutionEmblem")
             {
                 SqlDataReader rdrImage = objCCWeb.BindReader("SELECT ISNULL(Emblem,'') AS Emblem,ISNULL(EmblemLength,0) AS EmblemLength FROM MTClientCompany where SchoolID=" + Request.QueryString["SchoolID"].ToString() + "");
                 if (rdrImage.Read())
                 {
                     if (Convert.ToInt32(rdrImage.GetValue(1).ToString()) > 0)
                     {
                         int    intLength = (int)Convert.ToInt32(rdrImage.GetValue(1).ToString());
                         byte[] image     = new byte[intLength];
                         image = (byte[])rdrImage["Emblem"];
                         Response.BinaryWrite(image);
                     }
                 }
                 rdrImage.Close();
                 rdrImage.Dispose();
             }
             if (Request.QueryString["TypeName"] == "GroupCompany")
             {
                 srtTypeID = Request.QueryString["TypeID"].ToString();
                 SqlDataReader rdrImage1 = objCCWeb.BindReader("SELECT ISNULL(Emblem,'') AS Logo,CAST(EmblemLength AS INT) AS LogoLength FROM FAGroupCompanyMaster WHERE FAGroupCompanyID=" + srtTypeID);
                 if (rdrImage1.Read())
                 {
                     int    intLength = (int)rdrImage1["LogoLength"];
                     byte[] image     = new byte[intLength];
                     image = (byte[])rdrImage1["Logo"];
                     Response.BinaryWrite(image);
                 }
                 rdrImage1.Close();
                 rdrImage1.Dispose();
             }
             if (Request.QueryString["TypeName"] == "Company")
             {
                 srtTypeID = Request.QueryString["TypeID"].ToString();
                 SqlDataReader rdrImage2 = objCCWeb.BindReader("SELECT ISNULL(Emblem,'') AS Logo,CAST(EmblemLength AS INT) AS LogoLength FROM FACompanyMaster WHERE FACompanyID=" + srtTypeID);
                 if (rdrImage2.Read())
                 {
                     int    intLength = (int)rdrImage2["LogoLength"];
                     byte[] image     = new byte[intLength];
                     image = (byte[])rdrImage2["Logo"];
                     Response.BinaryWrite(image);
                 }
                 rdrImage2.Close();
                 rdrImage2.Dispose();
             }
         }
     }
 }
예제 #2
0
    public string[] GetUserParent(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT UserID FROM MTUserMaster WHERE  UserStatus = 'Y'  AND UserID Like '" + prefixText + "%' ORDER BY UserID ");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #3
0
    public string[] GetUserName(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT REPLACE(UserID,' ','')+' # '+ CAST(UID as VARCHAR) AS UserID FROM MTUserMaster WHERE UID IN(SELECT DISTINCT UID FROM MTUserLimitMaster WHERE ModuleID IN(18,19)) " +
                                                     " AND UserStatus='Y' AND UserTypeID IN (0,1) AND UserID LIKE '" + prefixText + "%' ORDER BY UserID ");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #4
0
    public string[] GetdAffNo(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT Affiliation FROM MTClientCompany WHERE Affiliation LIKE '" + prefixText + "%' AND Affiliation<>'' ");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #5
0
    public string[] GetPDName(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT FirstName+' '+MiddleName+' '+LastName+' # '+" +
                                                     " ISNULL(AdmissionNo,0)AS StudentName,SM.StudentID FROM SIStudentMaster SM " +
                                                     " INNER JOIN SIStudentYearWiseDetails  SYD ON SM.StudentID=SYD.StudentID " +
                                                     " WHERE FirstName+' '+MiddleName+' '+LastName+' # '+  ISNULL(AdmissionNo,0) " +
                                                     " LIKE '" + prefixText + "%' AND " +
                                                     " SM.StudentID IN (SELECT StudentID FROM SIStudentYearWIseDetails WHERE AcaStart=" + intvalue[1] + " AND SchoolID=" + intvalue[0] + " AND StudentID NOT " +
                                                     " IN (SELECT StudentID FROM SIStudentYearWiseDetails WHERE AcaStart IN " +
                                                     " (SELECT AcaStart FROM MTAcademicSessionMaster WHERE AcaStart> " +
                                                     " (SELECT AcaStart FROM MTAcademicSessionMaster WHERE AcaStart=" + intvalue[1] + ")))) GROUP BY SM.StudentID,SM.FirstName,SM.MiddleName,SM.LastName,SYD.AdmissionNo ORDER BY FirstName+' '+MiddleName+' '+LastName+' '+  ISNULL(AdmissionNo,0)  ");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #6
0
    public string[] GetParentList(string prefixText, int count)
    {
        //Archana
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT DISTINCT  FatherName+'#'+MotherName+'#'+CASt(SM.ParentID AS VARCHAR),SM.ParentID FROM SIStudentMaster  SM INNER JOIN  SISTudentYearWIseDetails YD ON SM.StudentID=YD.StudentID INNER JOIN SIStudentFatherDetails SFD ON YD.StudentID=SFD.StudentID INNER JOIN SIStudentMotherDetails SMD ON YD.StudentID=SMD.StudentID WHERE SM.SchoolId=" + intvalue[0] + " AND  YD.AcaStart=" + intvalue[1] + "   AND FatherName LIKE '" + prefixText + "%' ");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            //return items.ToArray();

            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #7
0
    public string[] GetEmployeeHealthList(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT (PEM.FirstName+' '+PEM.MiddleName+' '+PEM.LastName) +' # '+PEM.EmployeeCode FROM PRLEmployeeMaster PEM " +
                                                     " WHERE EmployeeStatus='N' AND PEM.SchoolID= " + intvalue[0] + " AND (PEM.FirstName+' '+PEM.MiddleName+' '+PEM.LastName) like '" + prefixText + "%' Order By PEM.FirstName+' '+PEM.MiddleName+' '+PEM.LastName");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #8
0
    public string[] GetEmployeeDetails(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("Select (PRL.FirstName+' '+PRL.MiddleName+' '+PRL.LastName)+' # '+PRL.EmployeeCode From PRLEmployeeMaster PRL" +
                                                     " Where SchoolID=" + intvalue[0] + " AND PRL.EmployeeStatus='N' AND (PRL.FirstName+' '+PRL.MiddleName+' '+PRL.LastName) like '" + prefixText + "%' ");



        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            //return items.ToArray();

            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #9
0
    public string[] GetMqualfication(string prefixText, int count)
    {
        //Archana
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT PQualificationName1,PQualificationID FROM MTPqualificationmaster  WHERE  PQualificationName1  LIKE '" + prefixText + "%'  ORDER BY PQualificationName1");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            //return items.ToArray();

            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #10
0
    public string[] GetStream(string prefixText, int count)
    {
        CCWeb         ObjCCWeb      = new CCWeb();
        int           intCheckCount = 1;
        List <string> items         = new List <string>(count);
        SqlDataReader rdrValue      = ObjCCWeb.BindReader("SELECT  STCD.Stream,0 FROM SIStudentTCDetails STCD " +
                                                          " INNER JOIN SIStudentYearWiseDetails SYWD ON SYWD.StudentID=STCD.StudentID AND SYWD.AcaStart=STCD.AcaStart " +
                                                          " WHERE SYWD.SchoolID=" + count + " AND STCD.Stream like '" + prefixText + "%'" +
                                                          " GROUP BY STCD.Stream ORDER BY STCD.Stream ");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            //return items.ToArray();

            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #11
0
    public string[] GetCompletionList(string prefixText, int count)
    {
        //Senthil
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT (SM.FirstName+' '+SM.MiddleName+' '+SM.LastName) +' # '+SYD.AdmissionNo +' # '+ClassName1+'-'+SectionName1 from SIStudentMaster SM " +
                                                     " INNER JOIN SIStudentYearWiseDetails SYD ON SM.StudentID=SYD.StudentID INNER JOIN mtClassMaster MCM ON MCM.ClassID=SYD.ClassID INNER JOIN mtSectionMaster MSM ON MSM.SectionID=SYD.SectionID" +
                                                     " WHERE SYD.AcaStart=" + intvalue[1] + "  AND SYD.SchoolID=" + intvalue[0] + " AND (SM.FirstName+' '+SM.MiddleName+' '+SM.LastName) like '" + prefixText + "%'");



        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            //return items.ToArray();

            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #12
0
    public string[] GetStudentListTC(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string SQLQuery;
        string strvalue = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SQLQuery = "SELECT DISTINCT Replace((SIM.FirstName+' '+SIM.MiddleName+' '+SIM.LastName),'  ',' ')+'#'+CAST(SYD.AdmissionNo AS VARCHAR),SIM.ParentID FROM SIStudentTCDetails TC " +
                   " INNER JOIN SIStudentYearWiseDetails SYD ON SYD.StudentID=TC.StudentID AND TC.AcaStart=SYD.AcaStart INNER JOIN SIStudentMaster SIM ON SIM.StudentID=SYD.StudentID " +
                   " WHERE SYD.StudentStatus='T' AND SYD.SchoolID=" + intvalue[0] + " AND SYD.AcaStart=" + intvalue[1] + " AND SIM.FirstName LIKE '" + prefixText + "%' ";

        SqlDataReader rdrValue = ObjCCWeb.BindReader(SQLQuery);

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #13
0
    public string[] GetEnquiryStudent(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT ISNULL(FirstName,'') +' '+ ISNULL(MidName,'') +' '+  ISNULL(LastName,'')  +' # '+   ISNULL(CAST(ApplicationNO As Varchar),'') AS StudentName,ApplicationNO " +
                                                     " FROM srstudentenquiry WHERE SchoolID=" + intvalue[0] + " AND Acastart=" + intvalue[1] + " AND ISNULL(FirstName,'') +' '+ ISNULL(MidName,'') +' '+  ISNULL(LastName,'') +' # '+  ISNULL(CAST(ApplicationNO As Varchar),'')  " +
                                                     "  Like '" + prefixText + "%'  ORDER BY FirstName ");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #14
0
    public string[] GetFCityList(string prefixText, int count)
    {
        //Manju
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT CityName1,CityID  FROM MTCityMaster  WHERE  CityName1  LIKE '" + prefixText + "%'");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            //return items.ToArray();

            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #15
0
    public string[] GetModeOfFollowUp(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT  ModeofFollowup,ModeofFollowup AS ModeofFollowup1 FROM SRStudEnquiryFollowups " +
                                                     " WHERE  AcaStart=" + intvalue[1] + "  AND SchoolId=" + intvalue[0] + "   AND  ModeofFollowup " +
                                                     " LIKE '" + prefixText + "%' GROUP BY ModeofFollowup ORDER BY ModeofFollowup ");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #16
0
    public string[] GetFSubLedger(string prefixText, int count)
    {
        //Atul
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT SubLedgerName,FASLCode from FASubLedgerMaster  WHERE  SubLedgerName  LIKE '" + prefixText + "%'");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            //return items.ToArray();

            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #17
0
    public string[] GetInformMediaList(string prefixText, int count)
    {
        //Archana
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("select distinct informmedia  from HLNursingDetails where informmedia  like '" + prefixText + "%'");


        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            //return items.ToArray();

            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #18
0
    public string[] GetRegistrationStudent(string prefixText, int count)
    {
        CCWeb  ObjCCWeb      = new CCWeb();
        int    intCheckCount = 1;
        string strvalue      = count.ToString().Replace("000", "~");

        string[]      intvalue = strvalue.Trim().Split('~');
        List <string> items    = new List <string>(count);

        SqlDataReader rdrValue = ObjCCWeb.BindReader("SELECT ISNULL(FirstName,'') +' '+ ISNULL(MiddleName,'') +' '+  ISNULL(LastName,'')  +' # '+  ISNULL(CAST(ReferenceNo AS NVARCHAR),'') AS StudentName,SM.ARStudentID FROM SRStudentMaster  SM " +
                                                     " WHERE SM.SchoolId=" + intvalue[0] + " AND  SM.AcaStart=" + intvalue[1] + "  " +
                                                     " AND ISNULL(FirstName,'') +' '+ ISNULL(MiddleName,'') +' '+  ISNULL(LastName,'') +' # '+  ISNULL(CAST(ReferenceNo AS NVARCHAR),'') Like '" + prefixText + "%'  ORDER BY FirstName");

        while (rdrValue.Read())
        {
            if (intCheckCount <= 20)
            {
                items.Add(Convert.ToString(rdrValue.GetValue(0)));
            }
            else
            {
                break;
            }
            intCheckCount++;
        }
        rdrValue.Close();
        return(items.ToArray());
    }
예제 #19
0
        public SqlDataReader GetEventList(dalCommon objCommonPara)
        {
            SqlDataReader sqlDR;
            string        SQLQuery = "SELECT EventSubject,ED.EventTime,EM.EventDate,Convert(varchar,EventDate,103) AS Date,substring(CAST(EventDate as varchar),1,3)  as Month,Venue,Discription FROM EventMaster EM INNER JOIN EventDetail ED ON EM.EventID=ED.EventID WHERE EM.EventID IN(Select EventID from EventClassDetail ED INNER JOIN SIStudentYearWiseDetailS SYD ON SYD.ClassID=ED.ClassID AND SYD.SectionID=ED.SectionID Where StudentID=" + objCommonPara.StudEmp + ")" +
                                     "AND EventDate>=(select AcaStartDate from MTAcademicSessionMaster Where Acastart=" + objCommonPara.AcaStart + ")AND EventDate <=(select AcaEndDate from MTAcademicSessionMaster Where Acastart=" + objCommonPara.AcaStart + ") " +
                                     "AND (EventSubject<>'' OR Venue<> '' OR EventSubject<>'') ORDER BY  EventDate DESC";

            try
            {
                sqlDR = objCCWeb.BindReader(SQLQuery);
                return(sqlDR);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                objCCWeb = null;
            }
        }
예제 #20
0
 protected void pGetOption()
 {
     try
     {
         SqlDataReader rdrOption = objCCWeb.BindReader("SELECT ISNULL(MAX(NewOption),'N'),ISNULL(MAX(EditOption),'N'),ISNULL(MAX(DeleteOption),'N') FROM MTUserLimitMaster " +
                                                       "WHERE ModuleID=1 AND MenuName='mnuReportGroupMaster' AND UID=" + Session["UID"] + "");
         if (rdrOption.Read())
         {
             hidCache.Value = rdrOption.GetValue(0).ToString() + ";" + rdrOption.GetValue(1).ToString() + ";" + rdrOption.GetValue(2).ToString();
             //strNewOption = rdrOption.GetValue(0).ToString();
             //strEditOption = rdrOption.GetValue(1).ToString();
             //strDeleteOption = rdrOption.GetValue(2).ToString();
         }
         rdrOption.Close();
         rdrOption.Dispose();
     }
     catch (Exception ex)
     {
         ClientScript.RegisterStartupScript(this.GetType(), "displayScript", "<script>" + strHideID + "alert('" + ex.Message.ToString().Replace("'", "") + "');</script>");
     }
 }
예제 #21
0
    protected void pGetOption()
    {
        SqlDataReader rdroption = objCCWeb.BindReader("SELECT NewOption,EditOption,DeleteOption FROM MTUserLimitMaster ULM INNER JOIN MTUserModuleMaster UMM ON ULM.ModuleID=UMM.ModuleID " +
                                                      " WHERE UMM.ModuleID=1 AND MenuName='mnuAcademicSession' AND UID=" + Session["UID"] + "");

        if (rdroption.Read())
        {
            hidCache.Value = rdroption.GetValue(0).ToString() + ";" + rdroption.GetValue(1).ToString() + ";" + rdroption.GetValue(2).ToString();
        }
        rdroption.Close();
        rdroption.Dispose();
    }
예제 #22
0
    protected void calDetails_DayRender(object sender, DayRenderEventArgs e)
    {
        e.Cell.ID = "Cell/" + e.Day.Date.ToString("dd/MM/yyyy");
        if (e.Day.IsOtherMonth)
        {
            e.Cell.Text = "";
        }
        else
        {
            e.Cell.Attributes.Add("onmouseover", " javascript:return f_pfillDescription(event,'" + e.Day.Date.ToString("dd/MM/yyyy") + "',this)");
            e.Cell.Attributes.Add("onmouseOut", " javascript:return fCalendarMouseOut(event,'" + e.Day.Date.ToString("dd/MM/yyyy") + "',this)");

            string strdate1 = e.Day.Date.ToString("dd/MM/yyyy");


            //SqlDataReader sqlRdr4 = objCCWeb.BindReader("SELECT Convert(varchar,CalendarDate,103) ,CalendarType, CalendarRemarks+' '+Venue+' '+Discription  FROM MTCalendarMaster WHERE Convert(varchar,CalendarDate,103)='" + strdate1 + "'  AND DATENAME(DW,CalendarDate)<>'Sunday'  ");

            SqlDataReader sqlRdr4 = objCCWeb.BindReader("select TOP 1 EM.EventID, EventTIme+' '+ED.EventSubject+' '+ED.Venue+' '+ED.Discription from EventMaster EM " +
                                                        " INNER JOIN EventDetail ED ON EM.EventID=ED.EventID INNER JOIN (Select DISTINCT EventID,EventSubject,Venue,Discription from eventdetail Where EventSubject<>'')SUB " +
                                                        " ON SUB.EventID=ED.EventID AND SUB.EventSubject=ed.EventSubject AND Ed.Venue=sub.Venue  " +
                                                        " Where EM.EventID IN(Select EventID from EventClassDetail ED INNER JOIN SIStudentYearWiseDetailS SYD ON SYD.ClassID=ED.ClassID AND SYD.SectionID=ED.SectionID Where StudentID=" + Session["StudentID"] + ") " +
                                                        " AND EventDate>=(select AcaStartDate from MTAcademicSessionMaster Where Acastart=" + Session["AcaStart"] + ") AND EventDate<=(select AcaEndDate from MTAcademicSessionMaster Where Acastart=" + Session["AcaStart"] + ") " +
                                                        " AND Convert(varchar,EM.EventDate,103)='" + strdate1 + "' " +
                                                        " ORDER BY  EventDate DESC");



            while (sqlRdr4.Read())
            {
                if (e.Day.Date.DayOfWeek.ToString() != "Sunday")
                {
                    if (sqlRdr4.GetValue(1).ToString().Trim() != "")
                    {
                        e.Cell.ToolTip = sqlRdr4.GetValue(1).ToString();
//                      e.Cell.Style.Add("background-image", "url(Images/Event.png)");
                        e.Cell.Style.Add("background-color", "green");
                        e.Cell.Style.Add("background-repeat", "no-repeat");
                        e.Cell.Style.Add("background-position", "center");
                    }
                }
            }
            sqlRdr4.Close();
            sqlRdr4.Dispose();
            if ((alSelectDate.Contains(e.Day.Date.ToString("dd.MM.yyyy")) && (dtDate.Month == e.Day.Date.Month)) || (e.Day.Date.DayOfWeek.ToString() == "Sunday"))
            {
                //e.Cell.BackColor = System.Drawing.Color.FromName("#889999");
                hidSunday.Value = hidSunday.Value + '~' + e.Day.Date.ToString("dd.MM.yyyy");
            }
        }
    }
예제 #23
0
    protected void fillVisitorDetails()
    {
        try
        {
            //AcaSession = Convert.ToInt32(Session["AcaStart"].ToString());

            SqlDataReader sqlReader = objCCWeb.BindReader("Select VisitorNo,VisitorName,FOM.address,contactNo,Personcontact,Purpose,VisitorIcardNo,rtrim(RIGHT(CONVERT(VARCHAR,INTime,100),7)) AS VisitorTime,CONVERT(VARCHAR,InTime,104) AS Date,schoolname1,MTM.Address ,telephone,Email,emblem  FROM FOMVisitorDetail FOM " +
                                                          "LEFT JOIN FOMPurposeMAster PM ON FOM.PurposeID=PM.PurposeID " +
                                                          "LEFT JOIN MTClientCompany MTM on  FOM.SchoolID=MTM.SchoolID" +
                                                          " where VisitorNo=" + VisitorNo + " and FOM.Acastart=" + Session["AcaStart"].ToString() + " and MTM.schoolID=" + Session["SchoolID"].ToString() + " ");

            if (sqlReader.HasRows)
            {
                sqlReader.Read();

                OVisitorNo.Text  = ": " + sqlReader.GetValue(0).ToString();
                OVName.Text      = ": " + sqlReader.GetValue(1).ToString();
                OVaddresss.Text  = ": " + sqlReader.GetValue(2).ToString();
                OVContactNo.Text = ": " + sqlReader.GetValue(3).ToString();
                ONameOff.Text    = ": " + sqlReader.GetValue(4).ToString();
                VisitPurpose     = ": " + sqlReader.GetValue(5).ToString();
                //OPurVisit.Text = ": " + sqlReader.GetValue(5).ToString();
                OVIcard.Text      = ": " + sqlReader.GetValue(6).ToString();
                OvInDateTime.Text = ": " + sqlReader.GetValue(7).ToString() + " / " + sqlReader.GetValue(8).ToString();

                SchoolName = sqlReader.GetValue(9).ToString();
                Address1   = sqlReader.GetValue(10).ToString();
                if (sqlReader.GetValue(11).ToString().Trim() != "")
                {
                    Phone += "Contact No:" + sqlReader.GetValue(11).ToString();
                }
                if (sqlReader.GetValue(12).ToString().Trim() != "")
                {
                    Email = "E-Mail:" + sqlReader.GetValue(12).ToString();
                }

                string image = "LoadImage.aspx?TypeName=InstitutionEmblem&SchoolID=" + Session["SchoolID"].ToString();
                OSchoolImage.ImageUrl = image;
            }
            sqlReader.Close();
            sqlReader.Dispose();
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "displayScript", "<script language=\"javascript\">window.close();</script>");
        }
    }
예제 #24
0
        public SqlDataReader LogoutSessionStore(dalCommon objCommonPara)
        {
            CCWeb         objCCWeb = new CCWeb();
            SqlDataReader sqlDR;
            string        SQLQuery = "UPDATE MDUserLoginDetails SET LoggedOutTime=GETDATE() WHERE LoggedOutTime IS NULL AND  SessionDetails='" + objCommonPara.Userlogin.ToString().Replace("'", "''") + "'";

            try
            {
                sqlDR = objCCWeb.BindReader(SQLQuery);
                return(sqlDR);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                objCCWeb = null;
            }
        }
예제 #25
0
    protected void Page_Load(object sender, EventArgs e)
    {
        CCWeb objCCWeb = new CCWeb();

        if (Request.QueryString["StrQuery"] != null)
        {
            string strResult = "";
            string strQuery  = "";
            if (Request.QueryString["StrQuery"] == "User")
            {
                //strQuery = "SELECT '' AS SNo,AM.LIBAuthorID,AuthorName" + Session["Type"].ToString() + " FROM LIBAuthorMaster AM INNER JOIN LIBCollectionAuthorDetails CD ON AM.LIBAUTHORID=CD.LIBAUTHORID WHERE  LIBCollectionDetailID=" + Request.QueryString["Value"] + " and LIBLIBRARYID=" + Session["LibraryID"] + "";
                strQuery = "EXEC spUserOnline " + Session["UID"] + ",'" + Session.SessionID.Replace("'", "''") + "',''";
            }

            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();
        }
    }
예제 #26
0
    protected void fillEnquiryDetails()
    {
        try
        {
            SqlDataReader sqlRdr = objCCWeb.BindReader("SELECT   MIM.SchoolID, ISNULL(MIM.SchoolName1,''),ISNULL(MIM.Address,''), ISNULL(MIM.Telephone,'')" +
                                                       "  From MTClientCompany MIM  " +
                                                       " WHERE  MIM.SchoolID=1");
            if (sqlRdr.Read())
            {
                string image = "LoadImage.aspx?TypeName=InstitutionEmblem&SchoolID=" + sqlRdr.GetValue(0).ToString();
                OSchoolImage.ImageUrl = image;

                SchoolName = sqlRdr.GetValue(1).ToString();
                Address1   = sqlRdr.GetValue(2).ToString();
                Address2   = "Phone: " + sqlRdr.GetValue(3).ToString();
            }
            sqlRdr.Close();
            sqlRdr.Dispose();
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "displayScript", "<script language=\"javascript\">window.close();</script>");
        }
    }
예제 #27
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strResult   = "";
        int    intSchoolID = 0;

        string[] strArray = this.hidFlag.Value.Split('^');
        try
        {
            List <string> lstArray  = new List <string>();
            byte[]        fileData  = null;
            byte[]        imageData = null;

            long lnLength = 0;

            fUploadEmblem.Attributes["filename"] = hdnSImagePath.Value;
            if (fUploadEmblem.PostedFile.FileName != "")
            {
                if (fUploadEmblem.HasFile)
                {
                    try
                    {
                        Stream myStream = fUploadEmblem.PostedFile.InputStream;
                        lnLength = myStream.Length;
                        fileData = new byte[(int)myStream.Length];
                        myStream.Read(fileData, 0, (int)lnLength);
                        myStream.Close();
                    }
                    catch (Exception ex)
                    {
                    }
                }
            }
            string strEmblemStatus;
            if (rbtnYes.Checked == true)
            {
                strEmblemStatus = "Y";
            }
            else
            {
                strEmblemStatus = "N";
            }
            //if (strArray[0] == "N" || strArray[0]=="E" && strArray[3].Trim().ToUpper() != txtAddress.Text.Trim().ToUpper())
            //{
            //    if (objCCWeb.ReturnNumericValue("SELECT COUNT(SchoolID) FROM MTClientCompany WHERE Address='" + txtAddress.Text.Trim().Replace("'", "''") + "'") > 0)
            //    {
            //        strResult = objCCWeb.pDisplayMessage("" + Session["Type"].ToString() + "", "5", lblAddress.Text);
            //        ClientScript.RegisterStartupScript(this.GetType(), "", "<script>" + strHideID + "alert('" + strResult + "')</script>");
            //        //ClientScript.RegisterStartupScript(this.GetType(), "", "<script>" + strHideID + "alert('Address Already Exist')</script>");
            //        hidFlag.Value = "S";
            //        return;
            //    }
            //}
            if (strArray[0] == "E")
            {
                lstArray.Add("UPDATE MTClientCompany SET SchoolName1=" + objCCWeb.fReplaceChar(txtInstitution1) + ",SchoolName2='" + txtInstitution2.Text.Trim().Replace("'", "''") + "',Address=" + objCCWeb.fReplaceChar(txtAddress) + ",ReportHeader=" + objCCWeb.fReplaceChar(txtReportHeader) +
                             ",City=" + objCCWeb.fReplaceChar(txtCity) + ",State=" + objCCWeb.fReplaceChar(txtState) + ",Pincode=" + objCCWeb.fReplaceChar(txtPincode) + ",Telephone=" + objCCWeb.fReplaceChar(txtTelephone) + "," +
                             "Fax=" + objCCWeb.fReplaceChar(txtFax) + ",Email=" + objCCWeb.fReplaceChar(txtEmail) + ",DirectorName=" + objCCWeb.fReplaceChar(txtDirector) + ",DirectorTelephone=" + objCCWeb.fReplaceChar(txtDirPhone) +
                             ",PrincipalName=" + objCCWeb.fReplaceChar(txtPrincipal) + ",PrincipalPhone=" + objCCWeb.fReplaceChar(txtPriPhone) + ",VicePrincipalName=" + objCCWeb.fReplaceChar(txtVicePrincipal) + "," +
                             "VicePrincipalPhone=" + objCCWeb.fReplaceChar(txtVicePriPhone) + ",AdministratorName=" + objCCWeb.fReplaceChar(txtAdministrator) + ",AdministratorPhone=" + objCCWeb.fReplaceChar(txtAdmPhone) + ",Affiliation=" + objCCWeb.fReplaceChar(txtAffiliation) +
                             ",Medium=" + objCCWeb.fReplaceChar(txtMedium) + ",Motto=" + objCCWeb.fReplaceChar(txtMotto) + ",EstablishedOn=" + objCCWeb.fReplaceChar(txtEstablishedOn) + ",EstablishmentCode=" + objCCWeb.fReplaceChar(txtEstablishmentCode) + "," +
                             "BankAccountNo=" + objCCWeb.fReplaceChar(txtBankACNo) + ",EmblemStatus='" + strEmblemStatus + "',UpdateUserID=" + Session["UID"].ToString() + ",UpdateDate=GETDATE(),PLPackDate=" + objCCWeb.ReturnDateorNull(txtPLPackDate.Text.Trim()) + ",PLPackdateStaff=" + objCCWeb.ReturnDateorNull(txtPLPackDateStaff.Text.Trim()) + " WHERE SchoolID=" + strArray[1] + "");

                lstArray.Add("INSERT INTO UserUpdateDetails(UID,SessionID,UpdateDate,FormName,Details) VALUES(" + Session["UID"] + ",'" + Session.SessionID + "',GETDATE(),'mnuInstitutionMaster','School " + (txtInstitution1.Text.Trim().Replace("'", "''") != "" ? txtInstitution1.Text.Trim().Replace("'", "''") : txtInstitution2.Text.Trim().Replace("'", "''")) + " Information ,Is Modified')");
            }
            else
            {
                intSchoolID = objCCWeb.ReturnNumericValue("SELECT ISNULL(MAX(SchoolID),0)+1 FROM MTClientCompany");

                lstArray.Add("INSERT INTO MTClientCompany(SchoolID,SchoolName1,SchoolName2,Address,ReportHeader,City,State,Pincode,Telephone,Fax,Email,DirectorName,DirectorTelephone,PrincipalName,PrincipalPhone,VicePrincipalName,VicePrincipalPhone,AdministratorName,AdministratorPhone," +
                             "Affiliation,Medium,Motto,EstablishedOn,EstablishmentCode,BankAccountNo,EmblemStatus,EntryUserID,EntryDate) SELECT ISNULL(MAX(SchoolID),0)+1, '" + txtInstitution1.Text.Trim().Replace("'", "''") + "','" + txtInstitution2.Text.Trim().Replace("'", "''") + "','" + txtAddress.Text.Trim().Replace("'", "''") + "','" + txtReportHeader.Text.Trim().Replace("'", "''") +
                             "','" + txtCity.Text.Trim().Replace("'", "''") + "','" + txtState.Text.Trim().Replace("'", "''") + "','" + txtPincode.Text.Trim().Replace("'", "''") + "','" + txtTelephone.Text.Trim().Replace("'", "''") + "'," +
                             "'" + txtFax.Text.Trim().Replace("'", "''") + "','" + txtEmail.Text.Trim().Replace("'", "''") + "','" + txtDirector.Text.Trim().Replace("'", "''") + "','" + txtDirPhone.Text.Trim().Replace("'", "''") +
                             "','" + txtPrincipal.Text.Trim().Replace("'", "''") + "','" + txtPriPhone.Text.Trim().Replace("'", "''") + "','" + txtVicePrincipal.Text.Trim().Replace("'", "''") + "'," +
                             "'" + txtVicePriPhone.Text.Trim().Replace("'", "''") + "','" + txtAdministrator.Text.Trim().Replace("'", "''") + "','" + txtAdmPhone.Text.Trim().Replace("'", "''") + "','" + txtAffiliation.Text.Trim().Replace("'", "''") +
                             "','" + txtMedium.Text.Trim().Replace("'", "''") + "','" + txtMotto.Text.Trim().Replace("'", "''") + "','" + txtEstablishedOn.Text.Trim().Replace("'", "''") + "','" + txtEstablishmentCode.Text.Trim().Replace("'", "''") + "'," +
                             "'" + txtBankACNo.Text.Trim().Replace("'", "''") + "','" + strEmblemStatus + "'," + Session["UID"].ToString() + ",GETDATE() FROM MTClientCompany");
            }
            strResult = objCCWeb.ExecuteQueryList(lstArray);
            if (strArray[0] == "E")
            {
                intSchoolID = Convert.ToInt32(strArray[1]);
            }

            if (hidFlag.Value == "N^")
            {
                hidFlag.Value = "N^";
            }
            else
            {
                hidFlag.Value = "E^";
            }
            if (strResult == "")
            {
                if (lnLength > 0)
                {
                    //SqlConnection conSImage = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings.Get("ConnectionString"));
                    SqlConnection conSImage = new SqlConnection(objCCWeb.ReturnConnectionString());
                    conSImage.Open();
                    SqlCommand cmdSImage = new SqlCommand("UPDATE MTClientCompany SET Emblem=@img,EmblemLength=" + lnLength.ToString() + " where SchoolID=" + intSchoolID + "", conSImage);
                    cmdSImage.CommandType = CommandType.Text;
                    cmdSImage.Parameters.Add(new SqlParameter("@img", SqlDbType.Image));
                    cmdSImage.Parameters["@img"].Value = fileData;
                    cmdSImage.ExecuteNonQuery();
                    conSImage.Close();
                    conSImage.Dispose();
                }
                if (lnLength == 0)
                {
                    if (strArray[0] == "E")
                    {
                        SqlDataReader rdrImage = objCCWeb.BindReader("SELECT ISNULL(Emblem,'') AS Emblem,CAST(ISNULL(EmblemLength,0) AS INT) AS EmblemLength FROM MTClientCompany WHERE SchoolID=" + intSchoolID + "");
                        if (rdrImage.Read())
                        {
                            int intLength = (int)rdrImage["EmblemLength"];
                            imageData = new byte[intLength];
                            imageData = (byte[])rdrImage["Emblem"];
                            if (intLength != 0)
                            {
                                lnLength = intLength;
                            }
                        }
                        rdrImage.Close();
                        rdrImage.Dispose();
                    }
                }
                if (strArray[0] == "N")
                {
                    strResult = objCCWeb.pDisplayMessage("" + Session["Type"].ToString() + "", "1", "");
                }
                else
                {
                    strResult = objCCWeb.pDisplayMessage("" + Session["Type"].ToString() + "", "2", "");
                }
                ClientScript.RegisterStartupScript(this.GetType(), "displayScriptMsg", "<script>" + strHideID + "alert('" + strResult + "')</script>");
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "displayE", "<script language=javascript>" + strHideID + "alert('" + strResult + "')</script>");
            }
            if (fUploadEmblem.PostedFile.FileName == "")
            {
                fileData = imageData;
            }
            btnCancel_Click(sender, e);
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "displayScript", "<script language=javascript>" + strHideID + "alert('" + ex.Message + "')</script>");
        }
        BindDDL();
        btnCancel_Click(sender, e);
    }
예제 #28
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        try
        {
            string        strResult;
            List <string> strQuery    = new List <string>();
            string        UpdatedFile = "";
            txtMessage.Text = ObjccWeb.fReplaceChars(txtMessage.Text);
            string File        = FileUpload1.FileName.ToString();
            string strAttachID = ObjccWeb.ReturnSingleValue("Select Isnull(Max(AttachmentID)+1,0) From MessageFileUpload");
            /*-----Added By Manju on 19-07-2012--------*/
            string strUserName = "";
            /*-----End of Added By Manju on 19-07-2012--------*/
            if (strAttachID == "0")
            {
                strAttachID = "1";
            }

            HidAttach.Value = strAttachID;


            if (txtMailTo.Text != "" && txtMailFrom.Text != "")
            {
                string file = FileUpload1.FileName.ToString();
                if (file != "")
                {
                    UpdatedFile = "";
                    UpdatedFile = file;
                    SaveFile(FileUpload1);
                    strQuery.Add("Insert into MessageFileUpload values (" + strAttachID + ",'" + HidFilename.Value + "'," + Session["UID"] + ",getdate())");
                    SqlDataReader rdr1 = ObjccWeb.BindReader("Select UID From MTUSerMaster Where UserID in ('" + txtMailTo.Text.Trim().Replace(",", "','") + "')");
                    while (rdr1.Read())
                    {
                        //  strQuery.Add("Insert Into MessageSendDetails select ISNULL(Max(MessageID),0)+1," + Session["UID"] + "," + rdr1.GetValue(0).ToString() + ",'" + txtMailSubject.Text.Trim() + "','" + txtMessage.Text.Trim().Replace("'", "''") + "',getdate(),'UR'," + Session["AcaStart"] + "," + Session["StudentID"] + ",''," + strAttachID + " from MessageSendDetails");
                    }
                    rdr1.Close();
                    rdr1.Dispose();
                }
                else
                {
                    SqlDataReader rdr1 = ObjccWeb.BindReader("Select UID From MTUSerMaster Where UserID in ('" + txtMailTo.Text.Trim().Replace(",", "','") + "')");
                    while (rdr1.Read())
                    {
                        // strQuery.Add("Insert Into MessageSendDetails select ISNULL(Max(MessageID),0)+1," + Session["UID"] + "," + rdr1.GetValue(0).ToString() + ",'" + txtMailSubject.Text.Trim() + "','" + txtMessage.Text.Trim().Replace("'", "''") + "',getdate(),'UR'," + Session["AcaStart"] + "," + Session["StudentID"] + ",'',0 from MessageSendDetails");
                    }
                    rdr1.Close();
                    rdr1.Dispose();
                }


                //string file = FileUpload1.FileName.ToString();
                //if (file != "")
                //{
                //    UpdatedFile = "";
                //    UpdatedFile = file;
                //    SaveFile(FileUpload1);
                //    SqlDataReader rdr1 = ObjccWeb.BindReader("Select UID,UserTypeID,UserName,UserID From MTUSerMaster Where UserID in ('" + txtMailTo.Text.Trim().Replace(",", "','") + "')");
                //    SqlDataReader rdr3 = ObjccWeb.BindReader("Select UID,UserTypeID,UserName,UserID From MTUSerMaster Where UserID in ('" + txtMailTo.Text.Trim().Replace(",", "','") + "') AND UserTypeID=3");
                //    while (rdr3.Read())
                //    {
                //        strUserName += rdr3.GetValue(2).ToString() + "(" + rdr3.GetValue(3).ToString() + "),";

                //    }
                //    rdr3.Close();
                //    rdr3.Dispose();
                //    while (rdr1.Read())
                //    {
                //        if (rdr1.GetValue(1).ToString() == "3")
                //        {
                //            ClientScript.RegisterStartupScript(this.GetType(), "displayScript", "<script>HideComposeBox();alert('This Message Cannot Be Send To User " + strUserName + "');</script>");
                //            //return;
                //        }
                //        else
                //        {
                //            if (ObjccWeb.ReturnNumericValue("SELECT COUNT(*) FROM MessageSendDetails") == 0)
                //            {
                //                strResult = ObjccWeb.ExecuteQuery("Insert Into MessageSendDetails(MessageID,FromUID,ToUID,Subject,Contents,Date,ReadUnread,AcaStart,StudentID,Status,AttachmentID) VALUES (0,0,0,'','',NULL,'',0,0,'',0)");
                //            }
                //            strQuery.Add("Insert Into MessageSendDetails select Isnull(Max(MessageID)+1,1)," + Session["UID"] + "," + rdr1.GetValue(0).ToString() + ",'" + txtMailSubject.Text.Trim() + "','" + txtMessage.Text.Trim().Replace("'", "''") + "',getdate(),'UR'," + Session["AcaStart"] + "," + Session["StudentID"] + ",''," + strAttachID + " from MessageSendDetails");
                //            strQuery.Add("Insert into MessageFileUpload values (" + strAttachID + ",'" + HidFilename.Value + "'," + Session["UID"] + ",getdate())");
                //        }
                //     }
                //    rdr1.Close();
                //    rdr1.Dispose();
                //}
                //else
                //{
                //    SqlDataReader rdr1 = ObjccWeb.BindReader("Select UID,UserTypeID,UserName,UserID From MTUSerMaster Where UserID in ('" + txtMailTo.Text.Trim().Replace(",", "','") + "')");
                //    SqlDataReader rdr2 = ObjccWeb.BindReader("Select UID,UserTypeID,UserName,UserID From MTUSerMaster Where UserID in ('" + txtMailTo.Text.Trim().Replace(",", "','") + "') AND UserTypeID=3");
                //    while (rdr2.Read())
                //    {
                //        strUserName += rdr2.GetValue(2).ToString() + "(" + rdr2.GetValue(3).ToString() + "),";

                //    }
                //    rdr2.Close();
                //    rdr2.Dispose();
                //    while (rdr1.Read())
                //    {
                //        if (rdr1.GetValue(1).ToString() == "3")
                //        {

                //            ClientScript.RegisterStartupScript(this.GetType(), "displayScript", "<script>HideComposeBox();alert('This Message Cannot Be Send To User " + strUserName + "');</script>");

                //            //return;
                //        }
                //        else
                //        {
                //            if (ObjccWeb.ReturnNumericValue("SELECT COUNT(*) FROM MessageSendDetails") == 0)
                //            {
                //                strResult = ObjccWeb.ExecuteQuery("Insert Into MessageSendDetails(MessageID,FromUID,ToUID,Subject,Contents,Date,ReadUnread,AcaStart,StudentID,Status,AttachmentID) VALUES (0,0,0,'','',NULL,'',0,0,'',0)");
                //            }
                //            strQuery.Add("Insert Into MessageSendDetails select Isnull(Max(MessageID)+1,1)," + Session["UID"] + "," + rdr1.GetValue(0).ToString() + ",'" + txtMailSubject.Text.Trim() + "','" + txtMessage.Text.Trim().Replace("'", "''") + "',getdate(),'UR'," + Session["AcaStart"] + "," + Session["StudentID"] + ",'',0 from MessageSendDetails");
                //        }

                //    }
                //    rdr1.Close();
                //    rdr1.Dispose();

                //}
            }
            //if (File != "")
            //{
            //    SaveFile(FileUpload1);
            //    strQuery.Add("Insert Into MessageFileUpload ");

            //}

            strResult = ObjccWeb.ExecuteQueryList(strQuery);
            if (strResult == "")
            {
                ClientScript.RegisterStartupScript(this.GetType(), "displayScript", "<script>document.getElementById('divCompose').style.display='none';document.getElementById('divInbox').style.display='';document.getElementById('divSendTo').style.display='none';document.getElementById('divdet').style.display='none';alert('Send SucessFully');</script>");
                hidEnabl.Value = "";
            }
        }
        catch (Exception ex)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "displayScript", "<script>alert('" + ex.Message.ToString().Replace("'", "") + "');</script>");
        }
    }
예제 #29
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);
    }
예제 #30
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string strResult = "";

        if (Request["TypeID"] != null && Request["TypeID"] != "")
        {
            //SqlDataReader sqlRdr;
            if (Request["TypeID"] == "FillListBox")
            {
                sqlRdr = objCCWeb.BindReader(Request["StrQuery"]);
                //if (Request["pAction"]=="FillListBox")
                // {
                //     sqlRdr = objCCWeb.BindReader(Request["strQuery"]);
                // }
                while (sqlRdr.Read())
                {
                    strResult = strResult + sqlRdr.GetValue(0).ToString() + "^" + sqlRdr.GetValue(1).ToString() + "~";
                }
                if (strResult != "")
                {
                    strResult = strResult.Remove(strResult.Length - 1);
                }
            }
            else if (Request["TypeID"] == "ReturnSingleValue")
            {
                sqlRdr = objCCWeb.BindReader(Request["StrQuery"]);
                //if (Request["pAction"]=="FillListBox")
                // {
                //     sqlRdr = objCCWeb.BindReader(Request["strQuery"]);
                // }
                if (sqlRdr.Read())
                {
                    strResult = sqlRdr.GetValue(0).ToString();
                }
            }
            //else if (Request["TypeID"] == "ExecuteQuery")
            //{
            //    strResult = objCCWeb.ExecuteQuery(Request["StrQuery"]);
            //}
            else if (Request["TypeID"] == "FillClientGrid")
            {
                Int32 intcount = 0;
                sqlRdr = objCCWeb.BindReader(Request["StrQuery"]);
                while (sqlRdr.Read())
                {
                    if (intcount == 0)
                    {
                        intcount = 1;
                        for (int intForLoop = 0; intForLoop < sqlRdr.FieldCount; intForLoop++)
                        {
                            strResult = strResult + sqlRdr.GetName(intForLoop).ToString() + "^";
                        }
                        if (strResult != "")
                        {
                            strResult = strResult.Remove(strResult.Length - 1);
                        }
                        strResult = strResult + "~";
                    }
                    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);
                }
            }
            else //if (Request["TypeID"] == "FillGrid")
            {
                sqlRdr = objCCWeb.BindReader(Request["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();
        }
        else if (Request["TypeID"] == "ExecuteQuery")
        {
            strResult = objCCWeb.ExecuteQuery(Request["StrQuery"]);
            Response.Clear();
            Response.ContentType = "text/xml";
            Response.Write(strResult);
            Response.End();
        }
        //}
    }