Exemplo n.º 1
0
        protected void LbtnDelFavs_Click(object sender, EventArgs e)
        {
            GridViewRow row = gvFavJobs.SelectedRow;

            DbUser user = new DbUser();

            user.UserId = int.Parse(Session["userid"].ToString());

            List <DbUser> userList = new List <DbUser>();

            userList.Add(user);
            jobId       = int.Parse(Session["jobId"].ToString());
            lblMsg.Text = "Favourite is been deleted";
            //lblStatus.Text = jobId.ToString();

            if (service.DeleteFavourite(userList, jobId))
            {
                pnlSelectJob.Visible    = false;
                lblStatus.Text          = "";
                lblStream.Text          = "";
                lblLocation.Text        = "";
                lblCompany.Text         = "";
                lblTitle.Text           = "";
                lblDescription.Text     = "";
                lblDateposted.Text      = "";
                lblDeadline.Text        = "";
                gvFavJobs.SelectedIndex = -1;
                lbtnAddComment.Visible  = false;
                dt = null;
                gvComments.DataSource = dt;
                gvComments.DataBind();
                if (gvFavJobs.Rows.Count <= 1)
                {
                    // gvRecentJobs.DataSource = null;
                    gvFavJobs.Visible = false;
                }
                else
                {
                    BindDataToGridView();
                }

                lblMsg.Visible = true;
            }
        }