Exemple #1
0
        public ActionResult Post(bool IsNew, Spartan_ObjectModel varSpartan_Object)
        {
            try
            {
                //if (ModelState.IsValid)
                //{
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _ISpartan_ObjectApiConsumer.SetAuthHeader(_tokenManager.Token);



                var result             = "";
                var Spartan_ObjectInfo = new Spartane.Core.Domain.Spartan_Object.Spartan_Object
                {
                    Object_Id = varSpartan_Object.Object_Id
                    , Name    = varSpartan_Object.Name
                };

                result = !IsNew?
                         _ISpartan_ObjectApiConsumer.Update(Spartan_ObjectInfo, null, null).Resource.ToString() :
                             _ISpartan_ObjectApiConsumer.Insert(Spartan_ObjectInfo, null, null).Resource.ToString();

                Session["KeyValueInserted"] = result;
                return(Json(result, JsonRequestBehavior.AllowGet));
                //}
                //return Json(false, JsonRequestBehavior.AllowGet);
            }
            catch (ServiceException ex)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
Exemple #2
0
        public ActionResult Delete(int id)
        {
            try
            {
                if (!_tokenManager.GenerateToken())
                {
                    return(Json(null, JsonRequestBehavior.AllowGet));
                }
                _ISpartan_ObjectApiConsumer.SetAuthHeader(_tokenManager.Token);

                Spartane.Core.Domain.Spartan_Object.Spartan_Object varSpartan_Object = null;
                if (id.ToString() != "0")
                {
                }
                var result = _ISpartan_ObjectApiConsumer.Delete(id, null, null).Resource;
                return(Json(result, JsonRequestBehavior.AllowGet));
            }
            catch (ServiceException ex)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
        public int Insert(Spartane.Core.Domain.Spartan_Object.Spartan_Object entity, Spartane.Core.Domain.User.GlobalData Spartan_ObjectInformation, Core.Domain.Data.DataLayerFieldsBitacora DataReference)
        {
            int rta = Convert.ToInt32("0");

            return(rta);
        }
 public Spartane.Core.Domain.Spartan_Object.Spartan_Object GetByKey(int Key, bool ConRelaciones)
 {
     Spartane.Core.Domain.Spartan_Object.Spartan_Object result = null;
     return(result);
 }