Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Data,During,Personid,Cityid")] Calling calling)
        {
            if (id != calling.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(calling);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CallingExists(calling.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Cityid"]   = new SelectList(_context.City, "Id", "Id", calling.Cityid);
            ViewData["Personid"] = new SelectList(_context.Person, "Id", "Id", calling.Personid);
            return(View(calling));
        }
Example #2
0
    static void Main(string[] args)
    {
        Guest g1 = new Guest(0, 0);

        g1.Create();
        LoggedUser l1 = new LoggedUser(5, 0991111111);

        l1.Create();
        Operator m1 = new Operator(901, 0992111111);

        m1.Create();
        CentalOperator a1 = new CentalOperator(1001, 0993111111);

        a1.Create();
        SuperUser su1 = new SuperUser(1, 1);

        su1.Create();
        Facade facade1 = new Facade(new Add_Sit(), new Calling());

        facade1.Operation1();
        facade1.Operation2();
        Calling cmntr1 = new Calling();
        Add_Sit artcl  = new Add_Sit();

        su1.SetCommand(new ArticleOnCommand(artcl));
        su1.DoSomething();
        su1.UndoSomething();
        su1.SetCommand(new CommentaryOnCommand(cmntr1));
        su1.DoSomething();
        su1.UndoSomething();

        Console.ReadLine();
    }
Example #3
0
 internal virtual void NotifyMethod(IMethodCallMessage methods)
 {
     try {
         Calling?.Invoke(this, new CallingEventArgs(methods));
     } catch {
     }
 }
Example #4
0
 public void RemoveEvent(string tag, Calling caller)
 {
     if (this.m_EventCollection.ContainsKey(tag))
     {
         this.m_EventCollection.Remove(tag);
     }
 }
Example #5
0
        public ActionResult New(CallingViewModel model, int member, int calling, int callingFlag)
        {
            if (!isAuthenticated() || !loggedUser.isAdmin)
            {
                return(new HttpUnauthorizedResult());
            }
            else
            {
                if (ModelState.IsValid)
                {
                    Calling newCalling = new Calling();
                    Result  result     = newCalling.add(calling, member, string.Empty, model.Date, new Common().convertBool(callingFlag));
                    if (result.Success)
                    {
                        return(RedirectToAction("Index"));
                    }
                    else
                    {
                        ModelState.AddModelError("", "Ocorreu um erro ao criar novo chamado");
                    }
                }

                ViewBag.unit = loggedUser.Unit;

                return(View(model));
            }
        }
        public async Task <IActionResult> Edit(int id, [Bind("CallingId,Bishopric,OtherLeader,CallingName")] Calling calling)
        {
            if (id != calling.CallingId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(calling);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CallingExists(calling.CallingId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(calling));
        }
        public void ChangeEditDate(DateTime date)
        {
            List <NameCallingModel> callings = Calling.GetListByDate(date);

            FillCallingDetails(callings);
            CallingsChangedEvent?.Invoke(callings);
        }
        //   public event EventHandler<string> Calling;


        public void Call(string number)
        {
            Calling?.Invoke(number);

            // rozmowa

            //  Ending?.Invoke(number);
        }
Example #9
0
 public void AddNewEvent(string tag, Calling caller)
 {
     if (this.m_EventCollection.ContainsKey(tag))
     {
         return;
     }
     this.m_EventCollection.Add(tag, caller);
 }
Example #10
0
 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 {
     writer.WriteStartObject();
     writer.WritePropertyName("calling");
     writer.WriteStringValue(Calling.ToString());
     writer.WritePropertyName("sms");
     writer.WriteStringValue(Sms.ToString());
     writer.WriteEndObject();
 }
Example #11
0
 public override Expression Call(IEnumerable<Expression> parameters)
 {
     Expression.Calling call = new Calling(this, GetReturnTypes(parameters));
     call.Parameters.AddRange(parameters);
     if (CallTransform != null)
     {
         return CallTransform(call);
     }
     return call;
 }
Example #12
0
 public void Call(int sender, int reciever)
 {
     if (IsRealNumbers(sender, reciever))
     {
         if (Calling != null)
         {
             Calling.Invoke(instSender.CallOut(instReciever));
             Calling.Invoke(instReciever.CallIn(instSender));
         }
     }
 }
 public void OperateCalling(OperationType op, NameCallingModel calling)
 {
     if (op == OperationType.Update)
     {
         Calling.Update(calling);
     }
     else if (op == OperationType.Delete)
     {
         Calling.Del(calling.NameCallingID);
     }
 }
Example #14
0
        public async Task <IActionResult> Create([Bind("Id,CallingName")] Calling calling)
        {
            if (ModelState.IsValid)
            {
                _context.Add(calling);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(calling));
        }
Example #15
0
 public Scope ReturningScope()
 {
     if (Calling.Type() == null)
     {
         return(Calling.ReturningScope());
     }
     else
     {
         return(Type()?.GetObjectScope());
     }
 }
Example #16
0
        public IWorkshopTree Parse(ActionSet actionSet, bool asElement = true)
        {
            IWorkshopTree result = Calling.Parse(actionSet);

            for (int i = 0; i < Index.Length; i++)
            {
                result = Element.Part <V_ValueInArray>(result, Index[i].Parse(actionSet));
            }

            return(result);
        }
        public IWorkshopTree Parse(ActionSet actionSet)
        {
            IWorkshopTree result = Calling.ToWorkshop(actionSet);

            for (int i = 0; i < Index.Length; i++)
            {
                result = ValueInArrayToWorkshop.ValueInArray(result, Index[i].Parse(actionSet));
            }

            return(result);
        }
        public async Task <IActionResult> Create([Bind("CallingId,Bishopric,OtherLeader,CallingName")] Calling calling)
        {
            if (ModelState.IsValid)
            {
                _context.Add(calling);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(calling));
        }
Example #19
0
 public async Task NotifyAsync([Remainder] string Message)
 {
     try
     {
         Calling.Notify($"{Message}\n\n\n\n\n\n", 210);
         await ReplyAsync($"Notification sent Successfully!");
     }
     catch
     {
         await ReplyAsync($"Notification failed to send!");
     }
 }
Example #20
0
        public async Task <IActionResult> Create([Bind("Id,Data,During,Personid,Cityid")] Calling calling)
        {
            if (ModelState.IsValid)
            {
                _context.Add(calling);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Cityid"]   = new SelectList(_context.City, "Id", "Id", calling.Cityid);
            ViewData["Personid"] = new SelectList(_context.Person, "Id", "Id", calling.Personid);
            return(View(calling));
        }
Example #21
0
 public async Task ConnectAsync()
 {
     try
     {
         Calling.version = 505;
         Calling.ps4.Connect();
         Calling.Notify("PS4 Discord RTM Bot POC\nCreated by ItsJokerZz\n\njkPatch injected successfully!\n\n\n", 210);
         await ReplyAsync($"Successfully connected to {Inject.IPAddress}!");
     }
     catch
     {
         await ReplyAsync($"Failed to connect to {Inject.IPAddress}!");
     }
 }
Example #22
0
 public void Call(int db)
 {
     Console.WriteLine("\n猫〔{0}〕以 {1} 分贝叫了一声:", name, db);
     if (Calling != null)
     { //检查是否有事件注册
         Console.WriteLine("有{0}只老鼠与本猫 〔{1}〕有关:",
                           Calling.GetInvocationList().Length, name);
         Calling(this, new SoundDbEventArgs(db)); //调用事件注册的方法
     }
     else
     {
         Console.WriteLine("暂时还没有老鼠在本猫〔{0}〕的领地...", name);
     }
 }
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Calling = await _context.Calling.FirstOrDefaultAsync(m => m.CallingID == id);

            if (Calling == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            OrganizationsList = Enum.GetValues(typeof(Organizations)).Cast <Organizations>().ToList();
            if (id == null)
            {
                return(NotFound());
            }

            Calling = await _context.Calling.FirstOrDefaultAsync(m => m.CallingID == id);

            if (Calling == null)
            {
                return(NotFound());
            }
            return(Page());
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Calling = await _context.Calling.FindAsync(id);

            if (Calling != null)
            {
                _context.Calling.Remove(Calling);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Example #26
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Calling = await _context.Calling
                      .Include(c => c.City)
                      .Include(c => c.Person).FirstOrDefaultAsync(m => m.Id == id);

            if (Calling == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #27
0
        public CodeType Type()
        {
            var type = Calling.Type();

            for (int i = 0; i < Index.Length; i++)
            {
                if (type is ArrayType)
                {
                    type = ((ArrayType)type).ArrayOfType;
                }
                else
                {
                    type = null;
                    break;
                }
            }
            return(type);
        }
    static void Main(string[] args)
    {
        Guest g1 = new Guest(0, 0);

        g1.Create();
        LoggedUser l1 = new LoggedUser(11, 0991111111);

        l1.Create();
        Operator m1 = new Operator(901, 0992111111);

        m1.Create();
        CentralOperator a1 = new CentralOperator(1001, 0993111111);

        a1.Create();

        SuperUser su1 = new SuperUser(1, 1);

        su1.Create();

        Facade facade1 = new Facade(new Add_Sit(), new Calling());

        facade1.Operation1();
        facade1.Operation2();

        Calling cmntr1 = new Calling();
        Add_Sit artcl  = new Add_Sit();

        su1.SetCommand(new ArticleOnCommand(artcl));
        su1.DoSomething();
        su1.UndoSomething();
        su1.SetCommand(new CommentaryOnCommand(cmntr1));
        su1.DoSomething();
        su1.UndoSomething();

        ManagerIntermediator intermediator = new ManagerIntermediator();
        SystemUser           customer      = new CustomerSystemUser(intermediator);
        SystemUser           moder         = new IntermoderatingSystemUser(intermediator);

        intermediator.Customer = customer;
        intermediator.Moder    = moder;
        customer.Send("I want to add a situation to the map");
        moder.Send("We checked it, everything is in order, it is already on the map");
        Console.ReadLine();
    }
Example #29
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            Calling = await _context.Calling
                      .Include(c => c.City)
                      .Include(c => c.Person).FirstOrDefaultAsync(m => m.Id == id);

            if (Calling == null)
            {
                return(NotFound());
            }
            ViewData["Cityid"]   = new SelectList(_context.City, "Id", "Id");
            ViewData["Personid"] = new SelectList(_context.Person, "Id", "Id");
            return(Page());
        }
Example #30
0
        public ActionResult Edit(int id)
        {
            if (!isAuthenticated() || !loggedUser.isAdmin)
            {
                return(new HttpUnauthorizedResult());
            }
            else
            {
                CallingViewModel model = new CallingViewModel();
                Calling          call  = new Calling().get(id, loggedUser.Unit);
                model.CallingId   = call.CallingId;
                model.MemberId    = call.MemberId;
                model.CallingFlag = new Common().convertBool(call.CallingFlag);
                model.Date        = call.Date;
                model.Id          = call.Id;
                model.Other       = call.Other;

                ViewBag.unit = loggedUser.Unit;

                return(View(model));
            }
        }
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            var emptyCalling = new Calling();

            if (await TryUpdateModelAsync <Calling>(
                    emptyCalling,
                    "calling",
                    s => s.CallingID, s => s.Title, s => s.Organization))
            {
                _context.Calling.Add(emptyCalling);
                await _context.SaveChangesAsync();

                return(RedirectToPage("./Index"));
            }



            return(Page());
        }