public JsonResult IsEnabledActivity(bool id)
 {
     try
     {
         ENT.IsEnabledApiCall model2 = new ENT.IsEnabledApiCall();
         BAL.IsEnabledApiCall objBAL = new BAL.IsEnabledApiCall();
         if (id == true || id == false)
         {
             model2.Isenabled  = id;
             model2.ipaddress  = new GenralGetIp().GetIPAddress(Request);
             model2.userid     = Guid.Parse(User.Identity.GetUserId());
             model2.enabletext = (id == true ? "ON" : "OFF");
             if (objBAL.Insert(model2))
             {
                 GlobalVarible.AddMessage("Record Save Successfully");
             }
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }
 public JsonResult GetIsEnabled()
 {
     GlobalVarible.Clear();
     ENT.IsEnabledApiCall model = new ENT.IsEnabledApiCall();
     using (BAL.IsEnabledApiCall obj = new BAL.IsEnabledApiCall())
     {
         model = (ENT.IsEnabledApiCall)obj.GetIsEnabled(Guid.Parse(User.Identity.GetUserId()));
     }
     return(Json(model, JsonRequestBehavior.AllowGet));
 }