public ActionResult myList()
        {
            int uid = Convert.ToInt32(Session["uid"]);
            List <houseSheet> myListList = new CLike().mylist(uid);

            return(View(myListList));
        }
        public ActionResult deleteList(string id)
        {
            CLike D = new CLike();

            D.delete(id);

            return(RedirectToAction("myList"));
        }
Exemple #3
0
 public IActionResult AddCLike(CLike newclike)
 {
     if (ModelState.IsValid)
     {
         dbContext.clikes.Add(newclike);
         dbContext.SaveChanges();
         return(RedirectToAction("Wall", "Home"));
     }
     else
     {
         return(RedirectToAction("Index", "Home"));
     }
 }
Exemple #4
0
 public IActionResult UnlikeComment(int CLikeId)
 {
     if (HttpContext.Session.GetString("loggedin") == "true")
     {
         CLike myclike = dbContext.clikes.FirstOrDefault(c => c.CLikeId == CLikeId);
         if (myclike.UserId == HttpContext.Session.GetInt32("id"))
         {
             dbContext.clikes.Remove(myclike);
             dbContext.SaveChanges();
             return(RedirectToAction("Wall", "Home"));
         }
         else
         {
             return(RedirectToAction("Wall", "Home"));
         }
     }
     else
     {
         return(RedirectToAction("Index", "Home"));
     }
 }
Exemple #5
0
    public static void Main(string[] args)
    {
        // A generic MBase library initialisation
        Meta.Scripting.Runtime.iRuntime();
        CLikeCore.InitDLL.init();

        CLike.set_debuglevel(4);

        // Clike environment initialisation
        var env = CLike.init_module("mtest");

        // Defining a familiar signature
        CLike.compile(env, "int32 printf(int8 *format, ...);");

        // Not a C thing, actually - defining an MBase function that invokes C functions
        CLike.compile(env, "##function invoke_2(ptr,a,b) {(llvm_make_invoker(t_Int32,t_Int32,t_Int32))(ptr,a,b)}");

        CLike.compile(env, "int32 adder_inner(int32 x, int32 y) { return x*y + x*x; }");

        // And now finally a C function, which is going to be JITed immediately
        CLike.compile(env, "__stdcall int32 add(int32 x, int32 y) { printf(\"arg1=%d arg2=%d\\n\",x,y); return adder_inner(x,y); }");

        // This pointer points to a JIT-compiled entry
        var ptr = CLike.getptr(env, "add");

        // A generic MBase function invocation
        object res =
            Meta.Scripting.Runtime.apply(Meta.Scripting.Symbol.make("invoke_2"),
                                         new object[] { ptr, 22, 33 });

        // Displaying some results
        Console.WriteLine("ptr=" + ptr);
        Console.WriteLine("res=" + res);

        // Dumping LLVM bitcode file for a reference
        CLike.save(env, "out.bc");
    }
Exemple #6
0
        // Module defining this command


        // Optional custom code for this activity


        /// <summary>
        /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
        /// </summary>
        /// <param name="context">The NativeActivityContext for the currently running activity.</param>
        /// <returns>A populated instance of Sytem.Management.Automation.PowerShell</returns>
        /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
        protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
        {
            System.Management.Automation.PowerShell invoker       = global::System.Management.Automation.PowerShell.Create();
            System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);

            // Initialize the arguments

            if (InputObject.Expression != null)
            {
                targetCommand.AddParameter("InputObject", InputObject.Get(context));
            }

            if (FilterScript.Expression != null)
            {
                targetCommand.AddParameter("FilterScript", FilterScript.Get(context));
            }

            if (Property.Expression != null)
            {
                targetCommand.AddParameter("Property", Property.Get(context));
            }

            if (Value.Expression != null)
            {
                targetCommand.AddParameter("Value", Value.Get(context));
            }

            if (EQ.Expression != null)
            {
                targetCommand.AddParameter("EQ", EQ.Get(context));
            }

            if (CEQ.Expression != null)
            {
                targetCommand.AddParameter("CEQ", CEQ.Get(context));
            }

            if (NE.Expression != null)
            {
                targetCommand.AddParameter("NE", NE.Get(context));
            }

            if (CNE.Expression != null)
            {
                targetCommand.AddParameter("CNE", CNE.Get(context));
            }

            if (GT.Expression != null)
            {
                targetCommand.AddParameter("GT", GT.Get(context));
            }

            if (CGT.Expression != null)
            {
                targetCommand.AddParameter("CGT", CGT.Get(context));
            }

            if (LT.Expression != null)
            {
                targetCommand.AddParameter("LT", LT.Get(context));
            }

            if (CLT.Expression != null)
            {
                targetCommand.AddParameter("CLT", CLT.Get(context));
            }

            if (GE.Expression != null)
            {
                targetCommand.AddParameter("GE", GE.Get(context));
            }

            if (CGE.Expression != null)
            {
                targetCommand.AddParameter("CGE", CGE.Get(context));
            }

            if (LE.Expression != null)
            {
                targetCommand.AddParameter("LE", LE.Get(context));
            }

            if (CLE.Expression != null)
            {
                targetCommand.AddParameter("CLE", CLE.Get(context));
            }

            if (Like.Expression != null)
            {
                targetCommand.AddParameter("Like", Like.Get(context));
            }

            if (CLike.Expression != null)
            {
                targetCommand.AddParameter("CLike", CLike.Get(context));
            }

            if (NotLike.Expression != null)
            {
                targetCommand.AddParameter("NotLike", NotLike.Get(context));
            }

            if (CNotLike.Expression != null)
            {
                targetCommand.AddParameter("CNotLike", CNotLike.Get(context));
            }

            if (Match.Expression != null)
            {
                targetCommand.AddParameter("Match", Match.Get(context));
            }

            if (CMatch.Expression != null)
            {
                targetCommand.AddParameter("CMatch", CMatch.Get(context));
            }

            if (NotMatch.Expression != null)
            {
                targetCommand.AddParameter("NotMatch", NotMatch.Get(context));
            }

            if (CNotMatch.Expression != null)
            {
                targetCommand.AddParameter("CNotMatch", CNotMatch.Get(context));
            }

            if (Contains.Expression != null)
            {
                targetCommand.AddParameter("Contains", Contains.Get(context));
            }

            if (CContains.Expression != null)
            {
                targetCommand.AddParameter("CContains", CContains.Get(context));
            }

            if (NotContains.Expression != null)
            {
                targetCommand.AddParameter("NotContains", NotContains.Get(context));
            }

            if (CNotContains.Expression != null)
            {
                targetCommand.AddParameter("CNotContains", CNotContains.Get(context));
            }

            if (In.Expression != null)
            {
                targetCommand.AddParameter("In", In.Get(context));
            }

            if (CIn.Expression != null)
            {
                targetCommand.AddParameter("CIn", CIn.Get(context));
            }

            if (NotIn.Expression != null)
            {
                targetCommand.AddParameter("NotIn", NotIn.Get(context));
            }

            if (CNotIn.Expression != null)
            {
                targetCommand.AddParameter("CNotIn", CNotIn.Get(context));
            }

            if (Is.Expression != null)
            {
                targetCommand.AddParameter("Is", Is.Get(context));
            }

            if (IsNot.Expression != null)
            {
                targetCommand.AddParameter("IsNot", IsNot.Get(context));
            }


            return(new ActivityImplementationContext()
            {
                PowerShellInstance = invoker
            });
        }