예제 #1
0
        public JsonResult GetDeputations()
        {
            objDepuBLL = new Deputation_BLL();
            DataTable dt = objDepuBLL.SelectAll();
            var       JsonDeputations = JsonConvert.SerializeObject(dt);

            return(Json(new { Deputation = JsonDeputations, msg = "OK" }, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public ActionResult ShowDepartment(int id)
        {
            objDepuProp    = new Deputation_Property();
            objDepuProp.Id = id;
            objDepuBLL     = new Deputation_BLL(objDepuProp);
            DataTable dt = objDepuBLL.SelectOne();

            ViewBag.Deputation = dt;
            return(View("AddDeputation", objDepuProp));
        }
예제 #3
0
        public void GetDeputaion()
        {
            Deputation_BLL             Deputaion_BLL  = new Deputation_BLL();
            DataTable                  dt             = Deputaion_BLL.SelectAll();
            List <Deputation_Property> DeputationList = new List <Deputation_Property>();

            foreach (DataRow dr in dt.Rows)
            {
                Deputation_Property objEmployeeTypeProperty = new Deputation_Property();
                objEmployeeTypeProperty.Deputation_Location = dr["Deputation_Location"].ToString();
                objEmployeeTypeProperty.Id = Convert.ToInt32(dr["Id"].ToString());
                DeputationList.Add(objEmployeeTypeProperty);
            }
            ViewBag.DeputationLocation = DeputationList;
        }
예제 #4
0
        public JsonResult DeleteDeputation(int id)
        {
            objDepuProp    = new Deputation_Property();
            objDepuProp.Id = id;
            objDepuBLL     = new Deputation_BLL(objDepuProp);
            var flag = objDepuBLL.DeleteDeputation();

            if (flag)
            {
                return(Json(new { success = true, statuscode = 200, msg = "Successfull" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new { success = false, statuscode = 500, msg = "Failed" }, JsonRequestBehavior.AllowGet));
            }
        }
예제 #5
0
        public JsonResult AddDeputation(Deputation_Property objDep)
        {
            if (ModelState.IsValid)
            {
                if (objDep.Id <= 0)
                {
                    objDep.Date_Created = DateTime.Now;
                    objDep.Status       = "Active";
                    objDep.is_Active    = true;
                    objDep.Inserted_By  = Convert.ToInt32(SessionManager.CurrentUser.ID);
                    objDepuBLL          = new Deputation_BLL(objDep);
                    var flag = objDepuBLL.Insert();
                    if (flag)
                    {
                        return(Json(new { success = true, statuscode = 200, msg = "Successfully inserted" }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { success = false, statuscode = 500, msg = "Failed" }, JsonRequestBehavior.AllowGet));
                    }
                }

                else
                {
                    objDep.Date_Created = DateTime.Now;
                    objDep.Status       = "Active";
                    objDep.is_Active    = true;
                    objDep.Inserted_By  = Convert.ToInt32(SessionManager.CurrentUser.ID);
                    objDepuBLL          = new Deputation_BLL(objDep);
                    var flag = objDepuBLL.Update();
                    if (flag)
                    {
                        return(Json(new { success = true, statuscode = 200, msg = "Successfully Updated" }, JsonRequestBehavior.AllowGet));
                    }
                    else
                    {
                        return(Json(new { success = false, statuscode = 500, msg = "Failed" }, JsonRequestBehavior.AllowGet));
                    }
                }
            }

            else
            {
                return(Json(new { success = false, statuscode = 500, msg = "Please Enter According To Instructions" }, JsonRequestBehavior.AllowGet));
            }
        }