Christoc.Modules.DnnChat.Edit.lbSubmit_Click C# (CSharp) Метод

lbSubmit_Click() защищенный метод

protected lbSubmit_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void
        protected void lbSubmit_Click(object sender, EventArgs e)
        {
            //save the room
            var rc = new RoomController();
            if (txtRoomId.Text.Any())
            {
                var r = rc.GetRoom(new Guid(txtRoomId.Text), ModuleId);
                r.RoomName = txtRoomName.Text.Trim();
                r.RoomDescription = txtRoomDescription.Text.Trim();
                r.RoomPassword = txtRoomPassword.Text.Trim();
                r.RoomWelcome = txtRoomWelcome.Text.Trim();
                r.Private = chkPrivateRoom.Checked;
                r.Enabled = chkEnabled.Checked;
                r.ShowRoom = chkShowRoom.Checked;
                r.LastUpdatedByUserId = UserId;
                r.LastUpdatedDate = DateTime.UtcNow;

                rc.UpdateRoom(r);

            }
            else
            {
                var r = new Room
                {
                    RoomId = Guid.NewGuid(),
                    RoomName = txtRoomName.Text.Trim(),
                    RoomDescription = txtRoomDescription.Text.Trim(),
                    RoomPassword = txtRoomPassword.Text.Trim(),
                    RoomWelcome = txtRoomWelcome.Text.Trim(),
                    Private = chkPrivateRoom.Checked,
                    Enabled = chkEnabled.Checked,
                    ShowRoom = chkShowRoom.Checked,
                    CreatedByUserId = UserId,
                    CreatedDate =  DateTime.UtcNow,
                    LastUpdatedByUserId = UserId,
                    LastUpdatedDate =  DateTime.UtcNow,
                    ModuleId =  ModuleId

                };
                rc.CreateRoom(r);
            }
            Response.Redirect(DotNetNuke.Common.Globals.NavigateURL());
        }