예제 #1
0
        public JsonResult AddDesignation(Designation rec)
        {
            DesignationServices services = new DesignationServices();

            services.AddDesignation(rec);
            return(Json(new { msg = "save" }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public ActionResult DesignationList()
        {
            DesignationServices services = new DesignationServices();
            var list = services.List();

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            model.DesignationName = txtDesignationName.Text;

            DesignationServices.Insert(model);
            Clear();
            DataGvProperties();
            lblError.Text = "Record Inserted.";
        }
예제 #4
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            model.Id = Convert.ToInt32(txtId.Text);

            model.DesignationName = txtDesignationName.Text;

            DesignationServices.Update(model);

            lblError.Text = "Designation Successfully Updated.";
            Clear();
            DataGvProperties();
        }
예제 #5
0
        public ActionResult RemoveDesignation(int id)
        {
            DesignationServices services = new DesignationServices();

            if (Session["admin"] != null)
            {
                services.Remove(id);
                return(Json(new { msg = "Done" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(RedirectToAction("Login", "Home"));
            }
        }
예제 #6
0
 void DataGvProperties()
 {
     GridViewDesignation.DataSource = DesignationServices.GetAll();
     GridViewDesignation.DataBind();
 }