Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            objApplicationuserBLL = new BLL.ApplicationUserBLL();
            objApplicationUserDTO = new DTO.ApplicationUserDTO();
            try
            {
                objApplicationUserDTO.EmailId = Session["EmailId"].ToString();
                string count = objApplicationuserBLL.GetTotalUser_Pub_Sub_Publisher(objApplicationUserDTO);
                lblTotalUsers.Text                 = count.Split('&')[0];
                lblPublisherCount.Text             = count.Split('&')[1];
                lblOverallPublishContentCount.Text = count.Split('&')[2];
                lblTotalPublishContent.Text        = count.Split('&')[3];

                objPublishContentSubscribeBLL         = new BLL.PublishContentSubscribeBLL();
                objPublishContentSubscribeDTO         = new DTO.PublishContentSubscribeDTO();
                objPublishContentSubscribeDTO.EmailID = Session["EmailId"].ToString();

                DataTable tab = new DataTable();
                tab = objPublishContentSubscribeBLL.GetPublishContent_Top_5(objPublishContentSubscribeDTO);
                rptImages.DataSource = tab;
                rptImages.DataBind();

                DataTable tab1 = new DataTable();
                tab1 = objPublishContentSubscribeBLL.GetPublishRating_Top_5(objPublishContentSubscribeDTO);
                rptrating.DataSource = tab1;
                rptrating.DataBind();
            }
            catch (Exception ex)
            {
            }
        }
        protected void lnkSubscribe_Click(object sender, EventArgs e)
        {
            objPublishSubscribeDTO = new DTO.PublishContentSubscribeDTO();
            objPublishSubscribeBLL = new BLL.PublishContentSubscribeBLL();
            DataTable tabUserID = new DataTable();

            objPublishSubscribeDTO.PublishContentID = PublishContentId;
            tabUserID = objPublishSubscribeBLL.GetUserID_PublishID(objPublishSubscribeDTO);
            objPublishSubscribeDTO.UserID = int.Parse(tabUserID.Rows[0]["UserID"].ToString());
            Response.Redirect("SubscriberRatePublisher.aspx?PublisherUserID=" + objPublishSubscribeDTO.UserID);
        }
        public void LoadData()
        {
            try
            {
                objPublishSubscribeBLL = new BLL.PublishContentSubscribeBLL();
                objPublishSubscribeDTO = new DTO.PublishContentSubscribeDTO();

                objPublishSubscribeDTO.PublisherID = PublisherUserID;
                objPublishSubscribeDTO.EmailID     = Session["EmailId"].ToString();
                DataTable tab = new DataTable();
                tab            = objPublishSubscribeBLL.GetPublishRating_PublisherUserID_EmailId(objPublishSubscribeDTO);
                txtRating.Text = tab.Rows[0]["Rating"].ToString();
                btnSubmit.Text = "Update";
            }
            catch
            { }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                string Result;
                objPublishSubscribeBLL = new BLL.PublishContentSubscribeBLL();
                objPublishSubscribeDTO = new DTO.PublishContentSubscribeDTO();

                objPublishSubscribeDTO.PublisherID = PublisherUserID;
                objPublishSubscribeDTO.EmailID     = Session["EmailId"].ToString();
                objPublishSubscribeDTO.Rate        = int.Parse(txtRating.Text);
                if (btnSubmit.Text == "Update")
                {
                    Result = objPublishSubscribeBLL.UpdateSubscriberRatePublisher(objPublishSubscribeDTO);
                    if (Result == "1")
                    {
                        txtRating.Text = "";
                        btnSubmit.Text = "Submit";
                        Response.Redirect("SubscriberDashBoard.aspx");
                    }
                    else if (Result == "0")
                    {
                        lblMsg.Text      = "Publisher Rated Error";
                        lblMsg.ForeColor = System.Drawing.Color.Red;
                    }
                }
                else
                {
                    Result = objPublishSubscribeBLL.SubscriberRatePublisher(objPublishSubscribeDTO);
                    if (Result == "1")
                    {
                        txtRating.Text = "";
                        Response.Redirect("SubscriberDashBoard.aspx");
                    }
                    else if (Result == "2")
                    {
                        lblMsg.Text      = "Publisher Rated Already";
                        lblMsg.ForeColor = System.Drawing.Color.Red;
                    }
                }
            }
            catch
            {
            }
        }
Exemple #5
0
        private void LoadPublishRatings()
        {
            try
            {
                objPublishSubscribeBLL = new BLL.PublishContentSubscribeBLL();
                objPublishSubscribeDTO = new DTO.PublishContentSubscribeDTO();
                DataTable tab = new DataTable();
                objPublishSubscribeDTO.EmailID = Session["EmailId"].ToString();
                tab = objPublishSubscribeBLL.GetPublishRating_EmailId(objPublishSubscribeDTO);
                Table1.Controls.Clear();
                lblMsg.Text = "";
                if (tab.Rows.Count > 0)
                {
                    TableRow        hr  = new TableRow();
                    TableHeaderCell hc1 = new TableHeaderCell();
                    TableHeaderCell hc2 = new TableHeaderCell();
                    TableHeaderCell hc3 = new TableHeaderCell();

                    hc1.Text = "Publisher Name";
                    hr.Cells.Add(hc1);
                    hc2.Text = "Rating Points";
                    hr.Cells.Add(hc2);
                    hc3.Text = "Edit";
                    hr.Cells.Add(hc3);
                    Table1.Rows.Add(hr);
                    for (int i = 0; i < tab.Rows.Count; i++)
                    {
                        TableRow row     = new TableRow();
                        Label    lblName = new Label();
                        //lblTitle.Width = 100;
                        lblName.Text = tab.Rows[i]["Name"].ToString();
                        TableCell Name = new TableCell();
                        Name.Controls.Add(lblName);


                        Label lblRating = new Label();
                        //lblSubTitle.Width = 100;
                        lblRating.Text = tab.Rows[i]["Rating"].ToString();
                        TableCell Rating = new TableCell();
                        Rating.Controls.Add(lblRating);



                        LinkButton Edit = new LinkButton();
                        Edit.Text            = "Edit";
                        Edit.ID              = "lnkEdit" + i.ToString();
                        Edit.CommandArgument = tab.Rows[i]["PublisherID"].ToString();
                        Edit.Click          += new EventHandler(Edit_Click);

                        TableCell EditCell = new TableCell();
                        EditCell.Controls.Add(Edit);



                        row.Controls.Add(Name);
                        row.Controls.Add(Rating);
                        row.Controls.Add(EditCell);
                        Table1.Controls.Add(row);
                    }
                }
                else
                {
                    lblMsg.Text = "No Record Found";
                }
            }
            catch
            {
            }
        }
        private void LoadPublishContent()
        {
            objPublishContentSubscribeBLL        = new BLL.PublishContentSubscribeBLL();
            objPublishContentSubscribeDTO        = new DTO.PublishContentSubscribeDTO();
            objPublishContentSubscribeDTO.UserID = UserID;

            DataTable tab = new DataTable();

            tab = objPublishContentSubscribeBLL.GetPublishContent_PublisherID(objPublishContentSubscribeDTO);
            Table1.Controls.Clear();
            lblMsg.Text = "";
            if (tab.Rows.Count > 0)
            {
                TableRow        hr  = new TableRow();
                TableHeaderCell hc1 = new TableHeaderCell();
                TableHeaderCell hc2 = new TableHeaderCell();
                TableHeaderCell hc3 = new TableHeaderCell();
                TableHeaderCell hc4 = new TableHeaderCell();
                TableHeaderCell hc5 = new TableHeaderCell();
                //TableHeaderCell hc6 = new TableHeaderCell();


                hc1.Text = "Title";
                hr.Cells.Add(hc1);
                hc2.Text = "Sub Title";
                hr.Cells.Add(hc2);
                hc3.Text = "Created Date";
                hr.Cells.Add(hc3);
                hc4.Text = "Category Name";
                hr.Cells.Add(hc4);
                hc5.Text = "View";
                hr.Cells.Add(hc5);
                //hc6.Text = "Delete";
                //hr.Cells.Add(hc6);
                Table1.Rows.Add(hr);
                for (int i = 0; i < tab.Rows.Count; i++)
                {
                    //Table1.BorderWidth = 4;
                    //Table1.GridLines = GridLines.Both;
                    ////Table1.BackColor = System.Drawing.Color.White;
                    //Table1.BorderColor = System.Drawing.Color.Black;
                    //Table1.ForeColor = System.Drawing.Color.Black;

                    TableRow row = new TableRow();

                    Label lblTitle = new Label();
                    //lblTitle.Width = 100;
                    lblTitle.Text = tab.Rows[i]["Title"].ToString();
                    TableCell Title = new TableCell();
                    Title.Controls.Add(lblTitle);


                    Label lblSubTitle = new Label();
                    //lblSubTitle.Width = 100;
                    lblSubTitle.Text = tab.Rows[i]["SubTitle"].ToString();
                    TableCell SubTitle = new TableCell();
                    SubTitle.Controls.Add(lblSubTitle);

                    Label lblDate = new Label();
                    //lblDate.Width = 50;
                    lblDate.Text = tab.Rows[i]["CreateDate"].ToString();
                    TableCell date = new TableCell();
                    date.Controls.Add(lblDate);

                    Label lblCategory = new Label();
                    //lblDate.Width = 50;
                    lblCategory.Text = tab.Rows[i]["CategoryName"].ToString();
                    TableCell Category = new TableCell();
                    Category.Controls.Add(lblCategory);

                    LinkButton View = new LinkButton();
                    View.Text = "View";
                    View.ID   = "lnkView" + i.ToString();
                    //View.Attributes.Add("data-toggle", "modal");
                    //View.Attributes.Add("data-target", "#myModal");
                    View.CommandArgument = tab.Rows[i]["PublishContentID"].ToString();
                    View.Click          += new EventHandler(View_Click);

                    TableCell ViewCell = new TableCell();
                    ViewCell.Controls.Add(View);



                    //row.Controls.Add(courseid);
                    row.Controls.Add(Title);
                    row.Controls.Add(SubTitle);
                    row.Controls.Add(date);
                    row.Controls.Add(Category);
                    row.Controls.Add(ViewCell);
                    Table1.Controls.Add(row);
                }
            }
            else
            {
                lblMsg.Text = "No Record Found";
            }
        }
Exemple #7
0
        private void LoadPublishContent()
        {
            objPublishSubscribeBLL            = new BLL.PublishContentSubscribeBLL();
            objPublishSubscribeDTO            = new DTO.PublishContentSubscribeDTO();
            objPublishSubscribeDTO.CategoryId = int.Parse(ddlCategory.SelectedItem.Value);

            DataTable tab = new DataTable();

            tab = objPublishSubscribeBLL.GetPublishContentCount_Publisher(objPublishSubscribeDTO);
            Table1.Controls.Clear();
            lblMsg.Text = "";
            if (tab.Rows.Count > 0)
            {
                TableRow        hr  = new TableRow();
                TableHeaderCell hc1 = new TableHeaderCell();
                TableHeaderCell hc2 = new TableHeaderCell();
                TableHeaderCell hc3 = new TableHeaderCell();
                TableHeaderCell hc4 = new TableHeaderCell();
                //TableHeaderCell hc5 = new TableHeaderCell();
                //TableHeaderCell hc6 = new TableHeaderCell();


                hc1.Text = "Publisher Name";
                hr.Cells.Add(hc1);
                hc2.Text = "Publish Content Count";
                hr.Cells.Add(hc2);
                hc3.Text = "View";
                hr.Cells.Add(hc3);
                hc4.Text = "Subscribe";
                hr.Cells.Add(hc4);
                Table1.Rows.Add(hr);
                for (int i = 0; i < tab.Rows.Count; i++)
                {
                    TableRow row     = new TableRow();
                    Label    lblName = new Label();
                    //lblTitle.Width = 100;
                    lblName.Text = tab.Rows[i]["Name"].ToString();
                    TableCell Name = new TableCell();
                    Name.Controls.Add(lblName);


                    Label lblPublishCount = new Label();
                    //lblSubTitle.Width = 100;
                    lblPublishCount.Text = tab.Rows[i]["PublishCount"].ToString();
                    TableCell PublishCount = new TableCell();
                    PublishCount.Controls.Add(lblPublishCount);



                    LinkButton View = new LinkButton();
                    View.Text            = "View";
                    View.ID              = "lnkView" + i.ToString();
                    View.CommandArgument = tab.Rows[i]["UserId"].ToString();
                    View.Click          += new EventHandler(View_Click);

                    TableCell ViewCell = new TableCell();
                    ViewCell.Controls.Add(View);

                    LinkButton Subscribe = new LinkButton();
                    Subscribe.Text            = "Subscribe";
                    Subscribe.ID              = "lnkSubscribe" + i.ToString();
                    Subscribe.CommandArgument = tab.Rows[i]["UserId"].ToString();
                    Subscribe.Click          += new EventHandler(Subscribe_Click);

                    TableCell SubscribeCell = new TableCell();
                    SubscribeCell.Controls.Add(Subscribe);


                    row.Controls.Add(Name);
                    row.Controls.Add(PublishCount);
                    row.Controls.Add(ViewCell);
                    row.Controls.Add(SubscribeCell);
                    Table1.Controls.Add(row);
                }
            }
            else
            {
                lblMsg.Text = "No Record Found";
            }
        }