예제 #1
0
        public IActionResult Get(string id, int part)
        {
            byte[]         res  = null;
            string         mime = "audio/wav";
            DateTimeOffset dto  = DateTimeOffset.Now;

            try
            {
                ArticleAction aa = ArticleAction.LoadArticleAction(id);
                if (aa != null)
                {
                    try
                    {
                        string path = aa.GetAttachFilePath(part);
                        res = System.IO.File.ReadAllBytes(path);

                        mime = aa.GetAttachFileType(part);
                    }
                    catch { }
                }
            }
            catch (Exception ex) {
            }

            return(File(res, mime, dto, Microsoft.Net.Http.Headers.EntityTagHeaderValue.Any));
        }
예제 #2
0
    public void GetAllArticles()
    {
        var articleDbAccessMock = new Mock <IArticleDbAccess>();
        var testee = new ArticleAction(articleDbAccessMock.Object, TestMapper.Create());

        testee.GetAllArticles();

        articleDbAccessMock.Verify(x => x.GetArticles(), Times.Once);
    }
예제 #3
0
    public void CreateArticle()
    {
        var newArticleDto       = new NewArticleDto("Cheese", new ExistingArticleGroupDto(3, "Diary"), true);
        var articleDbAccessMock = new Mock <IArticleDbAccess>();
        var testee = new ArticleAction(articleDbAccessMock.Object, TestMapper.Create());

        testee.CreateArticle(newArticleDto);

        articleDbAccessMock.Verify(x => x.AddArticle(It.Is <Article>(a => a.Name == "Cheese")), Times.Once);
    }
예제 #4
0
        public UserValue(ArticleAction aa)
        {
            Id    = "";
            Name  = "";
            Value = 0.0;

            if (aa != null)
            {
                Id    = aa.userId;
                Name  = aa.userName;
                Value = aa.value;
            }
        }
예제 #5
0
    public void DeleteArticle()
    {
        var deleteArticleGroupDto = new DeleteArticleDto(3);
        var articleDbAccessMock   = new Mock <IArticleDbAccess>();

        articleDbAccessMock.Setup(x => x.GetArticle(3)).Returns(new Article {
            Name = "Cheese", ArticleGroup = new ArticleGroup("Diary"), IsInventory = false
        });
        var testee = new ArticleAction(articleDbAccessMock.Object, TestMapper.Create());

        testee.DeleteArticle(deleteArticleGroupDto);

        articleDbAccessMock.Verify(x => x.DeleteArticle(It.Is <Article>(a => a.Name == "Cheese")), Times.Once);
    }
예제 #6
0
        public VideoValue(RacLib.RacMsg msgs, ArticleAction aa)
        {
            Id    = "";
            Title = "";
            Date  = "";
            Role  = "";
            Value = 0.0;

            if (aa != null)
            {
                Id    = aa.article.id;
                Title = aa.article.title;
                Date  = msgs.ShowDate(aa.article.released);

                switch (aa.type)
                {
                case ArticleAction.ActionType.Suggested:
                    Role = msgs.Get(RacLib.RacMsg.Id.Suggested);
                    break;

                case ArticleAction.ActionType.Created:
                    Role = msgs.Get(RacLib.RacMsg.Id.Writer);
                    break;

                case ArticleAction.ActionType.Approved:
                    Role = msgs.Get(RacLib.RacMsg.Id.Approver);
                    break;

                case ArticleAction.ActionType.Revised:
                    Role = msgs.Get(RacLib.RacMsg.Id.Revisor);
                    break;

                case ArticleAction.ActionType.IncludedNaration:
                    Role = msgs.Get(RacLib.RacMsg.Id.Narrator);
                    break;

                case ArticleAction.ActionType.Produced:
                    Role = msgs.Get(RacLib.RacMsg.Id.Producer);
                    break;

                case ArticleAction.ActionType.Published:
                    Role = msgs.Get(RacLib.RacMsg.Id.Publisher);
                    break;
                }

                Value = aa.value;
            }
        }
        public void LogArticleAction(string page, bool succeeded, ArticleAction action, string message)
        {
            ListViewItem item  = new ListViewItem(page);
            item.SubItems.Add(action.ToString());
            item.SubItems.Add(DateTime.Now.ToString());
            item.SubItems.Add(message);

            if (!succeeded)
            {
                lvFailed.Items.Add(item);
                ResizeListView(lvFailed);
            }
            else
            {
                lvSuccessful.Items.Add(item);
                ResizeListView(lvSuccessful);
            }
        }
예제 #8
0
        public void LogArticleAction(string page, bool succeeded, ArticleAction action, string message)
        {
            ListViewItem item = new ListViewItem(page);

            item.SubItems.Add(action.ToString());
            item.SubItems.Add(DateTime.Now.ToString());
            item.SubItems.Add(message);

            if (!succeeded)
            {
                lvFailed.Items.Add(item);
                ResizeListView(lvFailed);
            }
            else
            {
                lvSuccessful.Items.Add(item);
                ResizeListView(lvSuccessful);
            }
        }
예제 #9
0
        public ValuesPerUser(RacLib.RacMsg msgs, ArticleAction aa)
        {
            Id          = "";
            Name        = "";
            Bicoin      = "";
            Month       = "";
            Description = "";
            Values      = new List <VideoValue>();

            if (aa != null)
            {
                Id     = aa.userId;
                Name   = aa.userName;
                Bicoin = aa.profile.bitcoin;
                Month  = msgs.ShowDate(aa.date);

                VideoValue vv = new VideoValue(msgs, aa);
                Values.Add(vv);
            }

            Total = 0;
        }
예제 #10
0
        public ArticleActionDialog(ArticleAction moveDeleteProtect)
        {
            InitializeComponent();
            string[] messages;
            CurrentAction = moveDeleteProtect;

            if (moveDeleteProtect == ArticleAction.Protect)
            {
                lblSummary.Location = new Point(8, 15);
                cmboSummary.Location = new Point(62, 12);
                lblNewTitle.Visible = false;
                txtNewTitle.Visible = false;

                toolTip.SetToolTip(chkCascadingProtection, "Automatically protect any pages transcluded in this page");

                messages = new[]
                               {
                                   "Excessive vandalism",
                                   "High traffic page",
                                   "Excessive spamming",
                                   "Edit warring"
                               };
            }
            else
            {
                MoveDelete.Visibility = false;
                lblExpiry.Visible = false;
                txtExpiry.Visible = false;
                chkCascadingProtection.Visible = false;

                if (moveDeleteProtect == ArticleAction.Move)
                {
                    Size = new Size(Width, 240);
                    chkNoRedirect.Visible = true;
                    chkWatch.Visible = true;
                    chkDealWithAssoc.Visible = true;

                    messages = new[]
                                   {
                                       "Typo in page title",
                                       "Wikipedia naming convention",
                                       "Reverting vandalism page move",
                                       "Facilitating concordance with a category's name"
                                   };
                }
                else // if (moveDeleteProtect == ArticleAction.Delete)
                {
                    Size = new Size(Width, 100);
                    lblSummary.Location = new Point(8, 15);
                    cmboSummary.Location = new Point(62, 12);

                    lblNewTitle.Visible = false;
                    txtNewTitle.Visible = false;

                    messages = new[]
                                   {
                                       "tagged for [[WP:PROD|proposed deletion]] for 7 days",
                                       "[[WP:CSD#G1|G1]]: [[WP:PN|Patent nonsense]], meaningless, or incomprehensible",
                                       "[[WP:CSD#G2|G2]]: Test page",
                                       "[[WP:CSD#G3|G3]]: [[WP:Vandalism|Vandalism]]",
                                       "[[WP:CSD#G3|G3]]: Blatant [[WP:Do not create hoaxes|hoax]]",
                                       "[[WP:CSD#G4|G4]]: Recreation of a page that was [[WP:DEL|deleted]] per a [[WP:XFD|deletion discussion]]",
                                       "[[WP:CSD#G5|G5]]: Creation by a [[WP:BLOCK|blocked]] or [[WP:BAN|banned]] user in violation of block or ban",
                                       "[[WP:CSD#G6|G6]]: Housekeeping and routine (non-controversial) cleanup",
                                       "[[WP:CSD#G7|G7]]: One author who has requested deletion or blanked the page",
                                       "[[WP:CSD#G8|G8]]: Page dependent on a deleted or nonexistent page",
                                       "[[WP:CSD#G10|G10]]: [[WP:ATP|Attack page]] or negative unsourced [[WP:BLP|BLP]]",
                                       "[[WP:CSD#G11|G11]]: Unambiguous [[WP:NOTADVERTISING|advertising]] or promotion",
                                       "[[WP:CSD#G12|G12]]: Unambiguous [[WP:CV|copyright infringement]]",
                                       "[[WP:CSD#G13|G13]]: Abandoned [[WP:AFC|Article for creation]] – to retrieve it, see [[WP:REFUND/G13]]",
                                       "[[WP:CSD#A1|A1]]: Short article without enough context to identify the subject",
                                       "[[WP:CSD#A2|A2]]: Article in a foreign language that exists on another project",
                                       "[[WP:CSD#A3|A3]]: Article that has no meaningful, substantive content",
                                       "[[WP:CSD#A5|A5]]: Article that has been transwikied to another project",
                                       "[[WP:CSD#A7|A7]]: No credible indication of importance (individuals, animals, organizations, web content, events)",
                                       "[[WP:CSD#A9|A9]]: Music recording by redlinked artist and no indication of importance or significance",
                                       "[[WP:CSD#A10|A10]]: Recently created article that duplicates an existing topic",
                                       "[[WP:CSD#A11|A11]]: Made up by article creator or an associate, and no indication of importance/significance",
                                       "[[WP:CSD#R1|Redirect to non-existent page]]",
                                       "[[WP:CSD#R2|Cross namespace redirect from mainspace]]",
                                       "[[WP:CSD#R3|Recently created, implausible redirect]]",
                                       "[[WP:CSD#C1|C1]]: Empty category",
                                       "[[WP:CSD#C2|C2]]: Speedy renaming",
                                       "[[WP:CSD#U1|U1]]: User request to delete page in own userspace",
                                       "[[WP:CSD#U2|U2]]: Userpage or subpage of a nonexistent user",
                                       "[[WP:CSD#U3|U3]]: [[WP:NFC|Non-free]] [[Help:Gallery|gallery]]",
                                       "[[WP:CSD#U5|U5]]: [[WP:NOTWEBHOST|Misuse of Wikipedia as a web host]]",
                                       "[[WP:CSD#T2|T2]]: Template that unambiguously misrepresents established policy",
                                       "[[WP:CSD#T3|T3]]: Unused, redundant template",
                                       "[[WP:CSD#G8|G8]]: Component or documentation of a deleted template"
                                   };

                }
            }
            cmboSummary.Items.AddRange(messages);
        }
        public ArticleActionDialog(ArticleAction moveDeleteProtect)
        {
            InitializeComponent();
            string[] messages;
            CurrentAction = moveDeleteProtect;

            if (moveDeleteProtect == ArticleAction.Protect)
            {
                lblSummary.Location  = new Point(8, 15);
                cmboSummary.Location = new Point(62, 12);
                lblNewTitle.Visible  = false;
                txtNewTitle.Visible  = false;

                toolTip.SetToolTip(chkCascadingProtection, "Automatically protect any pages transcluded in this page");

                messages = new[]
                {
                    "Excessive vandalism",
                    "High traffic page",
                    "Excessive spamming",
                    "Edit warring"
                };
            }
            else
            {
                MoveDelete.Visibility          = false;
                lblExpiry.Visible              = false;
                txtExpiry.Visible              = false;
                chkCascadingProtection.Visible = false;

                if (moveDeleteProtect == ArticleAction.Move)
                {
                    Size = new Size(Width, 240);
                    chkNoRedirect.Visible    = true;
                    chkWatch.Visible         = true;
                    chkDealWithAssoc.Visible = true;

                    messages = new[]
                    {
                        "Typo in page title",
                        "Wikipedia naming convention",
                        "Reverting vandalism page move",
                        "Facilitating concordance with a category's name"
                    };
                }
                else // if (moveDeleteProtect == ArticleAction.Delete)
                {
                    Size = new Size(Width, 100);
                    lblSummary.Location  = new Point(8, 15);
                    cmboSummary.Location = new Point(62, 12);

                    lblNewTitle.Visible = false;
                    txtNewTitle.Visible = false;

                    messages = new[]
                    {
                        "tagged for [[WP:PROD|proposed deletion]] for 7 days",
                        "[[WP:CSD#G1|Patent nonsense]]",
                        "[[WP:CSD#G2|Test page]]",
                        "[[WP:CSD#G3|Pure vandalism]]",
                        "[[WP:CSD#G4|Recreation of deleted material]]",
                        "[[WP:CSD#G5|Banned user]]",
                        "[[WP:CSD#G6|Housekeeping]]",
                        "[[WP:CSD#G7|Author requests deletion]]",
                        "[[WP:CSD#G8|Talk page of page that does not exist]]",
                        "[[WP:CSD#G10|Attack page]]",
                        "[[WP:CSD#G11|Unambiguous advertising or promotion]]",
                        "[[WP:CSD#G12|Unambiguous copyright infringement]]",
                        "[[WP:CSD#G13|Abandonded Article for creation]]",
                        "[[WP:CSD#A1|No context]]",
                        "[[WP:CSD#A2|Foreign language article]]",
                        "[[WP:CSD#A3|No content whatsoever]]",
                        "[[WP:CSD#A5|Transwikied articles]]",
                        "[[WP:CSD#A7|No indication of importance (individuals, animals, organizations, web content)]]",
                        "[[WP:CSD#A9|No indication of importance (musical recordings)]]",
                        "[[WP:CSD#A10|Recently created article that duplicates an existing topic]]",
                        "[[WP:CSD#A11|Obviously invented]]",
                        "[[WP:CSD#R1|Redirect to non-existent page]]",
                        "[[WP:CSD#R2|Redirect to the User: or User talk: space]]",
                        "[[WP:CSD#R3|Redirect as a result of an implausible typo]]",
                        "[[WP:CSD#C1|Empty category]]",
                        "[[WP:CSD#C2|Speedy renaming]]",
                        "[[WP:CSD#U1|User request]]",
                        "[[WP:CSD#U2|Nonexistent user]]",
                        "[[WP:CSD#U3|Non-free galleries]]",
                        "[[WP:CSD#T2|Misrepresentation of policy]]",
                        "[[WP:CSD#T3|Duplication and hardcoded instances]]"
                    };
                }
            }
            cmboSummary.Items.AddRange(messages);
        }
예제 #12
0
 public ArtilcesController()
 {
     _articleAction = new ArticleAction();
 }
        public ArticleActionDialog(ArticleAction moveDeleteProtect)
        {
            InitializeComponent();
            string[] messages;
            CurrentAction = moveDeleteProtect;

            if (moveDeleteProtect == ArticleAction.Protect)
            {
                lblSummary.Location = new Point(8, 15);
                cmboSummary.Location = new Point(62, 12);
                lblNewTitle.Visible = false;
                txtNewTitle.Visible = false;

                toolTip.SetToolTip(chkCascadingProtection, "Automatically protect any pages transcluded in this page");

                messages = new string[1];
                messages[0] = "Heavy vandalism";
            }
            else
            {
                MoveDelete.Visibility = false;
                lblExpiry.Visible = false;
                txtExpiry.Visible = false;
                chkCascadingProtection.Visible = false;

                if (moveDeleteProtect == ArticleAction.Move)
                {
                    Size = new Size(Width, 120);
                    chkNoRedirect.Visible = true;

                    messages = new string[2];
                    messages[0] = "Typo in page title";
                    messages[1] = "Reverting vandalism page move";
                }
                else
                {
                    Size = new Size(Width, 100);
                    lblSummary.Location = new Point(8, 15);
                    cmboSummary.Location = new Point(62, 12);

                    lblNewTitle.Visible = false;
                    txtNewTitle.Visible = false;

                    messages = new string[23];

                    messages[0] = "tagged for [[WP:PROD|proposed deletion]] for 5 days";
                    messages[1] = "[[WP:CSD#G1|Patent nonsense]]";
                    messages[2] = "[[WP:CSD#G2|Test page]]";
                    messages[3] = "[[WP:CSD#G3|Pure vandalism]]";
                    messages[4] = "[[WP:CSD#G4|Recreation of deleted material]]";
                    messages[5] = "[[WP:CSD#G5|Banned user]]";
                    messages[6] = "[[WP:CSD#G6|Housekeeping]]";
                    messages[7] = "[[WP:CSD#G7|Author requests deletion]]";
                    messages[8] = "[[WP:CSD#G8|Talk page of page that does not exist]]";
                    messages[9] = "[[WP:CSD#G10|Attack page]]";
                    messages[10] = "[[WP:CSD#G11|Blatant advertising]]";
                    messages[11] = "[[WP:CSD#G12|Blatant copyright infringement]]";
                    messages[12] = "[[WP:CSD#A1|Little or no context]]";
                    messages[13] = "[[WP:CSD#A2|Foreign language article]]";
                    messages[14] = "[[WP:CSD#A3|No content whatsoever]]";
                    messages[15] = "[[WP:CSD#A7|Non-notable person, group, company, or web content]]";
                    messages[16] = "[[WP:CSD#R1|Redirect to non-existent page]]";
                    messages[17] = "[[WP:CSD#R2|Redirect to the User: or User talk: space]]";
                    messages[18] = "[[WP:CSD#R3|Redirect as a result of an implausible typo]]";
                    messages[19] = "[[WP:CSD#C1|Empty category]]";
                    messages[20] = "[[WP:CSD#C2|Speedy renaming]]";
                    messages[21] = "[[WP:CSD#U1|User request]]";
                    messages[22] = "[[WP:CSD#U2|Nonexistent user]]";
                }
                cmboSummary.Items.AddRange(messages);
            }
        }
예제 #14
0
        public AccountModel(LibVisLib.Profile p, bool isOwn, bool isInternal)
        {
            Id      = p.user.id;
            Email   = p.user.email;
            Name    = p.user.name;
            Profile = (int)p.user.GetProfileForInternalSystem(RacLib.InternalSystem.LibVisId);

            RacLib.RacMsg msgs = RacLib.RacMsg.cache.GetMessage(p.user.defaultLanguage);

            if (isOwn || isInternal)
            {
                Bitcoin = p.bitcoin;
            }
            else
            {
                Bitcoin = "";
            }

            ProfileName = msgs.Get(RacLib.RacMsg.Id.Anonymous);

            if (p.user.GetProfileForInternalSystem(RacLib.InternalSystem.LibVisId) >= RacLib.BaseUser.InternalSystemProfile.Public)
            {
                ProfileName = ProfileName = msgs.Get(RacLib.RacMsg.Id.User);
            }

            if (p.user.GetProfileForInternalSystem(RacLib.InternalSystem.LibVisId) >= RacLib.BaseUser.InternalSystemProfile.InternalStaff)
            {
                ProfileName = ProfileName = msgs.Get(RacLib.RacMsg.Id.Internal);
            }

            if (p.user.GetProfileForInternalSystem(RacLib.InternalSystem.LibVisId) >= RacLib.BaseUser.InternalSystemProfile.Administrator)
            {
                ProfileName = ProfileName = msgs.Get(RacLib.RacMsg.Id.Administrator);
            }

            if (isOwn || isInternal)
            {
                NewsLetter = p.newsLetter;

                p.CheckMedals();

                Xp     = (int)p.xp;
                NextXp = (int)p.nextXp;
                Ap     = (int)p.ap;
                NextAp = (int)p.nextAp;
                Rp     = (int)p.rp;
                NextRp = (int)p.nextRp;
                Op     = (int)p.op;
                NextOp = (int)p.nextOp;
                Qp     = (int)p.qp;
                NextQp = (int)p.nextQp;
                Tp     = (int)p.tp;
                NextTp = (int)p.nextTp;
                Up     = (int)p.up;
                NextUp = (int)p.nextUp;
                Sp     = (int)p.sp;
                NextSp = (int)p.nextSp;
                Ep     = (int)p.ep;
                NextEp = (int)p.nextEp;
            }
            else
            {
                Xp     = 0;
                NextXp = 0;
                Ap     = 0;
                NextAp = 0;
                Rp     = 0;
                NextRp = 0;
                Op     = 0;
                NextOp = 0;
                Qp     = 0;
                NextQp = 0;
                Tp     = 0;
                NextTp = 0;
                Up     = 0;
                NextUp = 0;
                Sp     = 0;
                NextSp = 0;
                Ep     = 0;
                NextEp = 0;
            }

            Medals = new List <MedalsModel>();

            for (int i = 0; i < p.medals.Count; i++)
            {
                MedalsModel m = new MedalsModel(msgs, p.medals[i].medals);
                Medals.Add(m);
            }

            Payments = new List <PaymentModel>();

            if (isOwn || isInternal)
            {
                for (int i = 0; i < p.payments.Count; i++)
                {
                    PaymentModel pa = new PaymentModel(p.payments[i]);
                    Payments.Add(pa);
                }
            }

            Videos = new List <ValuesPerVideoPerUser>();
            Value  = 0;
            if (isOwn || isInternal)
            {
                int year  = DateTime.Now.Year;
                int month = DateTime.Now.Month;

                DateTime start = new DateTime(year, month, 1);
                DateTime end   = new DateTime(year, month, DateTime.DaysInMonth(year, month), 23, 59, 59);

                List <LibVisLib.Article> articles = LibVisLib.Article.ListPublishedArticlesForInterval(Id, start, end);

                double val = 0;

                for (int i = 0; i < articles.Count; i++)
                {
                    Article art = articles[i];

                    ArticleAction a0 = art.GetActionForType(ArticleAction.ActionType.Created);

                    if (a0 != null && a0.userId == Id)
                    {
                        ValuesPerVideoPerUser a = new ValuesPerVideoPerUser(msgs, a0);
                        Videos.Add(a);
                        val += a.Total;
                    }

                    ArticleAction a1 = art.GetActionForType(ArticleAction.ActionType.Revised);

                    if (a1 != null && a1.userId == Id)
                    {
                        ValuesPerVideoPerUser a = new ValuesPerVideoPerUser(msgs, a1);
                        Videos.Add(a);
                        val += a.Total;
                    }

                    ArticleAction a2 = art.GetActionForType(ArticleAction.ActionType.IncludedNaration, art.finalNarratorId);

                    if (a2 != null && a2.userId == Id)
                    {
                        ValuesPerVideoPerUser a = new ValuesPerVideoPerUser(msgs, a2);
                        Videos.Add(a);
                        val += a.Total;
                    }

                    ArticleAction a3 = art.GetActionForType(ArticleAction.ActionType.Produced);

                    if (a3 != null && a3.userId == Id)
                    {
                        ValuesPerVideoPerUser a = new ValuesPerVideoPerUser(msgs, a3);
                        Videos.Add(a);
                        val += a.Total;
                    }
                }

                Value = val;
            }

            TotalQualification    = p.GetTotalQualification(msgs);
            EditorQualification   = p.GetEditorQualification(msgs);
            ReporterQualification = p.GetReporterQualification(msgs);

            if (EditorQualification != "" && ReporterQualification != "")
            {
                GeneralQualification = EditorQualification + ", " + ReporterQualification;
            }
            else
            {
                GeneralQualification = EditorQualification + ReporterQualification;
            }

            if (Profile >= 9)
            {
                GeneralQualification += ((GeneralQualification != "") ? " " : "") + "(Admin)";
                Staff = 1;
                Admin = 1;
            }
            else if (Profile >= 7)
            {
                GeneralQualification += ((GeneralQualification != "") ? " " : "") + "(Staff)";
                Staff = 1;
            }
            else
            {
                Staff = p.staff ? 1 : 0;
            }

            Lang = p.user.defaultLanguageId;

            RoleTranslatorEn = p.translatorEnglish ? 1 : 0;
            RoleTranslatorPt = p.translatorPortuguese ? 1 : 0;
            RoleTranslatorEs = p.translatorSpanish ? 1 : 0;

            RoleRevisorEn = p.revisorEnglish ? 1 : 0;
            RoleRevisorPt = p.revisorPortuguese ? 1 : 0;
            RoleRevisorEs = p.revisorSpanish ? 1 : 0;

            RoleNarratorEn = p.narratorEnglish ? 1 : 0;
            RoleNarratorPt = p.narratorPortuguese ? 1 : 0;
            RoleNarratorEs = p.narratorSpanish ? 1 : 0;

            RoleProducerEn = p.producerEnglish ? 1 : 0;
            RoleProducerPt = p.producerPortuguese ? 1 : 0;
            RoleProducerEs = p.producerSpanish ? 1 : 0;

            Sponsor = p.sponsor ? 1 : 0;

            Blocked      = p.user.isBlocked || p.user.isDisabled ? 1 : 0;
            NotConfirmed = p.user.isConfirmed ? 0 : 1;

            if (p.user.defaultLanguage == RacLib.RacMsg.Language.Portugues)
            {
                Translator = p.translatorPortuguese ? 1 : 0;
                Revisor    = p.revisorPortuguese ? 1 : 0;
                Narrator   = p.narratorPortuguese ? 1 : 0;
                Producer   = p.producerPortuguese ? 1 : 0;
            }
            else if (p.user.defaultLanguage == RacLib.RacMsg.Language.Espanol)
            {
                Translator = p.translatorSpanish ? 1 : 0;
                Revisor    = p.revisorSpanish ? 1 : 0;
                Narrator   = p.narratorSpanish ? 1 : 0;
                Producer   = p.producerSpanish ? 1 : 0;
            }
            else
            {
                Translator = p.translatorEnglish ? 1 : 0;
                Revisor    = p.revisorEnglish ? 1 : 0;
                Narrator   = p.narratorEnglish ? 1 : 0;
                Producer   = p.producerEnglish ? 1 : 0;
            }
        }
예제 #15
0
        public ArticleActionDialog(ArticleAction moveDeleteProtect)
        {
            InitializeComponent();
            string[] messages;
            CurrentAction = moveDeleteProtect;

            if (moveDeleteProtect == ArticleAction.Protect)
            {
                lblSummary.Location  = new Point(8, 15);
                cmboSummary.Location = new Point(62, 12);
                lblNewTitle.Visible  = false;
                txtNewTitle.Visible  = false;

                toolTip.SetToolTip(chkCascadingProtection, "Automatically protect any pages transcluded in this page");

                messages    = new string[1];
                messages[0] = "Heavy vandalism";
            }
            else
            {
                MoveDelete.Visibility          = false;
                lblExpiry.Visible              = false;
                txtExpiry.Visible              = false;
                chkCascadingProtection.Visible = false;

                if (moveDeleteProtect == ArticleAction.Move)
                {
                    Size = new Size(Width, 240);
                    chkNoRedirect.Visible = true;
                    chkWatch.Visible      = true;

                    messages    = new string[2];
                    messages[0] = "Typo in page title";
                    messages[1] = "Reverting vandalism page move";
                }
                else
                {
                    Size = new Size(Width, 100);
                    lblSummary.Location  = new Point(8, 15);
                    cmboSummary.Location = new Point(62, 12);

                    lblNewTitle.Visible = false;
                    txtNewTitle.Visible = false;

                    messages = new string[23];

                    messages[0]  = "tagged for [[WP:PROD|proposed deletion]] for 7 days";
                    messages[1]  = "[[WP:CSD#G1|Patent nonsense]]";
                    messages[2]  = "[[WP:CSD#G2|Test page]]";
                    messages[3]  = "[[WP:CSD#G3|Pure vandalism]]";
                    messages[4]  = "[[WP:CSD#G4|Recreation of deleted material]]";
                    messages[5]  = "[[WP:CSD#G5|Banned user]]";
                    messages[6]  = "[[WP:CSD#G6|Housekeeping]]";
                    messages[7]  = "[[WP:CSD#G7|Author requests deletion]]";
                    messages[8]  = "[[WP:CSD#G8|Talk page of page that does not exist]]";
                    messages[9]  = "[[WP:CSD#G10|Attack page]]";
                    messages[10] = "[[WP:CSD#G11|Blatant advertising]]";
                    messages[11] = "[[WP:CSD#G12|Blatant copyright infringement]]";
                    messages[12] = "[[WP:CSD#A1|Little or no context]]";
                    messages[13] = "[[WP:CSD#A2|Foreign language article]]";
                    messages[14] = "[[WP:CSD#A3|No content whatsoever]]";
                    messages[15] = "[[WP:CSD#A7|Non-notable person, group, company, or web content]]";
                    messages[16] = "[[WP:CSD#R1|Redirect to non-existent page]]";
                    messages[17] = "[[WP:CSD#R2|Redirect to the User: or User talk: space]]";
                    messages[18] = "[[WP:CSD#R3|Redirect as a result of an implausible typo]]";
                    messages[19] = "[[WP:CSD#C1|Empty category]]";
                    messages[20] = "[[WP:CSD#C2|Speedy renaming]]";
                    messages[21] = "[[WP:CSD#U1|User request]]";
                    messages[22] = "[[WP:CSD#U2|Nonexistent user]]";
                }
            }
            cmboSummary.Items.AddRange(messages);
        }
예제 #16
0
        public ArticleActionModel(RacLib.RacMsg msgs, ArticleAction n)
        {
            Id            = n.id;
            UserId        = n.userId;
            UserName      = n.userName;
            Type          = (int)n.type;
            Observation   = n.observation;
            Date          = msgs.ShowDate(n.date);
            BillableWords = n.billableWords;

            Audios = new List <ArticleActionAudioModel>();

            if (n.type == ArticleAction.ActionType.IncludedNaration)
            {
                int na = n.CheckNumberAudioFiles();
                for (int i = 0; i < na; i++)
                {
                    ArticleActionAudioModel aaa = new ArticleActionAudioModel();

                    aaa.FileName  = n.GetAttachFileName(i);
                    aaa.MimeType  = n.GetAttachFileType(i);
                    aaa.Extension = "." + (aaa.FileName.Length > 3 ? aaa.FileName.Substring(aaa.FileName.Length - 3) : aaa.FileName);

                    Audios.Add(aaa);
                }
            }

            switch (n.type)
            {
            case ArticleAction.ActionType.Suggested:
                TypeName = msgs.Get(RacLib.RacMsg.Id.Suggested);
                break;

            case ArticleAction.ActionType.Created:
                TypeName = msgs.Get(RacLib.RacMsg.Id.Created);
                break;

            case ArticleAction.ActionType.Approved:
                TypeName = msgs.Get(RacLib.RacMsg.Id.Approved);
                break;

            case ArticleAction.ActionType.Revised:
                TypeName = msgs.Get(RacLib.RacMsg.Id.Revised);
                break;

            case ArticleAction.ActionType.IncludedNaration:
                TypeName = msgs.Get(RacLib.RacMsg.Id.Narrated);
                break;

            case ArticleAction.ActionType.Produced:
                TypeName = msgs.Get(RacLib.RacMsg.Id.Produced);
                break;

            case ArticleAction.ActionType.Published:
                TypeName = msgs.Get(RacLib.RacMsg.Id.Published);
                break;

            case ArticleAction.ActionType.Removed:
                TypeName = msgs.Get(RacLib.RacMsg.Id.Removed);
                break;
            }

            Grants = new List <ArticleActionGantModel>();

            for (int i = 0; i < n.grants.Count; i++)
            {
                Grants.Add(new ArticleActionGantModel(msgs, n.grants[i]));
            }

            Observations = new List <ArticleActionObservationModel>();

            for (int i = 0; i < n.observations.Count; i++)
            {
                Observations.Add(new ArticleActionObservationModel(msgs, n.observations[i]));
            }
        }
예제 #17
0
 public void DeleteArticle(DeleteArticleDto deleteArticleDto)
 {
     ArticleAction.DeleteArticle(deleteArticleDto);
     Context.SaveChanges();
 }
예제 #18
0
        public ValuesPerVideo(RacLib.RacMsg msgs, LibVisLib.Article art, string userid)
        {
            Id    = art.id;
            Title = art.title;
            Date  = msgs.ShowDate(art.released);
            Month = art.released.Year.ToString("0000") + art.released.Month.ToString("00");

            Total = 0;

            ArticleAction a0 = art.GetActionForType(ArticleAction.ActionType.Created);

            Author = new UserValue();
            if (a0 != null && (userid == "" || a0.userId == userid))
            {
                Author = new UserValue(a0);
                Total += Author.Value;
            }
            else
            {
                double val = ArticleAction.CalcRevenue(art, ArticleAction.ActionType.Created, art.wordCount, art.wordCount);
                Author = new UserValue(art, Profile.Administrator, val);
                Total += val;
            }

            ArticleAction a1 = art.GetActionForType(ArticleAction.ActionType.Revised);

            Revisor = new UserValue();
            if (a1 != null && (userid == "" || a1.userId == userid))
            {
                Revisor = new UserValue(a1);
                Total  += Revisor.Value;
            }
            else
            {
                double val = ArticleAction.CalcRevenue(art, ArticleAction.ActionType.Revised, art.wordCount, art.wordCount);
                Revisor = new UserValue(art, Profile.Administrator, val);
                Total  += val;
            }

            ArticleAction a2 = art.GetActionForType(ArticleAction.ActionType.IncludedNaration, art.finalNarratorId);

            Narrator = new UserValue();
            if (a2 != null && (userid == "" || a2.userId == userid))
            {
                Narrator = new UserValue(a2);
                Total   += Narrator.Value;
            }
            else
            {
                double val = ArticleAction.CalcRevenue(art, ArticleAction.ActionType.IncludedNaration, art.wordCount, art.wordCount);
                Narrator = new UserValue(art, Profile.Administrator, val);
                Total   += val;
            }

            ArticleAction a3 = art.GetActionForType(ArticleAction.ActionType.Produced);

            Producer = new UserValue();
            if (a3 != null && (userid == "" || a3.userId == userid))
            {
                Producer = new UserValue(a3);
                Total   += Producer.Value;
            }
            else
            {
                double val = ArticleAction.CalcRevenue(art, ArticleAction.ActionType.Produced, art.wordCount, art.wordCount);
                Producer = new UserValue(art, Profile.Administrator, val);
                Total   += val;
            }
        }
예제 #19
0
 /// <inheritdoc />
 public IEnumerable <ExistingArticleDto> GetAllArticles()
 {
     return(ArticleAction.GetAllArticles().OrderBy(x => x.Name));
 }
예제 #20
0
        public ArticleActionDialog(ArticleAction moveDeleteProtect)
        {
            InitializeComponent();
            string[] messages;
            CurrentAction = moveDeleteProtect;

            if (moveDeleteProtect == ArticleAction.Protect)
            {
                lblSummary.Location  = new Point(8, 15);
                cmboSummary.Location = new Point(62, 12);
                lblNewTitle.Visible  = false;
                txtNewTitle.Visible  = false;

                toolTip.SetToolTip(chkCascadingProtection, "Automatically protect any pages transcluded in this page");

                messages = new[]
                {
                    "Excessive vandalism",
                    "High traffic page",
                    "Excessive spamming",
                    "Edit warring"
                };
            }
            else
            {
                MoveDelete.Visibility          = false;
                lblExpiry.Visible              = false;
                txtExpiry.Visible              = false;
                chkCascadingProtection.Visible = false;

                if (moveDeleteProtect == ArticleAction.Move)
                {
                    Size = new Size(Width, 240);
                    chkNoRedirect.Visible    = true;
                    chkWatch.Visible         = true;
                    chkDealWithAssoc.Visible = true;

                    messages = new[]
                    {
                        "Typo in page title",
                        "Wikipedia naming convention",
                        "Reverting vandalism page move",
                        "Facilitating concordance with a category's name"
                    };
                }
                else // if (moveDeleteProtect == ArticleAction.Delete)
                {
                    Size = new Size(Width, 100);
                    lblSummary.Location  = new Point(8, 15);
                    cmboSummary.Location = new Point(62, 12);

                    lblNewTitle.Visible = false;
                    txtNewTitle.Visible = false;

                    messages = new[]
                    {
                        "tagged for [[WP:PROD|proposed deletion]] for 7 days",
                        "[[WP:CSD#G1|G1]]: [[WP:PN|Patent nonsense]], meaningless, or incomprehensible",
                        "[[WP:CSD#G2|G2]]: Test page",
                        "[[WP:CSD#G3|G3]]: [[WP:Vandalism|Vandalism]]",
                        "[[WP:CSD#G3|G3]]: Blatant [[WP:Do not create hoaxes|hoax]]",
                        "[[WP:CSD#G4|G4]]: Recreation of a page that was [[WP:DEL|deleted]] per a [[WP:XFD|deletion discussion]]",
                        "[[WP:CSD#G5|G5]]: Creation by a [[WP:BLOCK|blocked]] or [[WP:BAN|banned]] user in violation of block or ban",
                        "[[WP:CSD#G6|G6]]: Housekeeping and routine (non-controversial) cleanup",
                        "[[WP:CSD#G7|G7]]: One author who has requested deletion or blanked the page",
                        "[[WP:CSD#G8|G8]]: Page dependent on a deleted or nonexistent page",
                        "[[WP:CSD#G10|G10]]: [[WP:ATP|Attack page]] or negative unsourced [[WP:BLP|BLP]]",
                        "[[WP:CSD#G11|G11]]: Unambiguous [[WP:NOTADVERTISING|advertising]] or promotion",
                        "[[WP:CSD#G12|G12]]: Unambiguous [[WP:CV|copyright infringement]]",
                        "[[WP:CSD#G13|G13]]: Abandoned [[WP:AFC|Article for creation]] – to retrieve it, see [[WP:REFUND/G13]]",
                        "[[WP:CSD#A1|A1]]: Short article without enough context to identify the subject",
                        "[[WP:CSD#A2|A2]]: Article in a foreign language that exists on another project",
                        "[[WP:CSD#A3|A3]]: Article that has no meaningful, substantive content",
                        "[[WP:CSD#A5|A5]]: Article that has been transwikied to another project",
                        "[[WP:CSD#A7|A7]]: No credible indication of importance (individuals, animals, organizations, web content, events)",
                        "[[WP:CSD#A9|A9]]: Music recording by redlinked artist and no indication of importance or significance",
                        "[[WP:CSD#A10|A10]]: Recently created article that duplicates an existing topic",
                        "[[WP:CSD#A11|A11]]: Made up by article creator or an associate, and no indication of importance/significance",
                        "[[WP:CSD#R1|Redirect to non-existent page]]",
                        "[[WP:CSD#R2|Cross namespace redirect from mainspace]]",
                        "[[WP:CSD#R3|Recently created, implausible redirect]]",
                        "[[WP:CSD#C1|C1]]: Empty category",
                        "[[WP:CSD#C2|C2]]: Speedy renaming",
                        "[[WP:CSD#U1|U1]]: User request to delete page in own userspace",
                        "[[WP:CSD#U2|U2]]: Userpage or subpage of a nonexistent user",
                        "[[WP:CSD#U3|U3]]: [[WP:NFC|Non-free]] [[Help:Gallery|gallery]]",
                        "[[WP:CSD#U5|U5]]: [[WP:NOTWEBHOST|Misuse of Wikipedia as a web host]]",
                        "[[WP:CSD#T2|T2]]: Template that unambiguously misrepresents established policy",
                        "[[WP:CSD#T3|T3]]: Unused, redundant template",
                        "[[WP:CSD#G8|G8]]: Component or documentation of a deleted template"
                    };
                }
            }
            cmboSummary.Items.AddRange(messages);
        }
예제 #21
0
        public ArticleActionDialog(ArticleAction moveDeleteProtect)
        {
            InitializeComponent();
            string[] messages;
            CurrentAction = moveDeleteProtect;

            if (moveDeleteProtect == ArticleAction.Protect)
            {
                lblSummary.Location = new Point(8, 15);
                cmboSummary.Location = new Point(62, 12);
                lblNewTitle.Visible = false;
                txtNewTitle.Visible = false;

                toolTip.SetToolTip(chkCascadingProtection, "Automatically protect any pages transcluded in this page");

                messages = new[]
                               {
                                   "Excessive vandalism",
                                   "High traffic page",
                                   "Excessive spamming",
                                   "Edit warring"
                               };
            }
            else
            {
                MoveDelete.Visibility = false;
                lblExpiry.Visible = false;
                txtExpiry.Visible = false;
                chkCascadingProtection.Visible = false;

                if (moveDeleteProtect == ArticleAction.Move)
                {
                    Size = new Size(Width, 240);
                    chkNoRedirect.Visible = true;
                    chkWatch.Visible = true;
                    chkDealWithAssoc.Visible = true;

                    messages = new[]
                                   {
                                       "Typo in page title",
                                       "Wikipedia naming convention",
                                       "Reverting vandalism page move",
                                       "Facilitating concordance with a category's name"
                                   };
                }
                else // if (moveDeleteProtect == ArticleAction.Delete)
                {
                    Size = new Size(Width, 100);
                    lblSummary.Location = new Point(8, 15);
                    cmboSummary.Location = new Point(62, 12);

                    lblNewTitle.Visible = false;
                    txtNewTitle.Visible = false;

                    messages = new[]
                                   {
                                       "tagged for [[WP:PROD|proposed deletion]] for 7 days",
                                       "[[WP:CSD#G1|Patent nonsense]]",
                                       "[[WP:CSD#G2|Test page]]",
                                       "[[WP:CSD#G3|Pure vandalism]]",
                                       "[[WP:CSD#G4|Recreation of deleted material]]",
                                       "[[WP:CSD#G5|Banned user]]",
                                       "[[WP:CSD#G6|Housekeeping]]",
                                       "[[WP:CSD#G7|Author requests deletion]]",
                                       "[[WP:CSD#G8|Talk page of page that does not exist]]",
                                       "[[WP:CSD#G10|Attack page]]",
                                       "[[WP:CSD#G11|Unambiguous advertising or promotion]]",
                                       "[[WP:CSD#G12|Unambiguous copyright infringement]]",
                                       "[[WP:CSD#G13|Abandonded Article for creation]]",
                                       "[[WP:CSD#A1|No context]]",
                                       "[[WP:CSD#A2|Foreign language article]]",
                                       "[[WP:CSD#A3|No content whatsoever]]",
                                       "[[WP:CSD#A5|Transwikied articles]]",
                                       "[[WP:CSD#A7|No indication of importance (individuals, animals, organizations, web content)]]",
                                       "[[WP:CSD#A9|No indication of importance (musical recordings)]]",
                                       "[[WP:CSD#A10|Recently created article that duplicates an existing topic]]",
                                       "[[WP:CSD#A11|Obviously invented]]",
                                       "[[WP:CSD#R1|Redirect to non-existent page]]",
                                       "[[WP:CSD#R2|Redirect to the User: or User talk: space]]",
                                       "[[WP:CSD#R3|Redirect as a result of an implausible typo]]",
                                       "[[WP:CSD#C1|Empty category]]",
                                       "[[WP:CSD#C2|Speedy renaming]]",
                                       "[[WP:CSD#U1|User request]]",
                                       "[[WP:CSD#U2|Nonexistent user]]",
                                       "[[WP:CSD#U3|Non-free galleries]]",
                                       "[[WP:CSD#T2|Misrepresentation of policy]]",
                                       "[[WP:CSD#T3|Duplication and hardcoded instances]]"
                                   };

                }
            }
            cmboSummary.Items.AddRange(messages);
        }