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) { } }
/// <summary> /// Update Subscriber Rate Publisher Content/Publisher /// </summary> /// <param name="objApplicationUser"></param> /// <returns></returns> public string UpdateSubscriberRatePublisher(PublisherSubcriberNotification.DTO.PublishContentSubscribeDTO objPublishContentSubscribeDTO) { try { cmd = new SqlCommand(); open_connection(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SP_Update_SubscriberRatePublisher"; cmd.Parameters.Add("@PublisherID", objPublishContentSubscribeDTO.PublisherID); cmd.Parameters.Add("@EmailID", objPublishContentSubscribeDTO.EmailID); cmd.Parameters.Add("@Rating", objPublishContentSubscribeDTO.Rate); SqlDataReader sqlreader = cmd.ExecuteReader(); string result = null; if (sqlreader.Read()) { result = sqlreader.GetValue(0).ToString(); } sqlreader.Close(); con.Close(); return(result); } catch (Exception ex) { return(ex.ToString()); } }
void Edit_Click(object sender, EventArgs e) { //throw new NotImplementedException(); objPublishSubscribeDTO = new DTO.PublishContentSubscribeDTO(); LinkButton lnk = (LinkButton)sender; objPublishSubscribeDTO.UserID = int.Parse(lnk.CommandArgument.ToString()); Response.Redirect("SubscriberRatePublisher.aspx?PublisherUserID=" + objPublishSubscribeDTO.UserID); }
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); }
/// <summary> /// Get Publish Rating /// </summary> /// <returns></returns> public DataTable GetPublishRating_EmailId(PublisherSubcriberNotification.DTO.PublishContentSubscribeDTO objPublishContentSubscribeDTO) { try { objPublishContentSubscribeDAL = new DAL.PublishContentSubscribeDAL(); return(objPublishContentSubscribeDAL.GetPublishRating_EmailId(objPublishContentSubscribeDTO)); } catch (Exception ex) { return(null); } }
/// <summary> /// update Subscriber Rate Publisher Content/Publisher /// </summary> /// <param name="objPublishContentSubscribeDTO"></param> /// <returns></returns> public string UpdateSubscriberRatePublisher(PublisherSubcriberNotification.DTO.PublishContentSubscribeDTO objPublishContentSubscribeDTO) { try { objPublishContentSubscribeDAL = new DAL.PublishContentSubscribeDAL(); return(objPublishContentSubscribeDAL.UpdateSubscriberRatePublisher(objPublishContentSubscribeDTO)); } catch (Exception ex) { return(null); } }
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 { } }
/// <summary> /// Get Publish Content Based on UserId Top 5 /// </summary> /// <returns></returns> public DataTable GetPublishContent_Top_5(PublisherSubcriberNotification.DTO.PublishContentSubscribeDTO objPublishContentSubscribeDTO) { try { cmd = new SqlCommand(); open_connection(); SqlDataAdapter adp = null; DataTable loaddata = new DataTable(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SP_GetPublishContent_UserID_Top_5"; cmd.Parameters.Add("@EmailID", objPublishContentSubscribeDTO.EmailID); adp = new SqlDataAdapter(cmd); adp.Fill(loaddata); con.Close(); return(loaddata); } catch (Exception ex) { return(null); } }
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"; } }
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"; } }