Пример #1
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();
        }
Пример #2
0
        protected void btnChangePassword_Click(object sender, EventArgs e)
        {
            MembershipUser user = Membership.GetUser(MemberUserName);
            if (user != null)
            {
                BLL.Member member = new BLL.Member();
                member.GetMemberByUserId(new Guid(user.ProviderUserKey.ToString()));
                string oldPassowrd=user.GetPassword(member.Answer);
               // user.ChangePassword(oldPassowrd, txtPassword.Text);

                BLL.MemberLog log = new BLL.MemberLog();
                log.AddNew(BLL.Member.CurrentMemberID, new BLL.Log.ChangePassword() { OldPassword = oldPassowrd, NewPassword = txtPassword.Text,MemberName=member.Name }, member.MemberID,null);

                BindAccountInfo();
            }
        }
        private void BindReport()
        {
            BLL.MemberLog log = new BLL.MemberLog();
            if (!string.IsNullOrEmpty(txtMemberName.Text))
            {
                BLL.Member member = new BLL.Member();
                if(member.GetByName(txtMemberName.Text))
                {
                    log.Where.MemberID.Value = member.MemberID;
                    log.Where.CreateDate.Operator=MyGeneration.dOOdads.WhereParameter.Operand.Between;
                    log.Where.CreateDate.BetweenBeginValue=Helper.Date.ToDate(txtStartDate.Text);
                    log.Where.CreateDate.BetweenEndValue=Helper.Date.ToDate(txtEndDate.Text).AddDays(1);
                    log.Query.AddOrderBy("CreateDate", MyGeneration.dOOdads.WhereParameter.Dir.DESC);
                    log.Query.Load();
                }
            }

            grdLog.DataSource = log.DefaultView;
            grdLog.DataBind();
        }
Пример #4
0
        protected void btnSaveBots_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(lstRooms.SelectedValue))
            {
                dvError.Visible = true;
                lblError.Text = "يرجى إختيار الغرفة";
                return;
            }

            List<BLL.Log.AddRoomBot> lstLogs=new List<BLL.Log.AddRoomBot>();
            BLL.MemberLog bllLog = new BLL.MemberLog();

            int totalPoint = 0;
            int roomID = Convert.ToInt32(lstRooms.SelectedValue);
            BLL.RoomBot bllRoomBot = new BLL.RoomBot();
            foreach (RepeaterItem bot in repBots.Items)
            {
                CheckBox chkBot = (CheckBox)bot.FindControl("chkSelect");
                HiddenField hdnBotID = (HiddenField)bot.FindControl("hdnBotID");
                HiddenField hdnBotPoints = (HiddenField)bot.FindControl("hdnBotPoints");
                if (chkBot.Checked)
                {
                    int botID = Helper.TypeConverter.ToInt32(hdnBotID.Value);
                    int points = Helper.TypeConverter.ToInt32(hdnBotPoints.Value);
                    totalPoint += points;
                    bllRoomBot.AddNew();
                    bllRoomBot.BotID = botID;
                    bllRoomBot.RoomID = roomID;
                    bllRoomBot.CreatedByMemberID = BLL.Member.CurrentMemberID;
                    bllRoomBot.StartDate = DateTime.Now;
                    bllRoomBot.EndDate = DateTime.Now.AddMonths(1);

                    lstLogs.Add(new BLL.Log.AddRoomBot(){RoomID=roomID,RoomName=lstRooms.SelectedItem.Text,BotID=botID,BotPoints=points});
                }
            }

            if (totalPoint < BLL.Member.CurrentMember.Credit_Point || totalPoint == 0)
            {
                MyGeneration.dOOdads.TransactionMgr tx = MyGeneration.dOOdads.TransactionMgr.ThreadTransactionMgr();
                try
                {
                    tx.BeginTransaction();
                    BLL.Member.CurrentMember.Credit_Point -= totalPoint;
                    BLL.Member.CurrentMember.Save();

                    bllRoomBot.Save();

                    foreach(var log in lstLogs)
                    {
                        bllLog.AddNew(BLL.Member.CurrentMemberID, log, null, roomID);
                    }
                    tx.CommitTransaction();
                    //notify rooms
                    List<int> newBots = bllRoomBot.DefaultView.Table.AsEnumerable().Select(r => Helper.TypeConverter.ToInt32(r[BLL.RoomBot.ColumnNames.ID])).ToList();
                    services.Services.AddRoomBots(roomID, newBots);

                    Response.Redirect("Bots.aspx");
                }
                catch(Exception ex)
                {
                    tx.RollbackTransaction();
                    dvError.Visible = true;
                    lblError.Text = "عفوا حدث حطأ يرجى المحاولة لاحقا";
                }
            }
            else
            {
                dvError.Visible = true;
                lblError.Text = "رصيد نقاطك غير كافى";
            }
        }
Пример #5
0
        protected void uiGridViewMembers_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int memberid = Convert.ToInt32(e.CommandArgument.ToString());
            if (e.CommandName == "DeleteMember")
            {

                BLL.Member mem = new BLL.Member();

                mem.LoadByPrimaryKey(memberid);
                mem.MarkAsDeleted();
                string name = mem.UserName;

                mem.Save();
                Membership.DeleteUser(name);
                BindMembers();
            }
            else if (e.CommandName == "DeleteTypes")
            {
                BLL.MemberType types = new BLL.MemberType();

                types.Where.MemberID.Value = memberid;
                types.Where.MemberID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                types.Query.Load();

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

                types.Save();

            }
            else if (e.CommandName == "DeleteProfileLike")
            {
                BLL.ProfileLike Ilike = new BLL.ProfileLike();
                BLL.ProfileLike Iliked = new BLL.ProfileLike();

                Ilike.Where.MemberID.Value = memberid;
                Ilike.Where.MemberID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                Ilike.Query.Load();

                Iliked.Where.ProfileMemberID.Value = memberid;
                Iliked.Where.ProfileMemberID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                Iliked.Query.Load();

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

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

            else if (e.CommandName == "DeleteMsgFolder")
            {
                BLL.MessageFolder msgs = new BLL.MessageFolder();

                msgs.Where.MemberID.Value = memberid;
                msgs.Where.MemberID.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 == "DeleteSettings")
            {
                BLL.MemberSetting settings = new BLL.MemberSetting();
                settings.Where.MemberID.Value = memberid;
                settings.Where.MemberID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                settings.Query.Load();

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

            else if (e.CommandName == "DeletePics")
            {
                BLL.MemberPic pics = new BLL.MemberPic();
                pics.Where.MemberID.Value = memberid;
                pics.Where.MemberID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                pics.Query.Load();

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

            else if (e.CommandName == "DeleteMessages")
            {
                BLL.Message msgs = new BLL.Message();
                msgs.Where.SenderID.Value = memberid;
                msgs.Where.SenderID.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 == "DeleteLog")
            {
                BLL.MemberLog msgs = new BLL.MemberLog();
                msgs.Where.MemberID.Value = memberid;
                msgs.Where.MemberID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                msgs.Query.Load();

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

                BLL.MemberLog related = new BLL.MemberLog();
                related.Where.RelatedMemberID.Value = memberid;
                related.Where.RelatedMemberID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                related.Query.Load();

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

            else if (e.CommandName == "DeleteGifts")
            {
                BLL.MemberGift gifts = new BLL.MemberGift();
                gifts.Where.MemberID.Value = memberid;
                gifts.Where.MemberID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                gifts.Query.Load();

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

                BLL.MemberGift giftsm = new BLL.MemberGift();
                giftsm.Where.SenderID.Value = memberid;
                giftsm.Where.SenderID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                giftsm.Query.Load();

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

            else if (e.CommandName == "DeleteFriends")
            {
                BLL.MemberFriend friend = new BLL.MemberFriend();
                friend.Where.MemberID.Value = memberid;
                friend.Where.MemberID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                friend.Query.Load();

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

                BLL.MemberFriend mem = new BLL.MemberFriend();
                mem.Where.MemberFriendID.Value = memberid;
                mem.Where.MemberFriendID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
                mem.Query.Load();

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