예제 #1
0
        public ActionResult Del_Comic(int cid)
        {
            ComicManager cm = new ComicManager();

            cm.Del_Comic(cid);
            return(RedirectToAction("Comic_List"));
        }
예제 #2
0
        //CustomerManager _custMgr = null;
        public frmComicDetail(Comic comic, ComicManager comicManager, Customer customer)
        {
            InitializeComponent();

            _comic        = comic;
            _comicManager = comicManager;
            _customer     = customer;
        }
예제 #3
0
        public frmComicDetail(Comic comic, ComicManager comicManager, Employee employee)
        {
            InitializeComponent();

            _comic        = comic;
            _comicManager = comicManager;
            _employee     = employee;
        }
예제 #4
0
        public ActionResult FindBystr_Comic(string shoushuo)
        {
            if (shoushuo.Trim() == "")
            {
                return(PartialView("Comic_List", db.Comic));
            }
            ComicManager cm = new ComicManager();
            var          da = cm.FindByName(shoushuo);

            return(PartialView("Comic_List", da));
        }
예제 #5
0
 //handle bundle selection change
 //add option of comic inside bandle into the comic dropdown
 public void bundleChange()
 {
     comicDropdown.options.Clear();
     if (ComicManager.streamContent(bundleDropdown.captionText.text))
     {
         activeComics = ComicManager.getComics(ComicManager.readStreamBundles(Path.Combine(Application.streamingAssetsPath, bundleDropdown.captionText.text)));
     }
     else
     {
         activeComics = ComicManager.getComics(ComicManager.readStreamBundles(Path.Combine(Application.persistentDataPath, bundleDropdown.captionText.text)));
     }
     addDropdownOptions(comicDropdown, activeComics);
     comicDropdown.value            = 0;
     comicDropdown.captionText.text = comicDropdown.options[0].text;
 }
예제 #6
0
        // GET: Comics/Remove/5
        public ActionResult RemoveFromPull(int?id)
        {
            ComicManager _comicManager = new ComicManager();

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var comic = _comicManager.RetrieveAvailableComics(true).Find(c => c.ComicID == id);

            if (comic == null)
            {
                return(HttpNotFound());
            }
            return(View(comic));
        }
예제 #7
0
        //create comic data by loading comic folder inside a asset bundle
        public Comic(string bundleName, string comicPath)
        {
            this.name   = Path.GetFileName(comicPath);
            this.source = bundleName.ToString();
            AssetBundle comicBundle = ComicManager.readStreamBundles(ComicManager.bundlePath(bundleName));

            foreach (string asetname in comicBundle.GetAllAssetNames())
            {
                if (asetname.Contains(comicPath))
                {
                    this.pages.Add(comicBundle.LoadAsset <Sprite>(asetname));
                    this.pagename.Add(Path.GetFileNameWithoutExtension(asetname));
                }
            }
            comicBundle.Unload(false);
        }
예제 #8
0
        private void btnRemoveFromOrder_Click(object sender, RoutedEventArgs e)
        {
            var _customerID   = _customer.CustomerID;
            var _comicID      = _comic.ComicID;
            var _comicManager = new ComicManager();

            try
            {
                _comicManager.RemoveComicFromOrderForm((int)_comicID, _customerID);
                MessageBox.Show("Comic removed from your order.");
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to remove from your order" + ex.Message + ex.StackTrace);
            }
        }
예제 #9
0
    // Use this for initialization
    void Start()
    {
        ComicManager.readComicsBundleList(Path.Combine(Application.streamingAssetsPath, "streamBundles.json"));

        // try
        // {
        //load story based on static class story manager
        cerita    = new Story(StoryManager.storyType);
        nextScene = StoryManager.nextScene;
        // }
        // catch (System.Exception)
        // {
        //     cerita = new Story(storyJson);
        // }
        currentPhase = -1;
        nextPhase();
    }
예제 #10
0
        private void btnRemoveFromPull_Click(object sender, RoutedEventArgs e)
        {
            var _customerID   = _customer.CustomerID;
            var _comicID      = _comic.ComicID;
            var _comicManager = new ComicManager();
            var mainWindow    = new MainWindow();

            try
            {
                _comicManager.RemoveComicFromPullList(_comicID, _customerID);
                MessageBox.Show("Comic removed from your pull list.");
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to remove from your pull list" + ex.Message + ex.StackTrace);
            }
        }
예제 #11
0
        private void btnAddComicToPull_Click(object sender, RoutedEventArgs e)
        {
            var _customerID   = _customer.CustomerID;
            var _comicID      = _comic.ComicID;
            var _comicManager = new ComicManager();
            var mainWindow    = new MainWindow();

            try
            {
                _comicManager.AddComicToPullList(_customerID, _comicID);
                MessageBox.Show("Comic added to your pull list.");
                //mainWindow.LoadCustomerPullList(_customer);
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("A problem occurred adding comic to pull list" + ex.StackTrace);
            }
        }
예제 #12
0
 // Use this for initialization
 void Start()
 {
     //create/load new/existing story based on static class story manager
     _targetStory = new Story(StoryManager.storyType);
     loadStory();
     // print(Comic.listComicsJson());
     // Comic.writeComicsJson();
     // loadComics();
     resetAddPhaseButton();
     //list and write streaming asset bundle data
     ComicManager.listStreamingComicsBundleJson(Path.Combine(Application.streamingAssetsPath, "streamBundles.json"));
     //read streaming asset bundle data
     ComicManager.readComicsBundleList(Path.Combine(Application.streamingAssetsPath, "streamBundles.json"));
     //add options of bundle in streaming assets
     addDropdownOptions(bundleDropdown, ComicManager.streamBundleList.ToArray());
     //set to load 1st available bundle
     bundleDropdown.value            = 0;
     bundleDropdown.captionText.text = bundleDropdown.options[0].text;
 }
예제 #13
0
        private void btnAddComictoOrder_Click(object sender, RoutedEventArgs e)
        {
            var _customerID   = _customer.CustomerID;
            var _comicID      = _comic.ComicID;
            var _date         = DateTime.Now;
            var _comicManager = new ComicManager();
            var mainWindow    = new MainWindow();

            try
            {
                _comicManager.AddComicToOrderForm(_customerID, (int)_comicID, _date);
                MessageBox.Show("Comic added to your order.");
                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unable to add comic to order" + ex.Message + ex.StackTrace);
            }
        }
예제 #14
0
 /// <summary>
 ///		Inicializa el formulario
 /// </summary>
 public bool LoadComic(string fileName, out string error)
 {           // Inicializa los argumentos de salida
     error = "";
     // Guarda las propiedades
     FileName = fileName;
     // Activa los botones
     cmdNextAction.IsEnabled   = true;
     cmdNextPage.IsEnabled     = true;
     cmdPreviousPage.IsEnabled = true;
     // Carga el cómic
     try
     {
         // Indica que se está cargando el cómic
         _isLoading = true;
         // Crea el manager de cómics
         Manager = new ComicManager(fileName);
         // Carga el archivo de cómics
         Manager.Load();
         // Carga el combo de idiomas
         if (cboLanguages.Items.Count == 0 && Manager.Comic.Languages.Count != 0)
         {
             // Carga el combo de idiomas
             LoadComboLanguages(Manager.Comic.Languages);
             // Asigna el lenguage predeterminado
             DefaultLanguage = GetDefaultLanguage(Manager.Comic.Languages);
         }
         // Asigna las propiedades del cómic al formulario
         Title = Manager.Comic.Title;
         // Indica que se ha terminado de cargar el cómic
         _isLoading = false;
         // Muestra la página actual
         ShowPage();
     }
     catch (Exception exception)
     {
         error = $"Error en la carga del cómic.{Environment.NewLine}{exception.Message}";
         cmdNextAction.IsEnabled   = false;
         cmdNextPage.IsEnabled     = false;
         cmdPreviousPage.IsEnabled = false;
     }
     // Devuelve el valor que indica si la carga ha sido correcta
     return(error.IsEmpty());
 }
예제 #15
0
        // GET: Customer/PullList
        public ActionResult PullList(int?id)
        {
            ComicManager _comicManager = new ComicManager();

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var      pullList = _comicManager.PullListForCustomer(id);
            Customer customer = _customerManager.RetrieveCustomerByID(id);
            string   fName    = customer.FirstName;
            string   lName    = customer.LastName;

            ViewBag.Message = "Pull list for " + fName + " " + lName;

            if (null == pullList)
            {
                ViewBag.Message = "Customer has no pull list!";
            }

            return(View(pullList));
        }
예제 #16
0
        public void btnSearchComicTitle_Click(object sender, RoutedEventArgs e)
        {
            var title    = txtSearchTitle.Text;
            var comicMgr = new ComicManager();

            if (_comics == null)
            {
                try
                {
                    comicsSearched = comicMgr.ComicsByTitle(title);
                    //try
                    //{
                    //    mainWindow.dgComics.ItemsSource = comicsSearched;
                    //}
                    //catch (Exception ex)
                    //{

                    //    MessageBox.Show(ex.Message + ex.StackTrace, "Error adding to datagrid here:");
                    //}

                    MessageBox.Show("Comic found!");
                    Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "ERROR:");
                    txtSearchTitle.IsEnabled = true;
                    txtSearchTitle.Clear();
                }
            }
            else
            {
                txtSearchTitle.IsEnabled = true;
                txtSearchTitle.Clear();
                MessageBox.Show("Please enter a comic title.");
            }
        }
예제 #17
0
        private void btnSearchComicAuthor_Click(object sender, RoutedEventArgs e)
        {
            var authors  = txtSearchAuthor.Text;
            var comicMgr = new ComicManager();

            if (_comics == null)
            {
                try
                {
                    comicsSearched = comicMgr.ComicsByAuthors(authors);
                    //try
                    //{
                    //    mainWindow.dgComics.ItemsSource = comicsSearched;
                    //}
                    //catch (Exception ex)
                    //{

                    //    MessageBox.Show(ex.Message + ex.StackTrace, "Error adding to datagrid here:");
                    //}

                    MessageBox.Show("Comic found!");
                    Close();
                }
                catch (Exception ex)
                {
                    throw new ApplicationException(ex.Message + "Comic not found");
                    txtSearchAuthor.IsEnabled = true;
                    txtSearchAuthor.Clear();
                }
            }
            else
            {
                txtSearchTitle.IsEnabled = true;
                txtSearchTitle.Clear();
                MessageBox.Show("Please enter a comic title.");
            }
        }
예제 #18
0
 void Start()
 {
     ComicManager.readComicsBundleList(Path.Combine(Application.streamingAssetsPath, "streamBundles.json"));
     ayam = new Story(Path.Combine(Application.dataPath, "Data/Story2.json"));
 }
 public frmComicAddEdit(ComicManager comicManager, Comic comic)
 {
     InitializeComponent();
     _comicManager = comicManager;
     _comic        = comic;
 }
 public PullController(ComicManager comicMgr)
 {
     _comicManager = comicMgr;
 }
예제 #21
0
 private void Awake()
 {
     instance = this;
 }