public static TMSMyMessageDetails Get(System.Int64 mmdMessageId)
    {
        DataSet             ds;
        Database            db;
        string              sqlCommand;
        DbCommand           dbCommand;
        TMSMyMessageDetails instance;


        instance = new TMSMyMessageDetails();

        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSMyMessageDetails_SELECT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, mmdMessageId);

        // Get results.
        ds = db.ExecuteDataSet(dbCommand);
        // Verification.
        if (ds == null || ds.Tables[0].Rows.Count == 0)
        {
            throw new ApplicationException("Could not get TMSMyMessageDetails ID:" + mmdMessageId.ToString() + " from Database.");
        }
        // Return results.
        ds.Tables[0].TableName = TABLE_NAME;

        instance.MapFrom(ds.Tables[0].Rows[0]);
        return(instance);
    }
    public static TMSMyMessageDetails[] Search(System.Int64?mmdMessageId, System.Int64?mmdLoginId, System.Int64?mmdSenderId, System.Int64?mmdReceivedId, System.Int64?mmdReplyId, System.String mmdMessageType, System.String mmdMessageTitle, System.String mmdMessageSubject, System.String mmdDescription, System.String mmdMessageText, System.String mmdMessageRemarks, System.Int32?mmdReadStatus, System.DateTime?mmdSendDate, System.DateTime?mmdDate, System.String mmdAddedByType, System.Int32?mmdStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSMyMessageDetails_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, mmdMessageId, mmdLoginId, mmdSenderId, mmdReceivedId, mmdReplyId, mmdMessageType, mmdMessageTitle, mmdMessageSubject, mmdDescription, mmdMessageText, mmdMessageRemarks, mmdReadStatus, mmdSendDate, mmdDate, mmdAddedByType, mmdStatus);

        ds = db.ExecuteDataSet(dbCommand);
        ds.Tables[0].TableName = TABLE_NAME;
        return(TMSMyMessageDetails.MapFrom(ds));
    }
    public static TMSMyMessageDetails[] MapFrom(DataSet ds)
    {
        List <TMSMyMessageDetails> objects;


        // Initialise Collection.
        objects = new List <TMSMyMessageDetails>();

        // Validation.
        if (ds == null)
        {
            throw new ApplicationException("Cannot map to dataset null.");
        }
        else if (ds.Tables[TABLE_NAME].Rows.Count == 0)
        {
            return(objects.ToArray());
        }

        if (ds.Tables[TABLE_NAME] == null)
        {
            throw new ApplicationException("Cannot find table [dbo].[TMS_MyMessageDetails] in DataSet.");
        }

        if (ds.Tables[TABLE_NAME].Rows.Count < 1)
        {
            throw new ApplicationException("Table [dbo].[TMS_MyMessageDetails] is empty.");
        }

        // Map DataSet to Instance.
        foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows)
        {
            TMSMyMessageDetails instance = new TMSMyMessageDetails();
            instance.MapFrom(dr);
            objects.Add(instance);
        }

        // Return collection.
        return(objects.ToArray());
    }
 public static void Update(TMSMyMessageDetails tMSMyMessageDetails, DbTransaction transaction)
 {
     tMSMyMessageDetails.Update(transaction);
 }
 public static void Update(TMSMyMessageDetails tMSMyMessageDetails)
 {
     tMSMyMessageDetails.Update();
 }
Example #6
0
 private void GetInBoxCount()
 {
     lblMsgUnReadCnt.Text = "(" + TMSMyMessageDetails.GetInboxCount(Convert.ToInt32(Session["UserId"])).ToString() + ")";
 }
 public static void Update(TMSMyMessageDetails tMSMyMessageDetails, DbTransaction transaction)
 {
     tMSMyMessageDetails.Update(transaction);
 }
Example #8
0
    protected void btnGroup_Send(object sender, EventArgs e)
    {
        try
        {
            if (lstGroup.Items.Count > 0)
            {

                foreach (ListViewDataItem group in lstGroup.Items)
                {
                    CheckBox chkGroupAll = group.FindControl("chkGroupAll") as CheckBox;
                    if (chkGroupAll.Checked == true)
                    {
                        Label lblGroupId = group.FindControl("lblGroupId") as Label;
                        Int64 GroupId = Convert.ToInt64(lblGroupId.Text);

                        TMSGroupDetails objGroup = TMSGroupDetails.Get(GroupId);
                        if (objGroup != null)
                        {

                            string FacultyDetailsId = objGroup.GDGroupTeacherId.Remove(objGroup.GDGroupTeacherId.Length - 1, 1);

                            DataTable dtGroup = TMSGroupDetails.GetAllTeacherDetails_FromGroups(FacultyDetailsId, null, null).Tables[0];

                            if (dtGroup.Rows.Count > 0)
                            {

                                for (int i = 0; i < dtGroup.Rows.Count; i++)
                                {
                                    //string name = dtGroup.Rows[i]["FD_FirstName"].ToString();
                                    //if (string.IsNullOrEmpty(txtToGroup.Text))
                                    // {
                                    //     txtToGroup.Text = name;
                                    // }
                                    // else
                                    // {
                                    //  txtToGroup.Text = txtToGroup.Text + "," + name;
                                    //}

                                    if (Convert.ToInt64(Session["UserId"]) == (Convert.ToInt64(dtGroup.Rows[i]["FD_LoginId"])))
                                    {

                                    }

                                    else
                                    {
                                        TMSMyMessageDetails objMyMessage = new TMSMyMessageDetails();
                                        objMyMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                                        objMyMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                                        objMyMessage.MMDReceivedId = Convert.ToInt64(dtGroup.Rows[i]["FD_LoginId"]);
                                        objMyMessage.MMDReadStatus = 0;
                                        objMyMessage.MMDMessageTitle = null;
                                        objMyMessage.MMDMessageSubject = txtGrpSubject.Text;
                                        objMyMessage.MMDDescription = txtGrpMessage.Text;
                                        objMyMessage.MMDMessageRemarks = "Send To Teachers";
                                        objMyMessage.MMDMessageType = "Send To Teachers From Staff";
                                        objMyMessage.MMDAddedByType = "Account Manager";
                                        objMyMessage.MMDStatus = 1;
                                        objMyMessage.MMDSendDate = DateTime.Now;
                                        objMyMessage.Insert();

                                    }
                                }

                            }
                        }
                    }
                }
            }

            Response.Redirect("MyInbox.aspx?msg=Message is successfully send", false);
        }
        catch (Exception ex) { }
    }
 public static TMSMyMessageDetails[] Search(TMSMyMessageDetails searchObject)
 {
     return Search ( searchObject.MMDMessageId, searchObject.MMDLoginId, searchObject.MMDSenderId, searchObject.MMDReceivedId, searchObject.MMDReplyId, searchObject.MMDMessageType, searchObject.MMDMessageTitle, searchObject.MMDMessageSubject, searchObject.MMDDescription, searchObject.MMDMessageText, searchObject.MMDMessageRemarks, searchObject.MMDReadStatus, searchObject.MMDSendDate, searchObject.MMDDate, searchObject.MMDAddedByType, searchObject.MMDStatus);
 }
    public static TMSMyMessageDetails[] MapFrom(DataSet ds)
    {
        List<TMSMyMessageDetails> objects;

        // Initialise Collection.
        objects = new List<TMSMyMessageDetails>();

        // Validation.
        if (ds == null)
        throw new ApplicationException("Cannot map to dataset null.");
        else if (ds.Tables[TABLE_NAME].Rows.Count == 0)
        return objects.ToArray();

        if (ds.Tables[TABLE_NAME] == null)
        throw new ApplicationException("Cannot find table [dbo].[TMS_MyMessageDetails] in DataSet.");

        if (ds.Tables[TABLE_NAME].Rows.Count < 1)
        throw new ApplicationException("Table [dbo].[TMS_MyMessageDetails] is empty.");

        // Map DataSet to Instance.
        foreach (DataRow dr in ds.Tables[TABLE_NAME].Rows)
        {
            TMSMyMessageDetails instance = new TMSMyMessageDetails();
            instance.MapFrom(dr);
            objects.Add(instance);
        }

        // Return collection.
        return objects.ToArray();
    }
    public static TMSMyMessageDetails Get(System.Int64 mmdMessageId)
    {
        DataSet ds;
        Database db;
        string sqlCommand;
        DbCommand dbCommand;
        TMSMyMessageDetails instance;

        instance = new TMSMyMessageDetails();

        db = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSMyMessageDetails_SELECT";
        dbCommand = db.GetStoredProcCommand(sqlCommand, mmdMessageId);

        // Get results.
        ds = db.ExecuteDataSet(dbCommand);
        // Verification.
        if (ds == null || ds.Tables[0].Rows.Count == 0) throw new ApplicationException("Could not get TMSMyMessageDetails ID:" + mmdMessageId.ToString()+ " from Database.");
        // Return results.
        ds.Tables[0].TableName = TABLE_NAME;

        instance.MapFrom( ds.Tables[0].Rows[0] );
        return instance;
    }
Example #12
0
    protected void btnAnswer_Click(object sender, EventArgs e)
    {
        //LinkButton lnkReply = (LinkButton)sender;

        Button btnSend = (Button)sender;
        ListViewDataItem Replybtn = (ListViewDataItem)btnSend.NamingContainer;
        Label lblMessageId = Replybtn.FindControl("lblMessageId") as Label;
        TextBox txtMessage = (TextBox)Replybtn.FindControl("txtMessage");

        Int64 MsgId = Convert.ToInt64(lblMessageId.Text);

        //Session["MessageId"] = MsgId;

        SectionInbox.Visible = true;
        SectionCompose.Visible = false;
        SectionSentMsg.Visible = false;
        sendall.Visible = false;
        sendtech.Visible = false;
        sendpart.Visible = false;
        sendstaf.Visible = false;
        sendPrincipal.Visible = false;

        MyInBox.Attributes.Add("class", "tabsactive");
        MySentMesseages.Attributes.Add("class", "");
        Toall.Attributes.Add("class", "");
        ToTeccher.Attributes.Add("class", "");
        ToParents.Attributes.Add("class", "");
        ToStaff.Attributes.Add("class", "");
        ToPrincipal.Attributes.Add("class", "");

        TMSMyMessageDetails ObjMess = TMSMyMessageDetails.Get(MsgId);
        if (ObjMess != null)
        {
            string MessageSubject = ObjMess.MMDMessageSubject;
            string MessageType = ObjMess.MMDMessageType;

            Int64 ReplyId = Convert.ToInt64(ObjMess.MMDReplyId);

            if (ReplyId == 0)
            {
                Session["MessageId"] = MsgId;
                // Session["MessageId"] = ReplyId;
            }

            else
            {
                Session["MessageId"] = ReplyId;
                // Session["MessageId"] = MsgId;

            }

            Int64 SenderId = Convert.ToInt64(ObjMess.MMDSenderId);

            Session["RecieverId"] = SenderId; // Use this at the time of reply
            Session["MsgType"] = MessageType;
            Session["MsgSubject"] = MessageSubject;

        }

        if (txtMessage.Text != "")
        {

            if (Convert.ToString(Session["MsgType"]) == "Send To Staff From Principal")
            {
                TMSMyMessageDetails ObjMessage = new TMSMyMessageDetails();

                ObjMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDReceivedId = Convert.ToInt64(Session["RecieverId"]);
                ObjMessage.MMDReplyId = Convert.ToInt64(Session["MessageId"]);
                ObjMessage.MMDMessageSubject = Convert.ToString(Session["MsgSubject"]);
                ObjMessage.MMDDescription = txtMessage.Text;
                ObjMessage.MMDMessageType = "Send To Principal From Staff";
                ObjMessage.MMDMessageRemarks = "Send To Principal";
                ObjMessage.MMDSendDate = DateTime.Now;
                ObjMessage.MMDAddedByType = "Account Manager";
                ObjMessage.MMDStatus = 1;
                ObjMessage.MMDReadStatus = 0;
                ObjMessage.Insert();

                BindSentItemMessage();
                dvMsg.Visible = true;
                lblMessage.Text = "Your Message has been sent successfully";
                dvMsg.Attributes.Add("class", "warring_msg");

                SectionInbox.Visible = false;
                SectionCompose.Visible = false;
                SectionSentMsg.Visible = true;
                sendall.Visible = false;
                sendtech.Visible = false;
                sendpart.Visible = false;
                sendstaf.Visible = false;

                MyInBox.Attributes.Add("class", "");
                MySentMesseages.Attributes.Add("class", "tabsactive");
                Toall.Attributes.Add("class", "");
                ToTeccher.Attributes.Add("class", "");
                ToParents.Attributes.Add("class", "");
                ToStaff.Attributes.Add("class", "");

                /* BindInboxItemMessage();
                   dvMsg.Visible = true;
                   lblMessage.Text = "Your Message has been sent successfully";
                   dvMsg.Attributes.Add("class", "warring_msg");
                   SectionInbox.Visible = true;
                   SectionCompose.Visible = false;
                   SectionSentMsg.Visible = false;

                   MyInBox.Attributes.Add("class", "tabsactive");
                   MySentMesseages.Attributes.Add("class", ""); */

            }

            else if (Convert.ToString(Session["MsgType"]) == "Send To Staff From Teachers")
            {
                TMSMyMessageDetails ObjMessage = new TMSMyMessageDetails();

                ObjMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDReceivedId = Convert.ToInt64(Session["RecieverId"]);
                ObjMessage.MMDReplyId = Convert.ToInt64(Session["MessageId"]);
                ObjMessage.MMDMessageSubject = Convert.ToString(Session["MsgSubject"]);
                ObjMessage.MMDDescription = txtMessage.Text;
                ObjMessage.MMDMessageType = "Send To Teachers From Staff";
                ObjMessage.MMDMessageRemarks = "Send To Teachers";
                ObjMessage.MMDAddedByType = "Account Manager";
                ObjMessage.MMDSendDate = DateTime.Now;
                ObjMessage.MMDStatus = 1;
                ObjMessage.MMDReadStatus = 0;
                ObjMessage.Insert();

                BindSentItemMessage();
                dvMsg.Visible = true;
                lblMessage.Text = "Your Message has been sent successfully";
                dvMsg.Attributes.Add("class", "warring_msg");

                SectionInbox.Visible = false;
                SectionCompose.Visible = false;
                SectionSentMsg.Visible = true;
                sendall.Visible = false;
                sendtech.Visible = false;
                sendpart.Visible = false;
                sendstaf.Visible = false;

                MyInBox.Attributes.Add("class", "");
                MySentMesseages.Attributes.Add("class", "tabsactive");
                Toall.Attributes.Add("class", "");
                ToTeccher.Attributes.Add("class", "");
                ToParents.Attributes.Add("class", "");
                ToStaff.Attributes.Add("class", "");

                /* BindInboxItemMessage();
                   dvMsg.Visible = true;
                   lblMessage.Text = "Your Message has been sent successfully";
                   dvMsg.Attributes.Add("class", "warring_msg");
                   SectionInbox.Visible = true;
                   SectionCompose.Visible = false;
                   SectionSentMsg.Visible = false;

                   MyInBox.Attributes.Add("class", "tabsactive");
                   MySentMesseages.Attributes.Add("class", ""); */

            }

            else if (Convert.ToString(Session["MsgType"]) == "Send To Staff From Parents")
            {
                TMSMyMessageDetails ObjMessage = new TMSMyMessageDetails();
                ObjMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDReceivedId = Convert.ToInt64(Session["RecieverId"]);
                ObjMessage.MMDReplyId = Convert.ToInt64(Session["MessageId"]);
                ObjMessage.MMDMessageSubject = Convert.ToString(Session["MsgSubject"]);
                ObjMessage.MMDDescription = txtMessage.Text;
                ObjMessage.MMDMessageType = "Send To Parents From Staff";
                ObjMessage.MMDMessageRemarks = "Send To Parents";
                ObjMessage.MMDAddedByType = "Account Manager";
                ObjMessage.MMDSendDate = DateTime.Now;
                ObjMessage.MMDStatus = 1;
                ObjMessage.MMDReadStatus = 0;
                ObjMessage.Insert();

                BindSentItemMessage();
                dvMsg.Visible = true;
                lblMessage.Text = "Your Message has been sent successfully";
                dvMsg.Attributes.Add("class", "warring_msg");

                SectionInbox.Visible = false;
                SectionCompose.Visible = false;
                SectionSentMsg.Visible = true;
                sendall.Visible = false;
                sendtech.Visible = false;
                sendpart.Visible = false;
                sendstaf.Visible = false;

                MyInBox.Attributes.Add("class", "");
                MySentMesseages.Attributes.Add("class", "tabsactive");
                Toall.Attributes.Add("class", "");
                ToTeccher.Attributes.Add("class", "");
                ToParents.Attributes.Add("class", "");
                ToStaff.Attributes.Add("class", "");

                /*  BindInboxItemMessage();
                   dvMsg.Visible = true;
                   lblMessage.Text = "Your Message has been sent successfully";
                   dvMsg.Attributes.Add("class", "warring_msg");
                   SectionInbox.Visible = true;
                   SectionCompose.Visible = false;
                   SectionSentMsg.Visible = false;

                   MyInBox.Attributes.Add("class", "tabsactive");
                   MySentMesseages.Attributes.Add("class", ""); */

            }

            else if (Convert.ToString(Session["MsgType"]) == "Send To OtherStaff From Staff")
            {
                TMSMyMessageDetails ObjMessage = new TMSMyMessageDetails();

                ObjMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDReceivedId = Convert.ToInt64(Session["RecieverId"]);
                ObjMessage.MMDReplyId = Convert.ToInt64(Session["MessageId"]);
                ObjMessage.MMDMessageSubject = Convert.ToString(Session["MsgSubject"]);
                ObjMessage.MMDDescription = txtMessage.Text;
                ObjMessage.MMDMessageType = "Send To OtherStaff From Staff";
                ObjMessage.MMDMessageRemarks = "Send To Staff";
                ObjMessage.MMDAddedByType = "Account Manager";
                ObjMessage.MMDSendDate = DateTime.Now;
                ObjMessage.MMDReadStatus = 0;
                ObjMessage.MMDStatus = 1;
                ObjMessage.Insert();

                BindSentItemMessage();
                dvMsg.Visible = true;
                lblMessage.Text = "Your Message has been sent successfully";
                dvMsg.Attributes.Add("class", "warring_msg");

                SectionInbox.Visible = false;
                SectionCompose.Visible = false;
                SectionSentMsg.Visible = true;
                sendall.Visible = false;
                sendtech.Visible = false;
                sendpart.Visible = false;
                sendstaf.Visible = false;

                MyInBox.Attributes.Add("class", "");
                MySentMesseages.Attributes.Add("class", "tabsactive");
                Toall.Attributes.Add("class", "");
                ToTeccher.Attributes.Add("class", "");
                ToParents.Attributes.Add("class", "");
                ToStaff.Attributes.Add("class", "");

                /*  BindInboxItemMessage();
                   dvMsg.Visible = true;
                   lblMessage.Text = "Your Message has been sent successfully";
                   dvMsg.Attributes.Add("class", "warring_msg");
                   SectionInbox.Visible = true;
                   SectionCompose.Visible = false;
                   SectionSentMsg.Visible = false;
                   MyInBox.Attributes.Add("class", "tabsactive");
                   MySentMesseages.Attributes.Add("class", ""); */

            }
            else if (Convert.ToString(Session["MsgType"]) == "Send To Staff From Admin")
            {
                TMSMyMessageDetails ObjMessage = new TMSMyMessageDetails();

                ObjMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDReceivedId = Convert.ToInt64(Session["RecieverId"]);
                ObjMessage.MMDReplyId = Convert.ToInt64(Session["MessageId"]);
                ObjMessage.MMDMessageSubject = Convert.ToString(Session["MsgSubject"]);
                ObjMessage.MMDDescription = txtMessage.Text;
                ObjMessage.MMDMessageType = "Send To Admin From Staff";
                ObjMessage.MMDMessageRemarks = "Send To Admin";
                ObjMessage.MMDAddedByType = "Account Manager";
                ObjMessage.MMDSendDate = DateTime.Now;
                ObjMessage.MMDReadStatus = 0;
                ObjMessage.MMDStatus = 1;
                ObjMessage.Insert();

                BindSentItemMessage();
                dvMsg.Visible = true;
                lblMessage.Text = "Your Message has been sent successfully";
                dvMsg.Attributes.Add("class", "warring_msg");

                SectionInbox.Visible = false;
                SectionCompose.Visible = false;
                SectionSentMsg.Visible = true;
                sendall.Visible = false;
                sendtech.Visible = false;
                sendpart.Visible = false;
                sendstaf.Visible = false;

                MyInBox.Attributes.Add("class", "");
                MySentMesseages.Attributes.Add("class", "tabsactive");
                Toall.Attributes.Add("class", "");
                ToTeccher.Attributes.Add("class", "");
                ToParents.Attributes.Add("class", "");
                ToStaff.Attributes.Add("class", "");

                /*  BindInboxItemMessage();
                   dvMsg.Visible = true;
                   lblMessage.Text = "Your Message has been sent successfully";
                   dvMsg.Attributes.Add("class", "warring_msg");
                   SectionInbox.Visible = true;
                   SectionCompose.Visible = false;
                   SectionSentMsg.Visible = false;
                   MyInBox.Attributes.Add("class", "tabsactive");
                   MySentMesseages.Attributes.Add("class", ""); */

            }
        }
        else
        {

            SectionInbox.Visible = true;
            SectionCompose.Visible = false;
            SectionSentMsg.Visible = false;
            sendall.Visible = false;
            sendtech.Visible = false;
            sendpart.Visible = false;
            sendstaf.Visible = false;

            MyInBox.Attributes.Add("class", "tabsactive");
            MySentMesseages.Attributes.Add("class", "");
            Toall.Attributes.Add("class", "");
            ToTeccher.Attributes.Add("class", "");
            ToParents.Attributes.Add("class", "");
            ToStaff.Attributes.Add("class", "");

            BindInboxItemMessage();
            dvMsg.Visible = true;
            lblMessage.Text = "Please Enter Description";
            dvMsg.Attributes.Add("class", "error_msg");

        }
    }
Example #13
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        try
        {

            /* DataTable dtFacultyMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[0];
             if (dtFacultyMessage.Rows.Count > 0)
             {
                 foreach (DataRow row in dtFacultyMessage.Rows)
                 {
                     TMSMyMessageDetails objMyMessage = new TMSMyMessageDetails();
                     objMyMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                     objMyMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                     objMyMessage.MMDReceivedId = Convert.ToInt64(row["FacultyId"]);
                     objMyMessage.MMDReadStatus = 0;
                     objMyMessage.MMDMessageTitle = ddlSendToAll.SelectedItem.Value;
                     objMyMessage.MMDMessageSubject = txtSubjectAll.Text;
                     objMyMessage.MMDDescription = txtMessageAll.Text;
                     objMyMessage.MMDMessageRemarks = "Send To All";
                     objMyMessage.MMDMessageType = "Send To All From Principal";
                     objMyMessage.MMDStatus = 1;
                     objMyMessage.MMDSendDate = DateTime.Now;
                     objMyMessage.Insert();
                 }
             }
             DataTable dtParentMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[1];
             if (dtParentMessage.Rows.Count > 0)
             {
                 foreach (DataRow row in dtParentMessage.Rows)
                 {
                     TMSMyMessageDetails objMyMessage = new TMSMyMessageDetails();
                     objMyMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                     objMyMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                     objMyMessage.MMDReceivedId = Convert.ToInt64(row["ParentId"]);
                     objMyMessage.MMDReadStatus = 0;
                     objMyMessage.MMDMessageTitle = ddlSendToAll.SelectedItem.Value;
                     objMyMessage.MMDMessageSubject = txtSubjectAll.Text;
                     objMyMessage.MMDDescription = txtMessageAll.Text;
                     objMyMessage.MMDMessageRemarks = "Send To All";
                     objMyMessage.MMDMessageType = "Send To All From Principal";
                     objMyMessage.MMDStatus = 1;
                     objMyMessage.MMDSendDate = DateTime.Now;
                     objMyMessage.Insert();
                 }
             }
             DataTable dtStudentMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[2];
             if (dtStudentMessage.Rows.Count > 0)
             {
                 foreach (DataRow row in dtStudentMessage.Rows)
                 {
                     TMSMyMessageDetails objMyMessage = new TMSMyMessageDetails();
                     objMyMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                     objMyMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                     objMyMessage.MMDReceivedId = Convert.ToInt64(row["StudentId"]);
                     objMyMessage.MMDReadStatus = 0;
                     objMyMessage.MMDMessageTitle = ddlSendToAll.SelectedItem.Value;
                     objMyMessage.MMDMessageSubject = txtSubjectAll.Text;
                     objMyMessage.MMDDescription = txtMessageAll.Text;
                     objMyMessage.MMDMessageType = "Send To All From Principal";
                     objMyMessage.MMDMessageRemarks = "Send To All";
                     objMyMessage.MMDStatus = 1;
                     objMyMessage.MMDSendDate = DateTime.Now;
                     objMyMessage.Insert();
                 }
             } */

            if (txtSubjectAll.Text != "")
            {
                DataTable dtFacultyMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[0];
                if (dtFacultyMessage.Rows.Count > 0)
                {
                    foreach (DataRow row in dtFacultyMessage.Rows)
                    {

                        TMSMyMessageDetails objMyMessageFaculty = new TMSMyMessageDetails();
                        objMyMessageFaculty.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageFaculty.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageFaculty.MMDReceivedId = Convert.ToInt64(row["TeacherLoginId"]);
                        objMyMessageFaculty.MMDReadStatus = 0;
                        objMyMessageFaculty.MMDMessageTitle = ddlSendToAll.SelectedItem.Value;
                        objMyMessageFaculty.MMDMessageSubject = txtSubjectAll.Text;
                        objMyMessageFaculty.MMDDescription = txtMessageAll.Text;
                        objMyMessageFaculty.MMDMessageRemarks = "Send To All";
                        objMyMessageFaculty.MMDMessageType = "Send To Teachers From Staff";
                        objMyMessageFaculty.MMDAddedByType = "Account Manager";
                        objMyMessageFaculty.MMDStatus = 1;
                        objMyMessageFaculty.MMDSendDate = DateTime.Now;
                        objMyMessageFaculty.Insert();

                    }
                }

                DataTable dtStaffMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[1];
                if (dtStaffMessage.Rows.Count > 0)
                {
                    foreach (DataRow row in dtStaffMessage.Rows)
                    {
                        if (Convert.ToInt64(Session["UserId"]) == Convert.ToInt64(row["StaffLoginId"]))
                        {

                        }

                        else
                        {
                            TMSMyMessageDetails objMyMessageStaff = new TMSMyMessageDetails();
                            objMyMessageStaff.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                            objMyMessageStaff.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                            objMyMessageStaff.MMDReceivedId = Convert.ToInt64(row["StaffLoginId"]);
                            objMyMessageStaff.MMDReadStatus = 0;
                            objMyMessageStaff.MMDMessageTitle = ddlSendToAll.SelectedItem.Value;
                            objMyMessageStaff.MMDMessageSubject = txtSubjectAll.Text;
                            objMyMessageStaff.MMDDescription = txtMessageAll.Text;
                            objMyMessageStaff.MMDMessageRemarks = "Send To All";
                            objMyMessageStaff.MMDMessageType = "Send To OtherStaff From Staff";
                            objMyMessageStaff.MMDAddedByType = "Account Manager";
                            objMyMessageStaff.MMDStatus = 1;
                            objMyMessageStaff.MMDSendDate = DateTime.Now;
                            objMyMessageStaff.Insert();
                        }
                    }
                }

                DataTable dtParentFatherMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[2];
                if (dtParentFatherMessage.Rows.Count > 0)
                {
                    foreach (DataRow row in dtParentFatherMessage.Rows)
                    {

                        TMSMyMessageDetails objMyMessageParent = new TMSMyMessageDetails();
                        objMyMessageParent.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageParent.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageParent.MMDReceivedId = Convert.ToInt64(row["FatherLoginId"]);
                        objMyMessageParent.MMDReadStatus = 0;
                        objMyMessageParent.MMDMessageTitle = ddlSendToAll.SelectedItem.Value;
                        objMyMessageParent.MMDMessageSubject = txtSubjectAll.Text;
                        objMyMessageParent.MMDDescription = txtMessageAll.Text;
                        objMyMessageParent.MMDMessageRemarks = "Send To All";
                        objMyMessageParent.MMDMessageType = "Send To Parents From Staff";
                        objMyMessageParent.MMDAddedByType = "Account Manager";
                        objMyMessageParent.MMDStatus = 1;
                        objMyMessageParent.MMDSendDate = DateTime.Now;
                        objMyMessageParent.Insert();
                    }
                }

                DataTable dtParentMotherMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[3];
                if (dtParentMotherMessage.Rows.Count > 0)
                {
                    foreach (DataRow row in dtParentMotherMessage.Rows)
                    {

                        TMSMyMessageDetails objMyMessageParent = new TMSMyMessageDetails();
                        objMyMessageParent.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageParent.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageParent.MMDReceivedId = Convert.ToInt64(row["MotherLoginId"]);
                        objMyMessageParent.MMDReadStatus = 0;
                        objMyMessageParent.MMDMessageTitle = ddlSendToAll.SelectedItem.Value;
                        objMyMessageParent.MMDMessageSubject = txtSubjectAll.Text;
                        objMyMessageParent.MMDDescription = txtMessageAll.Text;
                        objMyMessageParent.MMDMessageRemarks = "Send To All";
                        objMyMessageParent.MMDMessageType = "Send To Parents From Staff";
                        objMyMessageParent.MMDAddedByType = "Account Manager";
                        objMyMessageParent.MMDStatus = 1;
                        objMyMessageParent.MMDSendDate = DateTime.Now;
                        objMyMessageParent.Insert();
                    }
                }

                DataTable dtStudentMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[4];
                if (dtStudentMessage.Rows.Count > 0)
                {
                    foreach (DataRow row in dtStudentMessage.Rows)
                    {
                        TMSMyMessageDetails objMyMessageStudent = new TMSMyMessageDetails();
                        objMyMessageStudent.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageStudent.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageStudent.MMDReceivedId = Convert.ToInt64(row["StudentLoginId"]);
                        objMyMessageStudent.MMDReadStatus = 0;
                        objMyMessageStudent.MMDMessageTitle = ddlSendToAll.SelectedItem.Value;
                        objMyMessageStudent.MMDMessageSubject = txtSubjectAll.Text;
                        objMyMessageStudent.MMDDescription = txtMessageAll.Text;
                        objMyMessageStudent.MMDMessageType = "Send To Students From Staff";
                        objMyMessageStudent.MMDMessageRemarks = "Send To All";
                        objMyMessageStudent.MMDAddedByType = "Account Manager";
                        objMyMessageStudent.MMDStatus = 1;
                        objMyMessageStudent.MMDSendDate = DateTime.Now;
                        objMyMessageStudent.Insert();
                    }
                }

                DataTable dtPrincipalMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[5];
                if (dtPrincipalMessage.Rows.Count > 0)
                {
                    foreach (DataRow row in dtPrincipalMessage.Rows)
                    {
                        TMSMyMessageDetails objMyMessageStudent = new TMSMyMessageDetails();
                        objMyMessageStudent.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageStudent.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                        objMyMessageStudent.MMDReceivedId = Convert.ToInt64(row["PrincipalLoginId"]);
                        objMyMessageStudent.MMDReadStatus = 0;
                        objMyMessageStudent.MMDMessageTitle = ddlSendToAll.SelectedItem.Value;
                        objMyMessageStudent.MMDMessageSubject = txtSubjectAll.Text;
                        objMyMessageStudent.MMDDescription = txtMessageAll.Text;
                        objMyMessageStudent.MMDMessageType = "Send To Principal From Staff";
                        objMyMessageStudent.MMDMessageRemarks = "Send To All";
                        objMyMessageStudent.MMDAddedByType = "Account Manager";
                        objMyMessageStudent.MMDStatus = 1;
                        objMyMessageStudent.MMDSendDate = DateTime.Now;
                        objMyMessageStudent.Insert();
                    }
                }

                Response.Redirect("MyInbox.aspx?msg=Message Send To All Successfully!!!.");
            }
            else
            {
                dvMsg.Visible = true;
                lblMessage.Text = "Please Enter Subject and Description";
                dvMsg.Attributes.Add("class", "error_msg");
            }
        }
        catch (Exception) { }
    }
Example #14
0
    protected void btnPrincipalSend_Click(object sender, EventArgs e)
    {
        try
        {
            if (txtPrincipalSubject.Text != "")
            {
                //DataTable dtPrincipalMessage = TMSMyMessageDetails.GetSearchAllSendMyMessageData().Tables[5];
                TMSMyMessageDetails objMyMessage = new TMSMyMessageDetails();
                objMyMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                objMyMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                objMyMessage.MMDReceivedId = Convert.ToInt64(ddlPrincipal.SelectedValue);
                objMyMessage.MMDReadStatus = 0;
                objMyMessage.MMDMessageSubject = txtPrincipalSubject.Text;
                objMyMessage.MMDDescription = txtPrincipalMessage.Text;
                objMyMessage.MMDMessageType = "Send To Principal From Staff";
                objMyMessage.MMDMessageRemarks = "Send To Principal";
                objMyMessage.MMDAddedByType = "Account Manager";
                objMyMessage.MMDStatus = 1;
                objMyMessage.MMDSendDate = DateTime.Now;
                objMyMessage.Insert();

                Response.Redirect("MyInbox.aspx?msg=Message Send To Principal Successfully!!!.");
            }
            else
            {
                dvMsg.Visible = true;
                lblMessage.Text = "Please Enter Subject and Description";
                dvMsg.Attributes.Add("class", "error_msg");
            }
        }

        catch (Exception ex) { }
    }
Example #15
0
    protected void btnParentSend_Click(object sender, EventArgs e)
    {
        try
        {

            SectionInbox.Visible = false;
            SectionCompose.Visible = false;
            SectionSentMsg.Visible = false;
            sendall.Visible = false;
            sendtech.Visible = false;
            sendpart.Visible = true;
            sendstaf.Visible = false;
            sendPrincipal.Visible = false;

            MyInBox.Attributes.Add("class", "");
            MySentMesseages.Attributes.Add("class", "");
            Toall.Attributes.Add("class", "");
            ToTeccher.Attributes.Add("class", "");
            ToParents.Attributes.Add("class", "tabsactive");
            ToStaff.Attributes.Add("class", "");
            ToPrincipal.Attributes.Add("class", "");

            string parentID = HFParentId.Value;
            string[] fparentSplit = parentID.Split(',');

            for (int i = 0; i < fparentSplit.Length - 1; i++)
            {
                /* TMSMyMessageDetails objMyMessage = new TMSMyMessageDetails();
                 objMyMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                 objMyMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                 objMyMessage.MMDReceivedId = Convert.ToInt64(fparentSplit[i]);
                 objMyMessage.MMDReadStatus = 0;
                 objMyMessage.MMDMessageTitle = parentID;
                 objMyMessage.MMDMessageSubject = txtParentSub.Text;
                 objMyMessage.MMDDescription = txtParentDesc.Text;
                 objMyMessage.MMDMessageRemarks = "SendToParents";
                 objMyMessage.MMDMessageType = "Send To Parents From Principal";
                 objMyMessage.MMDStatus = 1;
                 objMyMessage.MMDSendDate = DateTime.Now;
                 objMyMessage.Insert();*/

                TMSMyMessageDetails objMyMessage = new TMSMyMessageDetails();
                objMyMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                objMyMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                objMyMessage.MMDReceivedId = Convert.ToInt64(fparentSplit[i]);
                objMyMessage.MMDReadStatus = 0;
                objMyMessage.MMDMessageTitle = parentID;
                objMyMessage.MMDMessageSubject = txtParentSub.Text;
                objMyMessage.MMDDescription = txtParentDesc.Text;
                objMyMessage.MMDMessageRemarks = "SendToParents";
                objMyMessage.MMDMessageType = "Send To Parents From Staff";
                objMyMessage.MMDAddedByType = "Account Manager";
                objMyMessage.MMDStatus = 1;
                objMyMessage.MMDSendDate = DateTime.Now;
                objMyMessage.Insert();

            }
            Response.Redirect("MyInbox.aspx?msg=Message Send To Parents Successfully!!!.");
        }
        catch (Exception) { }
    }
 public static void Update(TMSMyMessageDetails tMSMyMessageDetails)
 {
     tMSMyMessageDetails.Update();
 }
 public static TMSMyMessageDetails[] Search(TMSMyMessageDetails searchObject)
 {
     return(Search(searchObject.MMDMessageId, searchObject.MMDLoginId, searchObject.MMDSenderId, searchObject.MMDReceivedId, searchObject.MMDReplyId, searchObject.MMDMessageType, searchObject.MMDMessageTitle, searchObject.MMDMessageSubject, searchObject.MMDDescription, searchObject.MMDMessageText, searchObject.MMDMessageRemarks, searchObject.MMDReadStatus, searchObject.MMDSendDate, searchObject.MMDDate, searchObject.MMDAddedByType, searchObject.MMDStatus));
 }
Example #18
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        try
        {
            if (Convert.ToString(Session["MsgType"]) == "Send To Principal  From Teachers")
            {
                TMSMyMessageDetails ObjMessage = new TMSMyMessageDetails();

                ObjMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDReceivedId = Convert.ToInt64(Session["RecieverId"]);
                ObjMessage.MMDReplyId = Convert.ToInt64(Session["MessageId"]);
                ObjMessage.MMDMessageSubject = txtSubject.Text;
                ObjMessage.MMDDescription = txtDesc.Text;
                ObjMessage.MMDMessageType = "Send To Teachers From Principal";
                ObjMessage.MMDMessageRemarks = "Send To Teachers";
                ObjMessage.MMDSendDate = DateTime.Now;
                ObjMessage.MMDStatus = 1;
                ObjMessage.Insert();

                BindSentItemMessage();
                dvMsg.Visible = true;
                lblMessage.Text = "Your Message has been sent successfully";
                dvMsg.Attributes.Add("class", "warring_msg");

                SectionInbox.Visible = false;
                SectionCompose.Visible = false;
                SectionSentMsg.Visible = true;
                sendall.Visible = false;
                sendtech.Visible = false;
                sendpart.Visible = false;
                sendstaf.Visible = false;

                MyInBox.Attributes.Add("class", "");
                MySentMesseages.Attributes.Add("class", "tabsactive");
                Toall.Attributes.Add("class", "");
                ToTeccher.Attributes.Add("class", "");
                ToParents.Attributes.Add("class", "");
                ToStaff.Attributes.Add("class", "");
                /*  BindInboxMessage();
                   dvMsg.Visible = true;
                   lblMessage.Text = "Your Message has been sent successfully";
                   dvMsg.Attributes.Add("class", "warring_msg");
                   SectionInbox.Visible = true;
                   SectionCompose.Visible = false;
                   SectionSentMsg.Visible = false;
                   MyInBox.Attributes.Add("class", "tabsactive");
                   MySentMesseages.Attributes.Add("class", ""); */
            }

            else if (Convert.ToString(Session["MsgType"]) == "Send To Principal  From Parents")
            {
                TMSMyMessageDetails ObjMessage = new TMSMyMessageDetails();
                ObjMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDReceivedId = Convert.ToInt64(Session["RecieverId"]);
                ObjMessage.MMDReplyId = Convert.ToInt64(Session["MessageId"]);
                ObjMessage.MMDMessageSubject = txtSubject.Text;
                ObjMessage.MMDDescription = txtDesc.Text;
                ObjMessage.MMDMessageType = "Send To Parents From Principal";
                ObjMessage.MMDMessageRemarks = "Send To Parents";
                ObjMessage.MMDSendDate = DateTime.Now;
                ObjMessage.MMDStatus = 1;
                ObjMessage.Insert();

                BindSentItemMessage();
                dvMsg.Visible = true;
                lblMessage.Text = "Your Message has been sent successfully";
                dvMsg.Attributes.Add("class", "warring_msg");

                SectionInbox.Visible = false;
                SectionCompose.Visible = false;
                SectionSentMsg.Visible = true;
                sendall.Visible = false;
                sendtech.Visible = false;
                sendpart.Visible = false;
                sendstaf.Visible = false;

                MyInBox.Attributes.Add("class", "");
                MySentMesseages.Attributes.Add("class", "tabsactive");
                Toall.Attributes.Add("class", "");
                ToTeccher.Attributes.Add("class", "");
                ToParents.Attributes.Add("class", "");
                ToStaff.Attributes.Add("class", "");

                /*  BindInboxMessage();
                    dvMsg.Visible = true;
                    lblMessage.Text = "Your Message has been sent successfully";
                    dvMsg.Attributes.Add("class", "warring_msg");
                    SectionInbox.Visible = true;
                    SectionCompose.Visible = false;
                    SectionSentMsg.Visible = false;
                    MyInBox.Attributes.Add("class", "tabsactive");
                    MySentMesseages.Attributes.Add("class", ""); */

            }

            else if (Convert.ToString(Session["MsgType"]) == "Send To Principal From Staff")
            {
                TMSMyMessageDetails ObjMessage = new TMSMyMessageDetails();

                ObjMessage.MMDLoginId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDSenderId = Convert.ToInt64(Session["UserId"]);
                ObjMessage.MMDReceivedId = Convert.ToInt64(Session["RecieverId"]);
                ObjMessage.MMDReplyId = Convert.ToInt64(Session["MessageId"]);
                ObjMessage.MMDMessageSubject = txtSubject.Text;
                ObjMessage.MMDDescription = txtDesc.Text;
                ObjMessage.MMDMessageType = "Send To Staff From Principal";
                ObjMessage.MMDMessageRemarks = "Send To Staff";
                ObjMessage.MMDSendDate = DateTime.Now;
                ObjMessage.MMDStatus = 1;
                ObjMessage.Insert();

                BindSentItemMessage();
                dvMsg.Visible = true;
                lblMessage.Text = "Your Message has been sent successfully";
                dvMsg.Attributes.Add("class", "warring_msg");

                SectionInbox.Visible = false;
                SectionCompose.Visible = false;
                SectionSentMsg.Visible = true;
                sendall.Visible = false;
                sendtech.Visible = false;
                sendpart.Visible = false;
                sendstaf.Visible = false;

                MyInBox.Attributes.Add("class", "");
                MySentMesseages.Attributes.Add("class", "tabsactive");
                Toall.Attributes.Add("class", "");
                ToTeccher.Attributes.Add("class", "");
                ToParents.Attributes.Add("class", "");
                ToStaff.Attributes.Add("class", "");

                /*  BindInboxMessage();
                    dvMsg.Visible = true;
                   lblMessage.Text = "Your Message has been sent successfully";
                   dvMsg.Attributes.Add("class", "warring_msg");
                   SectionInbox.Visible = true;
                   SectionCompose.Visible = false;
                   SectionSentMsg.Visible = false;
                   MyInBox.Attributes.Add("class", "tabsactive");
                   MySentMesseages.Attributes.Add("class", ""); */

            }

        }
        catch (Exception ex) { }
    }