Esempio n. 1
0
 protected void GridViewJobPostList_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         MyJobPortalModel.Department ObjDepartmentName = new MyJobPortalModel.Department(int.Parse(e.Row.Cells[2].Text));
         e.Row.Cells[2].Text = ObjDepartmentName.DepartmentName;
         MyJobPortalModel.Designation ObjDesignationName = new MyJobPortalModel.Designation(int.Parse(e.Row.Cells[1].Text));
         e.Row.Cells[1].Text = ObjDesignationName.DesignationName;
     }
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack == false)
     {
         TxtDesignation.Focus();
         this.Form.DefaultButton = BtnUpdate.UniqueID;
         MyJobPortalModel.Designation ObjDesignation = new MyJobPortalModel.Designation(int.Parse(Request.QueryString["Id"]));
         TxtDesignation.Text     = ObjDesignation.DesignationName;
         DdlStatus.SelectedValue = ObjDesignation.Status;
     }
 }
Esempio n. 3
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        if (this.IsValid == true)
        {
            bool      AllOk = true;
            DataTable ObjDesignationTable = MyJobPortalModel.Designation.GetDesignationRecords("DesignationName ='" + TxtDesignation.Text.Replace("'", "''").Trim() + "' and Id<>" + Request.QueryString["Id"]);

            if ((int)ObjDesignationTable.Rows.Count > 0)
            {
                LblDuplicateDesignationError.Visible = true;
                AllOk = false;
                TxtDesignation.Focus();
                return;
            }
            if (AllOk == true)
            {
                MyJobPortalModel.Designation ObjDesignation = new MyJobPortalModel.Designation(int.Parse(Request.QueryString["Id"]));
                ObjDesignation.DesignationName = TxtDesignation.Text.Replace("'", "''");
                ObjDesignation.Status          = DdlStatus.SelectedValue;
                ObjDesignation.Update();
                Response.Redirect("DesignationList.aspx?Message=Record has been Updated");
            }
        }
    }