예제 #1
0
        public ActionResult ChargeCartridge()
        {
            PrinterToner printerToner    = new PrinterToner(_db);
            string       strSerialNumber = Request.QueryString["SerialNumber"].ToString();
            IEnumerable <ChargeCartridge> chargeCartridge = (from c in _db.t_ChargeCartridges
                                                             where c.SerialNumber == strSerialNumber
                                                             orderby c.ChargeDate
                                                             select new ChargeCartridge
            {
                OldRemainToner = c.OldRemainToner,
                NewRemainToner = c.NewRemainToner,
                PageCount = c.PageCount,
                ColorToner = c.ColorToner,
                ChargeDate = c.ChargeDate
            }).ToList();

            return(PartialView(chargeCartridge));
        }
예제 #2
0
        private void GetPrinterToner(Dictionary <Oid, AsnType> Inks, int numToner)
        {
            for (int i = 0; i < numToner; i++)
            {
                PrinterToner toner = new PrinterToner();

                //1.3.6.1.2.1.43.11.1.1.6.1.
                string MarkerSuppliesDescription = "1.3.6.1.2.1.43.11.1.1.6.1." + (i + 1).ToString();
                toner.MarkerSuppliesDescription = Inks[new Oid(MarkerSuppliesDescription)].ToString();

                //.1.3.6.1.2.1.43.11.1.1.9.1.1
                string MarkerSuppliesLevel = "1.3.6.1.2.1.43.11.1.1.9.1." + (i + 1).ToString();
                toner.MarkerSuppliesLevel = Inks[new Oid(MarkerSuppliesLevel)].ToString();

                //1.3.6.1.2.1.43.11.1.1.8.1.
                string MarkerSuppliesMaxCapacity = "1.3.6.1.2.1.43.11.1.1.8.1." + (i + 1).ToString();
                toner.MarkerSuppliesMaxCapacity = Inks[new Oid(MarkerSuppliesMaxCapacity)].ToString();

                toner.Precent = (int)(double.Parse(toner.MarkerSuppliesLevel) / double.Parse(toner.MarkerSuppliesMaxCapacity) * 100);
                Printertoners.Add(toner);
            }
        }
예제 #3
0
        public ActionResult Index()
        {
            PrinterToner printerToner = new PrinterToner(_db);

            return(View(printerToner.StateToner()));
        }