public ActionResult Delete(int id) { DesignationBLL objDesignationBll = new DesignationBLL(); var designation = objDesignationBll.GetAllDesignation(id); return(View(designation)); }
public ActionResult Index() { DesignationBLL objDesignationBll = new DesignationBLL(); List <Models.Designation> designationList = objDesignationBll.GetAllDesignation(); return(View(designationList)); }
public ActionResult DeleteDesignation(int id) { if (ModelState.IsValid) { DesignationBLL objDesignationBll = new DesignationBLL(); objDesignationBll.DeleteDesignation(id); } return(RedirectToAction("Index", "Designation")); }
public ActionResult Edit(Designation objDesignation) { if (ModelState.IsValid) { DesignationBLL objDesignationBll = new DesignationBLL(); objDesignationBll.UpadateDesignation(objDesignation); } return(RedirectToAction("Index", "Designation")); }
private void populateCboDesignation() { DesignationBLL designation = new DesignationBLL(); List <Designation> des = new List <Designation>(); des = designation.GetAll(); foreach (Designation d in des) { cboDesignation.Items.Add(d.Position); } }
public JsonResult GetDesignationNameIsExist(string DesignationName) { DesignationBLL objDesignationBLL = new DesignationBLL(); bool exsits = objDesignationBLL.GetDesignationNameIsExist(DesignationName); if (exsits) { return(Json(false, JsonRequestBehavior.AllowGet)); } else { return(Json(true, JsonRequestBehavior.AllowGet)); } }
private void BindDesignation() { try { DataTable tblDesig = new DesignationBLL().GetAllDesignations(); DataRow dr = tblDesig.NewRow(); dr["PKId"] = 0; dr["DesignationDesc"] = "---Select---"; tblDesig.Rows.InsertAt(dr, 0); ddlDesignation.DataSource = tblDesig; ddlDesignation.DataValueField = "PKId"; ddlDesignation.DataTextField = "DesignationDesc"; ddlDesignation.DataBind(); } catch (Exception ex) { lblMessage.Text = ex.Message; } }
public bool Insert(DesignationBLL dbll) { bool IsSuccess = false; SqlConnection con = new SqlConnection(this.con.connection); string sql = "INSERT INTO [dbo].[Designation]" + "([Designation]" + ",[Description])" + "VALUES" + "(@Designation" + ",@Description)"; SqlCommand cmd = new SqlCommand(sql, con); cmd.Parameters.AddWithValue("@Designation", dbll.Designation); cmd.Parameters.AddWithValue("@Description", dbll.Designation); try { con.Open(); int i = cmd.ExecuteNonQuery(); if (i > 0) { IsSuccess = true; } else { IsSuccess = false; } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Data Access Error"); } finally { cmd.Dispose(); con.Close(); } return(IsSuccess); }