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);
        }
Ejemplo n.º 3
0
        private void BindReport()
        {
            BLL.Room rm = new BLL.Room();
            rm.LoadByPrimaryKey(RoomID);
            lblRoomName.Text = rm.Name;

            DateTime dtCreateDate = DateTime.Now;
            switch (Schedule)
            {
                case Helper.Enums.FollowAdminBotSchedule.Daily:
                    dtCreateDate.AddDays(-1);
                    break;
                case Helper.Enums.FollowAdminBotSchedule.Month:
                    dtCreateDate.AddMonths(-1);
                    break;
                default:
                    dtCreateDate.AddDays(-7);
                    break;

            }
            BLL.MemberLog log = new BLL.MemberLog();
            log.LoadForRoom(RoomID,dtCreateDate,MembersLevel);

            grdLog.DataSource = log.DefaultView;
            grdLog.DataBind();
        }
Ejemplo n.º 4
0
 private void BindRoomInfo()
 {
     BLL.Room room = new BLL.Room();
     if (room.LoadByPrimaryKey(RoomID))
     {
         drpRoomStatus.SelectedValue = room.s_RowStatusID;
     }
 }
Ejemplo n.º 5
0
        protected void uiGridViewRoom_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int roomid = Convert.ToInt32(e.CommandArgument.ToString());
            if (e.CommandName == "DeleteRoom")
            {

                BLL.Room room = new BLL.Room();

                room.LoadByPrimaryKey(roomid);
                room.MarkAsDeleted();

                room.Save();
                BindRooms();
            }
            else if (e.CommandName == "DeleteBots")
            {
                BLL.RoomBot bots = new BLL.RoomBot();

                bots.Where.RoomID.Value = roomid;
                bots.Where.RoomID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                bots.Query.Load();

                for (int i = 0; i < bots.RowCount; i++)
                {
                    bots.MarkAsDeleted();
                    bots.MoveNext();
                }

                bots.Save();

            }
            else if (e.CommandName == "DeleteMembers")
            {
                BLL.RoomMember members = new BLL.RoomMember();

                members.Where.RoomID.Value = roomid;
                members.Where.RoomID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                members.Query.Load();

                for (int i = 0; i < members.RowCount; i++)
                {
                    members.MarkAsDeleted();
                    members.MoveNext();
                }
                members.Save();

            }

            else if (e.CommandName == "DeleteMessages")
            {
                BLL.RoomMessages msgs = new BLL.RoomMessages();

                msgs.Where.RoomID.Value = roomid;
                msgs.Where.RoomID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                msgs.Query.Load();

                for (int i = 0; i < msgs.RowCount; i++)
                {
                    msgs.MarkAsDeleted();
                    msgs.MoveNext();
                }
                msgs.Save();

            }
            else if (e.CommandName == "DeleteBannedmembers")
            {
                BLL.RoomMemberBanning bans = new BLL.RoomMemberBanning();
                bans.Where.RoomID.Value = roomid;
                bans.Where.RoomID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                bans.Query.Load();

                for (int i = 0; i < bans.RowCount; i++)
                {
                    bans.MarkAsDeleted();
                    bans.MoveNext();
                }
                bans.Save();
            }

            else if (e.CommandName == "DeleteTypes")
            {
                BLL.RoomType type = new BLL.RoomType();
                type.Where.RoomID.Value = roomid;
                type.Where.RoomID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                type.Query.Load();

                for (int i = 0; i < type.RowCount; i++)
                {
                    type.MarkAsDeleted();
                    type.MoveNext();
                }
                type.Save();
            }
        }