Ejemplo n.º 1
0
        protected void btnUpdateRoomStatus_Click(object sender, EventArgs e)
        {
            BLL.Room room = new BLL.Room();
            if (room.LoadByPrimaryKey(RoomID))
            {
                if (drpRoomStatus.SelectedValue != room.s_RowStatusID)
                {
                    room.RowStatusID = Convert.ToByte(drpRoomStatus.SelectedValue);
                    room.Save();

                    //SEND MAIL MESSAGE BY THE NEW STATUS TO ROOM OWNERS AND ADMINS
                    string msgTitle = "تغيير حالة غرفة";
                    string msgBody = String.Format("عزيزى العضو<br><br>تحية طيبة وبعد<br><br>نود إبلاغكم بأنه تم تغيير حالة الغرفة <b>{0}</b> إلى <b>{1}</b><br><br><br>شكرا<br>",room.Name,drpRoomStatus.SelectedItem.Text);
                    BLL.Message msg = new BLL.Message();
                    msg.AddNew();
                    msg.SenderID = BLL.Member.SiteMembers.Where(m => String.Equals(m.Name, Helper.StringEnum.GetStringValue(Helper.Enums.SiteMembers.Admin))).FirstOrDefault().MemberID; ;
                    msg.Subject=msgTitle;
                    msg.Body=msgBody;
                    msg.ToMembers=room.CreatedByMember.Name;
                    msg.Save();
                    BLL.MemberMessage memberMsg = new BLL.MemberMessage();
                    memberMsg.AddNew();
                    memberMsg.MemberID = room.CreatedBy;
                    memberMsg.MessageID = msg.ID;
                    memberMsg.Save();
                }
            }
        }
Ejemplo n.º 2
0
        private void SendBotMsg(string mailURL, Info.RoomBot roomBot,int senderID)
        {
            System.Net.WebClient wClient = new System.Net.WebClient();
            wClient.Encoding = System.Text.Encoding.UTF8;
            string msgBody = wClient.DownloadString(mailURL);

            BLL.Room bllRoom = new BLL.Room();
            bllRoom.LoadByPrimaryKey(roomBot.RoomID);

            BLL.Message msg = new BLL.Message();
            msg.AddNew();
            msg.Body = msgBody;
            msg.SenderID = senderID;
            msg.Subject = "بوت متابعة إدارة الغرفة - " + bllRoom.Name;
            msg.ToMembers = bllRoom.CreatedByMember.Name;
            msg.Save();

            BLL.MemberMessage memberMsg = new BLL.MemberMessage();
            //add to member sent items
            //add to room owner
            memberMsg.AddNew();
            memberMsg.MemberID = bllRoom.CreatedBy;
            memberMsg.MessageID = msg.ID;
            memberMsg.Save();

            //send mail notifications
            Chat2Connect.SRCustomHubs.NotificationHub notifications = new Chat2Connect.SRCustomHubs.NotificationHub();
            notifications.SendMailNotifications(bllRoom.CreatedBy);
        }