Пример #1
0
        public ActionResult PayMent(Guid clientId, Guid id, string payment)
        {
            ServerPayment p = new ServerPayment();

            p.ServerId = id;
            p.Payment  = decimal.Parse(payment);//
            db.ServerPayments.Add(p);
            int r = db.SaveChanges();

            if (r > 0)
            {
                return(Redirect(Url.Action("ClientInfo", "Home", new { id = clientId })));
            }
            return(Content("Some wrong here..."));
        }
Пример #2
0
        public ActionResult AddServer(ServerModel sm, Guid id)
        {
            Server newserver = new Server();

            newserver.Name        = sm.Name;
            newserver.description = sm.description;
            newserver.Price       = sm.Price;
            newserver.DueTime     = sm.DueTime;
            newserver.ClientId    = id;
            db.Servers.Add(newserver);
            int r = db.SaveChanges();

            if (r > 0)
            {
                ServerPayment p = new ServerPayment();
                p.Payment  = sm.PayMent;
                p.ServerId = newserver.Id;
                db.ServerPayments.Add(p);

                db.SaveChanges();
                return(Redirect(Url.Action("ClientInfo", "Home", new { id = id })));
            }
            return(Content("Some wrong here..."));
        }