コード例 #1
0
        //private void LoadContent()
        //{

        //}
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            objPublishBLL = new BLL.PublishContentBLL();
            objPublishDTO = new DTO.PublishContentDTO();
            try
            {
                objPublishDTO.PublishContentID = PublishContentId;
                objPublishDTO.CategoryID       = Int64.Parse(ddlCategory.SelectedItem.Value);
                objPublishDTO.Title            = txtTitle.Text;
                objPublishDTO.SubTitle         = txtSubTitle.Text;
                objPublishDTO.Description      = txtDespcription.Value;
                objPublishDTO.EmailId          = Session["EmailId"].ToString();
                string result = objPublishBLL.Update_PublishContent(objPublishDTO);
                if (result == "1")
                {
                    //Session["PublishContentTitle"] = txtTitle.Text;
                    //Session["PublishContentSubTitle"] = txtSubTitle.Text;
                    //Session["PublishContentDescp"] = txtDespcription.Value;
                    txtTitle.Text             = txtSubTitle.Text = txtDespcription.Value = "";
                    ddlCategory.SelectedIndex = 0;
                    Response.Redirect("PublisherViewContent.aspx");
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable tab = new DataTable();

            objPublishBLL    = new BLL.PublishContentBLL();
            objPublishDTO    = new DTO.PublishContentDTO();
            PublishContentId = Int64.Parse(Request.QueryString["PublishContentId"]);
            objPublishDTO.PublishContentID = PublishContentId;
            tab = objPublishBLL.GetPublishContent_ID(objPublishDTO);
            Session["PublishContentTitle"]    = tab.Rows[0]["Title"].ToString();
            Session["PublishContentSubTitle"] = tab.Rows[0]["SubTitle"].ToString();
            Session["PublishContentDescp"]    = tab.Rows[0]["Description"].ToString();
        }
コード例 #3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                objPublishBLL             = new BLL.PublishContentBLL();
                objPublishDTO             = new DTO.PublishContentDTO();
                objPublishDTO.CategoryID  = Int64.Parse(ddlCategory.SelectedItem.Value);
                objPublishDTO.Title       = txtTitle.Text;
                objPublishDTO.SubTitle    = txtSubTitle.Text;
                objPublishDTO.Description = txtDespcription.Value;
                objPublishDTO.EmailId     = Session["EmailId"].ToString();
                DataTable tab = new DataTable();
                tab = objPublishBLL.PublishNew_Content(objPublishDTO);
                if (tab.Rows.Count > 0)
                {
                    //string Results = objPublishBLL.PublishNew_Content(objPublishDTO);
                    for (int i = 0; i < tab.Rows.Count; i++)
                    {
                        string[] devices = tab.Rows[i]["DeviceId"].ToString().Split(',');

                        for (int j = 0; j < devices.Length; j++)
                        {
                            GCMAlert.Send("New content published-" + tab.Rows[i]["PublishContentId"].ToString(), devices[j]);
                        }

                        objPublishDTO.UserId           = Int64.Parse(tab.Rows[i]["SubUserId"].ToString());
                        objPublishDTO.PublishContentID = Int64.Parse(tab.Rows[i]["PublishContentId"].ToString());
                        string result = objPublishBLL.DeviceStatusUpdate(objPublishDTO);
                    }
                }
                txtTitle.Text             = txtSubTitle.Text = txtDespcription.Value = "";
                ddlCategory.SelectedIndex = 0;
                lblMsg.Text      = "Content Published Sucessfully";
                lblMsg.ForeColor = System.Drawing.Color.Green;
                //       }
                //       else
                //       {
                //           lblMsg.Text = "Content Publish Error";
                //           lblMsg.ForeColor = System.Drawing.Color.Red;
                //       }
            }
            catch (Exception ex)
            {
            }
        }
コード例 #4
0
 protected void btndelete_Click(object sender, EventArgs e)
 {
     objPublishBLL = new BLL.PublishContentBLL();
     objPublishDTO = new DTO.PublishContentDTO();
     try
     {
         objPublishDTO.PublishContentID = PublishContentId;
         objPublishDTO.EmailId          = Session["EmailId"].ToString();
         string result = objPublishBLL.Deactive_PublishContent(objPublishDTO);
         if (result == "1")
         {
             Response.Redirect("PublisherViewContent.aspx");
         }
         else
         {
         }
     }
     catch (Exception ex)
     {
     }
 }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                objCategoryBLL             = new BLL.CategoryBLL();
                ddlCategory.DataSource     = objCategoryBLL.GetCategory();
                ddlCategory.DataTextField  = "CategoryName";
                ddlCategory.DataValueField = "CategoryId";
                ddlCategory.DataBind();
                ddlCategory.Items.Insert(0, "--Select Category--");

                DataTable tab = new DataTable();
                objPublishBLL    = new BLL.PublishContentBLL();
                objPublishDTO    = new DTO.PublishContentDTO();
                PublishContentId = Int64.Parse(Request.QueryString["PublishContentId"]);
                objPublishDTO.PublishContentID = PublishContentId;
                tab = objPublishBLL.GetPublishContent_ID(objPublishDTO);
                ddlCategory.SelectedValue = tab.Rows[0]["CategoryID"].ToString();
                txtTitle.Text             = tab.Rows[0]["Title"].ToString();
                txtSubTitle.Text          = tab.Rows[0]["SubTitle"].ToString();
                txtDespcription.Value     = tab.Rows[0]["Description"].ToString();
            }
            //LoadContent();
        }
        private void LoadPublishContent()
        {
            objPublishBLL            = new BLL.PublishContentBLL();
            objPublishDTO            = new DTO.PublishContentDTO();
            objPublishDTO.CategoryID = Int64.Parse(ddlCategory.SelectedItem.Value);
            objPublishDTO.EmailId    = Session["EmailId"].ToString();

            DataTable tab = new DataTable();

            tab = objPublishBLL.GetPublishContent_Deactive(objPublishDTO);
            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();


                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 = "View";
                hr.Cells.Add(hc4);
                Table1.Rows.Add(hr);
                for (int i = 0; i < tab.Rows.Count; i++)
                {
                    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);

                    LinkButton Active = new LinkButton();
                    Active.Text            = "Active";
                    Active.ID              = "lnkActive" + i.ToString();
                    Active.CommandArgument = tab.Rows[i]["PublishContentID"].ToString();
                    Active.Click          += new EventHandler(Active_Click);

                    TableCell ActiveCell = new TableCell();
                    ActiveCell.Controls.Add(Active);


                    row.Controls.Add(Title);
                    row.Controls.Add(SubTitle);
                    row.Controls.Add(date);
                    row.Controls.Add(ActiveCell);
                    Table1.Controls.Add(row);
                }
            }
            else
            {
                lblMsg.Text = "No Record Found";
            }
        }
        private void LoadPublishContent()
        {
            objPublishBLL            = new BLL.PublishContentBLL();
            objPublishDTO            = new DTO.PublishContentDTO();
            objPublishDTO.CategoryID = Int64.Parse(ddlCategory.SelectedItem.Value);
            objPublishDTO.EmailId    = Session["EmailId"].ToString();

            DataTable tab = new DataTable();

            tab = objPublishBLL.GetPublishContent_User(objPublishDTO);
            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 = "View";
                hr.Cells.Add(hc4);
                //hc5.Text = "Edit";
                //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);

                    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(ViewCell);
                    //row.Controls.Add(EditCell);
                    //row.Controls.Add(Deletecell);
                    Table1.Controls.Add(row);
                }
            }
            else
            {
                lblMsg.Text = "No Record Found";
            }
        }