Example #1
0
 private void DataBindReq()
 {
     BLL.Career CareerReq = new BLL.Career();
     CareerReq.LoadAll();
     GrdCareerRequest.DataSource = CareerReq.DefaultView;
     GrdCareerRequest.DataBind();
 }
 protected void GrdCareers_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "EditCareer")
     {
         int ID = int.Parse(e.CommandArgument.ToString());
         Response.Redirect("CareersContent.aspx?PID=" + ID.ToString());
     }
     else if (e.CommandName=="DeleteCareer")
     {
         int ID = int.Parse(e.CommandArgument.ToString());
         BLL.Career DeleteCareer = new BLL.Career();
         DeleteCareer.LoadByPrimaryKey(ID);
         DeleteCareer.MarkAsDeleted();
         DeleteCareer.Save();
         getCareersData();
     }
 }
Example #3
0
        protected void GrdCareerRequest_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            BLL.Career carReq = new BLL.Career();
            carReq.LoadByPrimaryKey(int.Parse(e.CommandArgument.ToString()));

            if (e.CommandName == "DownloadCV")
            {
                string url = carReq.FilePath.ToString();
                Response.Redirect(url);
            }
            else if (e.CommandName == "DeleteGrd")
            {
                carReq.MarkAsDeleted();
                carReq.Save();
                DataBindReq();
            }
        }
        protected void GrdCareerRequest_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DataRowView Row = (DataRowView)e.Row.DataItem;
                if (!string.IsNullOrEmpty(Row["CareerID"].ToString()))
                {
                    int ID = int.Parse(Row["CareerID"].ToString());

                    BLL.Career currCareer = new BLL.Career();
                    if (currCareer.LoadByPrimaryKey(ID))
                    {
                        Label lblCareerName = e.Row.FindControl("uiLabelPostion") as Label;
                        lblCareerName.Text = currCareer.PositionEn;
                    }
                }
            }
        }
        protected void btnCreateCareer_Click(object sender, EventArgs e)
        {
            BLL.Career NewCareer = new BLL.Career();

            if (getQueryString > 0)
            {
                NewCareer.LoadByPrimaryKey(getQueryString);
                NewCareer.PositionEn = txtCareerPosition.Text;

            }
            else
            {
                NewCareer.AddNew();
                NewCareer.PositionEn = txtCareerPosition.Text;

            }
            NewCareer.DescriptionEn = Server.HtmlEncode(uiFCKeditorArContent.Value);
            NewCareer.Save();
            Response.Redirect("CareersContent.aspx");
            getCareersData();
            ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + "Saved Successfully" + "');", true);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ShowWidgets();
                getCareersData();
            }

            if (getQueryString > 0)
            {
                if (!Page.IsPostBack)
                {
                    ShowWidgets();
                    btnNewCareer.Visible = true;

                    BLL.Career EditCareer = new BLL.Career();
                    EditCareer.LoadByPrimaryKey(getQueryString);

                    txtCareerPosition.Text = EditCareer.PositionEn;
                    uiFCKeditorArContent.Value = Server.HtmlDecode(EditCareer.DescriptionEn);

                    btnCreateCareer.Text = "Update Career";
                }
            }
        }
 private void getCareersData()
 {
     BLL.Career CareersData = new BLL.Career();
     CareersData.LoadAll();
     GrdCareers.DataSource = CareersData.DefaultView;
     GrdCareers.DataBind();
 }