コード例 #1
0
ファイル: ImportForm.cs プロジェクト: jcollums/Carbon-Comic
        private void cboDefaultGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            ArrayList arrayList = new ArrayList();

            if (cboDefaultGroup.Text != "")
            {
                int iD = ComicGroup.GetID(cboDefaultGroup.Text);
                arrayList.Add("group_id=" + iD);
            }
            if (cboDefaultPublisher.Text != "")
            {
                int iD2 = ComicPublisher.GetID(cboDefaultPublisher.Text);
                arrayList.Add("pub_id=" + iD2);
            }
            cboDefaultSeries.Items.Clear();
            cboDefaultSeries.Items.Add("");
            string str = "";

            if (arrayList.Count > 0)
            {
                str = "WHERE " + string.Join(" AND ", CC.StringList(arrayList));
            }
            Query query = CC.SQL.ExecQuery("SELECT name FROM series " + str);

            while (query.NextResult())
            {
                cboDefaultSeries.Items.Add(query.hash["name"]);
            }
        }
コード例 #2
0
 private void cmdOK_Click(object sender, EventArgs e)
 {
     try
     {
         ComicGroup comicGroup = new ComicGroup();
         comicGroup.Name = txtName.Text;
     }
     catch (LogException ex)
     {
         base.DialogResult = DialogResult.None;
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }
コード例 #3
0
        public void Delete(bool Files)
        {
            SQL   sQL   = new SQL();
            Query query = sQL.ExecQuery("SELECT * FROM groups WHERE pub_id=" + ID);

            while (query.NextResult())
            {
                ComicGroup comicGroup = new ComicGroup((int)query.hash["id"]);
                comicGroup.Delete(Files);
            }
            query.Close();
            sQL.ExecQuery("DELETE FROM publishers WHERE id=" + ID);
            if (Settings.Default.OrganizeMethod != 0)
            {
                try
                {
                    Directory.Delete(Path.Combine(Settings.Default.LibraryDir, Name));
                }
                catch
                {
                }
            }
        }
コード例 #4
0
ファイル: ComicIssue.cs プロジェクト: jcollums/Carbon-Comic
		public void AutoTag()
		{
			Regex regex = new Regex("[^0-9]");
			Regex regex2 = new Regex(CC.AutoTag.Pattern);
			Match match = regex2.Match(FileName);
			string value = match.Groups[CC.AutoTag.Matches[0]].Value;
			if (value != "")
			{
				PublisherName = value;
			}
			string value2 = match.Groups[CC.AutoTag.Matches[2]].Value;
			if (value2 != "")
			{
				SeriesName = value2;
			}
			string value3 = match.Groups[CC.AutoTag.Matches[1]].Value;
			if (value3 != "")
			{
				GroupName = value3;
			}
			string value4 = match.Groups[CC.AutoTag.Matches[4]].Value;
			if (value4 != "")
			{
				Name = value4;
			}
			try
			{
				Number = Convert.ToInt16(match.Groups[CC.AutoTag.Matches[5]].Value);
			}
			catch
			{
			}
			try
			{
				string value5 = match.Groups[CC.AutoTag.Matches[3]].Value;
				value5 = regex.Replace(value5, "");
				SeriesVolume = Convert.ToInt16(value5);
			}
			catch
			{
			}
			if ((PublisherName == "") & CC.AutoTag.usePublisher)
			{
				PublisherName = CC.AutoTag.Publisher;
			}
			if ((SeriesName == "") & CC.AutoTag.useSeries)
			{
				SeriesName = CC.AutoTag.Series;
			}
			if ((GroupName == "") & CC.AutoTag.useGroup)
			{
				GroupName = CC.AutoTag.Group;
			}
			if ((Name == "") & CC.AutoTag.usePlot)
			{
				Name = CC.AutoTag.Plot;
			}
			if ((SeriesVolume == 0) & CC.AutoTag.useVolume)
			{
				SeriesVolume = CC.AutoTag.Volume;
			}
			if (SeriesName == "")
			{
				SeriesName = Path.GetFileNameWithoutExtension(FileName);
			}
			if ((SeriesVolume == 0) | (SeriesVolume >= 10))
			{
				SeriesVolume = 1;
			}
			if (Number == 0)
			{
				Type = 2;
			}
			else if (Number.ToString().Length == 4)
			{
				Type = 1;
			}
			else
			{
				Type = 0;
			}
			for (int i = 0; i < Settings.Default.ReplaceKeys.Count; i++)
			{
				SeriesName = SeriesName.Replace(Settings.Default.ReplaceKeys[i], Settings.Default.ReplaceVals[i]);
			}
			PublisherID = ComicPublisher.GetID(PublisherName);
			GroupID = ComicGroup.GetID(GroupName, PublisherID, PublisherName);
			SeriesID = ComicSeries.GetID(SeriesName, GroupID, PublisherID);
		}
コード例 #5
0
ファイル: ComicSeries.cs プロジェクト: jcollums/Carbon-Comic
 public static int GetID(string SeriesName)
 {
     return(GetID(SeriesName, ComicGroup.GetID(Settings.Default.UnknownGroup)));
 }
コード例 #6
0
        public int CompareTo(object o)
        {
            ComicGroup comicGroup = (ComicGroup)o;

            return(Name.CompareTo(comicGroup.Name));
        }