Example #1
0
        public ActionResult ShowClient(int id)
        {
            objClientProp           = new Client_Property();
            objClientProp.Client_id = id;
            objClientProp.TableName = "tblClient";
            objClientBLL            = new Client_BLL(objClientProp);
            DataTable dt = objClientBLL.SelectOne();

            ViewBag.Client = dt;
            return(View("AddClient", objClientProp));
        }
Example #2
0
        public void GetClients()
        {
            Client_BLL             Client_BLL = new Client_BLL();
            DataTable              dt         = Client_BLL.ViewAll();
            List <Client_Property> Client_PropertylistItems = new List <Client_Property>();

            foreach (DataRow dr in dt.Rows)
            {
                Client_Property objclient = new Client_Property();
                objclient.Client_name = dr["Client_Name"].ToString();
                objclient.Client_id   = Convert.ToInt32(dr["ClientID"].ToString());
                Client_PropertylistItems.Add(objclient);
            }
            ViewBag.ClientlistItems = Client_PropertylistItems;
        }
Example #3
0
        public JsonResult DeleteClient(int id)
        {
            objClientProp           = new Client_Property();
            objClientProp.Client_id = id;
            objClientProp.TableName = "tblClient";
            objClientProp.Status    = "Deleted";
            // objClientProp.U_id = SessionManager.CurrentUser.ID;
            objClientBLL = new Client_BLL(objClientProp);
            var flag = objClientBLL.UpdateStatus();

            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));
            }
        }
Example #4
0
 public JsonResult AddClient(Client_Property objClientProp)
 {
     if (ModelState.IsValid)
     {
         if (objClientProp.Client_id <= 0)
         {
             objClientProp.Status    = "Active";
             objClientProp.Is_active = true;
             objClientProp.User_id   = SessionManager.CurrentUser.ID;
             objClientBLL            = new Client_BLL(objClientProp);
             var flag = objClientBLL.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
         {
             objClientProp.Status    = "Active";
             objClientProp.Is_active = true;
             objClientProp.User_id   = SessionManager.CurrentUser.ID;
             objClientBLL            = new Client_BLL(objClientProp);
             var flag = objClientBLL.Update();
             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
     {
         return(Json(new { success = false, statuscode = 500, msg = "Please Enter According To Instructions" }, JsonRequestBehavior.AllowGet));
     }
 }
Example #5
0
 public Client_DAL(Client_Property clientProp)
 {
     objClientProp = clientProp;
 }
Example #6
0
 public Client_BLL(Client_Property objClient)
 {
     objClientProp = objClient;
 }