/// <summary>
 /// Publish Content
 /// </summary>
 /// <param name="objApplicationUser"></param>
 /// <returns></returns>
 public DataTable PublishNew_Content(PublisherSubcriberNotification.DTO.PublishContentDTO objPublishContentDTO)
 {
     try
     {
         cmd = new SqlCommand();
         open_connection();
         SqlDataAdapter adp      = null;
         DataTable      loaddata = new DataTable();
         cmd.Connection  = con;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "SP_PublishContent";
         cmd.Parameters.Add("@CategoryID", objPublishContentDTO.CategoryID);
         cmd.Parameters.Add("@Title", objPublishContentDTO.Title);
         cmd.Parameters.Add("@SubTitle", objPublishContentDTO.SubTitle);
         cmd.Parameters.Add("@Description", objPublishContentDTO.Description);
         cmd.Parameters.Add("@EmailID", objPublishContentDTO.EmailId);
         adp = new SqlDataAdapter(cmd);
         adp.Fill(loaddata);
         con.Close();
         return(loaddata);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 /// <summary>
 /// Deactive Publish Content
 /// </summary>
 /// <param name="objApplicationUser"></param>
 /// <returns></returns>
 public string Deactive_PublishContent(PublisherSubcriberNotification.DTO.PublishContentDTO objPublishContentDTO)
 {
     try
     {
         cmd = new SqlCommand();
         open_connection();
         cmd.Connection  = con;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "SP_Deactive_PublishContent";
         cmd.Parameters.Add("@PublishContentID", objPublishContentDTO.PublishContentID);
         cmd.Parameters.Add("@EmailID", objPublishContentDTO.EmailId);
         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());
     }
 }
Exemplo n.º 3
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)
            {
            }
        }
 /// <summary>
 /// Deactive Publish Content
 /// </summary>
 /// <param name="objCategoryDTO"></param>
 /// <returns></returns>
 public string Active_PublishContent(PublisherSubcriberNotification.DTO.PublishContentDTO objPublishContentDTO)
 {
     try
     {
         return(objPublishContentDAL.Active_PublishContent(objPublishContentDTO));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 /// <summary>
 /// Update Device Status
 /// </summary>
 /// <param name="objCategoryDTO"></param>
 /// <returns></returns>
 public string DeviceStatusUpdate(PublisherSubcriberNotification.DTO.PublishContentDTO objPublishContentDTO)
 {
     try
     {
         return(objPublishContentDAL.DeviceStatusUpdate(objPublishContentDTO));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 /// <summary>
 /// Publish New Content
 /// </summary>
 /// <param name="objCategoryDTO"></param>
 /// <returns></returns>
 public DataTable PublishNew_Content(PublisherSubcriberNotification.DTO.PublishContentDTO objPublishContentDTO)
 {
     try
     {
         return(objPublishContentDAL.PublishNew_Content(objPublishContentDTO));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
 /// <summary>
 /// Get Publish Content Based PublishContentID
 /// </summary>
 /// <returns></returns>
 public DataTable GetPublishContent_ID(PublisherSubcriberNotification.DTO.PublishContentDTO objPublishContentDTO)
 {
     try
     {
         return(objPublishContentDAL.GetPublishContentID(objPublishContentDTO));
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
        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();
        }
        void Active_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            objPublishDTO = new DTO.PublishContentDTO();
            LinkButton lnk = (LinkButton)sender;

            objPublishDTO.PublishContentID = int.Parse(lnk.CommandArgument.ToString());
            objPublishDTO.EmailId          = Session["EmailId"].ToString();
            string Result = objPublishBLL.Active_PublishContent(objPublishDTO);

            if (Result == "1")
            {
                Response.Redirect("PublisherViewContent.aspx");
            }
        }
Exemplo n.º 10
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)
            {
            }
        }
        void View_Click(object sender, EventArgs e)
        {
            //throw new NotImplementedException();
            objPublishDTO = new DTO.PublishContentDTO();
            LinkButton lnk = (LinkButton)sender;

            //lnk.Attributes.Add("data-toggle", "modal");
            //lnk.Attributes.Add("data-target", "#myModal");
            objPublishDTO.PublishContentID = int.Parse(lnk.CommandArgument.ToString());
            DataTable tab = new DataTable();

            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();
            Response.Redirect("PublishContentDetailsView.aspx?PublishContentId=" + objPublishDTO.PublishContentID);
            //lblPublicContent.Text = Server.HtmlDecode((tab.Rows[0][0]).ToString());
        }
Exemplo n.º 12
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)
     {
     }
 }
 /// <summary>
 /// Get Publish Content Based PublishContentID
 /// </summary>
 /// <returns></returns>
 public DataTable GetPublishContentID(PublisherSubcriberNotification.DTO.PublishContentDTO objPublishContentDTO)
 {
     try
     {
         cmd = new SqlCommand();
         open_connection();
         SqlDataAdapter adp      = null;
         DataTable      loaddata = new DataTable();
         cmd.Connection  = con;
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.CommandText = "SP_GetPublishContent_ID";
         cmd.Parameters.Add("@PublishContentID", objPublishContentDTO.PublishContentID);
         adp = new SqlDataAdapter(cmd);
         adp.Fill(loaddata);
         con.Close();
         return(loaddata);
     }
     catch (Exception ex)
     {
         return(null);
     }
 }
Exemplo n.º 14
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";
            }
        }