public JsonResult GetAllAccounts()
 {
     if (Session["LOGGEDIN"] != null)
     {
         try
         {
             objfirstTierProperty = new firstTier_Property();
             objfirstTier         = new firstTier_BLL(objfirstTierProperty);
             var Data = JsonConvert.SerializeObject(objfirstTier.ViewAll());
             return(Json(new { data = Data, success = true, statuscode = 200, count = Data.Length }, JsonRequestBehavior.AllowGet));
         }
         catch (Exception ex)
         {
             return(Json(new { data = ex.Message, success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
         }
     }
     else
     {
         return(Json(new { data = "Session Expired", success = false, statuscode = 400, count = 0 }, JsonRequestBehavior.AllowGet));
     }
 }
Beispiel #2
0
 public ActionResult AddNew(int?id)
 {
     if (Session["LOGGEDIN"] != null)
     {
         objthirdTierproperty = new thirdTier_Property();
         //objBanlBLL = new Bank_BLL();
         //firstTier_Property headAccounts = new firstTier_Property() ;
         firstTier_BLL headAccountBLL = new firstTier_BLL();
         var           data           = headAccountBLL.ViewAll();
         var           headOFAccounts = removeAssetsAndLiability(data);
         data.AcceptChanges();
         objthirdTierproperty.headLST = Helper.ConvertDataTable <firstTier_Property>(headOFAccounts);
         try
         {
             if (id > 0)
             {
                 objthirdTierproperty.idx = Convert.ToInt32(id);
                 objthirdTierbll          = new thirdTier_BLL(objthirdTierproperty);
                 var dt = objthirdTierbll.GetthirdTierById();
                 objthirdTierproperty.headIdx     = int.Parse(dt.Rows[0]["headIdx"].ToString());
                 objthirdTierproperty.subHeadName = dt.Rows[0]["subHeadName"].ToString();
             }
             else
             {
             }
         }
         catch (Exception ex)
         {
         }
         return(PartialView("_AddNew", objthirdTierproperty));
     }
     else
     {
         return(RedirectToAction("Login", "Account"));
     }
 }