private void create(Channel joinChannel, string username)
 {
     joinChannel.Closed = false;
     db.Channels.InsertOnSubmit(joinChannel);
     db.SubmitChanges();
     join(joinChannel.Name, username, 3);
 }
 public void join(Channel joinChannel, string username)
 {
     if (getChannel(joinChannel.Name) == null)
     {
         create(joinChannel, username);
     }
     else
     {
         join(joinChannel.Name, username, 1);
     }
 }
        public ActionResult Join(FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here
                Channel joinChannel = new Channel();
                String[] wl = { "Name" };
                UpdateModel(joinChannel, wl);
                try
                {
                    chRep.join(joinChannel, User.Identity.Name);
                }
                catch (NotInvitedException e)
                {
                    return View("NotInvited");
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View("Error");
            }
        }
 public ActionResult Join(string id)
 {
     Channel c = new Channel();
     c.Name = id;
     return View(c);
 } 
 partial void DeleteChannel(Channel instance);
 partial void UpdateChannel(Channel instance);
 partial void InsertChannel(Channel instance);