Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            iBattery = (IBattery)ServiceAgent.getInstance().GetMaintainObjectByName<IBattery>(WebConstant.MaintainBatteryObject);

            if (!this.IsPostBack)
            {
                pmtMessage1 = this.GetLocalResourceObject(Pre + "_pmtMessage1").ToString();
                pmtMessage2 = this.GetLocalResourceObject(Pre + "_pmtMessage2").ToString();
                pmtMessage3 = this.GetLocalResourceObject(Pre + "_pmtMessage3").ToString();
                pmtMessage4 = this.GetLocalResourceObject(Pre + "_pmtMessage4").ToString();
                pmtMessage5 = this.GetLocalResourceObject(Pre + "_pmtMessage5").ToString();
                pmtMessage6 = this.GetLocalResourceObject(Pre + "_pmtMessage6").ToString();

                userName = Master.userInfo.UserId; //UserInfo.UserName;
                initLabel();
                IList<BatteryDef> dataList;
                dataList = iBattery.GetAllBatteryInfoList();
                bindTable(dataList, DEFAULT_ROWS);
            }
         
        }
        catch (FisException ex)
        {
            showErrorMessage(ex.mErrmsg);
        }
        catch (Exception ex)
        {
            showErrorMessage(ex.Message);
        }
    }
Ejemplo n.º 2
0
 public AbstractComputer(ComputerType type, CPU cpu, RAM ram, IEnumerable<HardDrive> hardDrives, VideoCard videoCard, IBattery battery, IMotherboard motherBoard)
 {
     this.MachineType = type;
     this.Cpu = cpu;
     this.Ram = ram;
     this.HardDrives = hardDrives;
     //// TODO: BUG was here
     ////if (type != ComputerType.LAPTOP && type != ComputerType.PC)
     ////{
     ////    VideoCard.IsMonochrome = true;
     ////}
     this.VideoCard = videoCard;
     this.Battery = battery;
     this.Motherboard = motherBoard;
 }
Ejemplo n.º 3
0
 public MobilePhone(IBattery battery, MobilePhoneManufacture manufacture)
 {
     Battery     = battery;
     Manufacture = manufacture;
 }
Ejemplo n.º 4
0
 public override void gm_remove(IBattery b)
 {
     elems.Remove(b);
 }
Ejemplo n.º 5
0
 public StoreBatteryData(IBattery battery, ICrudProvider db)
 {
     this.battery = battery;
     this.db = db;
 }
Ejemplo n.º 6
0
 public Laptop(ICPU cpu, IRAM ram, IVideoCard videoCard, RAID hardDriveRaid, IMotherboard motherBoard, IBattery battery)
     : base(cpu, ram, videoCard, hardDriveRaid, motherBoard)
 {
     this.battery = battery;
 }
Ejemplo n.º 7
0
 //[1] 생성자의 매개 변수로 인터페이스 형식 지정
 public Car(IBattery battery)
 {
     _battery = battery; // 넘어온 개체가 _battery 필드에 저장
 }
Ejemplo n.º 8
0
 public TrafficThreeLight(IBattery battery)
 {
     _battery = battery;
     _status  = _battery.GetPowerState() == Power.On ? true : false;
 }
Ejemplo n.º 9
0
 public static float CurrentBatteryUnits(this IBattery b)
 {
     return(b.EnergyContainer.CurrentAmount / ElectricityConstants.WattHoursPerBatteryBlock);
 }
Ejemplo n.º 10
0
 public static int BatteryUnitCapacity(this IBattery b)
 {
     return(Math.Max(1, Mathf.RoundToInt(b.EnergyContainer.AvailableCapacity / ElectricityConstants.WattHoursPerBatteryBlock)));
 }
Ejemplo n.º 11
0
 public Laptop(IRam ram, ICpu cpu, IEnumerable <IHardDrive> drives, IVideoCard videoCard, IBattery battery)
     : base(ram, cpu, drives, videoCard)
 {
     this.Battery = battery;
 }
Ejemplo n.º 12
0
 public MobilePhone(string model, string manufacturer, decimal price, string owner, IBattery battery, IDisplay display)
     : this(model, manufacturer)
 {
     this.price   = price;
     this.owner   = owner;
     this.battery = battery;
     this.display = display;
 }
Ejemplo n.º 13
0
 public OptionLaunchRockets(IBattery battery, ISystem consoleSystem)
 {
     _battery       = battery;
     _consoleSystem = consoleSystem;
 }
Ejemplo n.º 14
0
        public IComputer CreateComputer(ICPU cpu, IRam ram, IHardDrive hardDrives, IVideoCard videoCard, IBattery battery)
        {
            IComputer laptop = new Laptop(cpu, ram, hardDrives, videoCard, battery);

            return(laptop);
        }
Ejemplo n.º 15
0
 public StoreBatteryData(IBattery battery, ICrudProvider db)
 {
     this.battery = battery;
     this.db      = db;
 }
Ejemplo n.º 16
0
 public IPhone(IColor color, IBattery battery, IQuickCharge quickcharge)
 {
     _color       = color;
     _battery     = battery;
     _quickcharge = quickcharge;
 }
Ejemplo n.º 17
0
 public BatteryProxy(IBattery master)
 {
     this.master = master;
 }
Ejemplo n.º 18
0
 public Laptop(ICpu cpu, IRam ram, IEnumerable <IHardDrive> hardDrives, IVideoCard videoCard, IBattery battery)
     : base(cpu, ram, hardDrives, videoCard)
 {
     this.battery = battery;
 }
 public abstract PortableDeviceBuilder Battery(IBattery battery);
Ejemplo n.º 20
0
        public void SetBattery(IBattery battery)
        {
            string batteryName = battery.GetName();

            Console.WriteLine(batteryName + "安装到BenChi车架");
        }
Ejemplo n.º 21
0
 public Radio(IBattery radioBattery, ITuner radioTuner, string radioName)
 {
     Battery = radioBattery;
     Tuner   = radioTuner;
     Name    = radioName;
 }
Ejemplo n.º 22
0
 public Laptop(ICpu cpu, IRamMemory ram, IVideoCard videoCard, IEnumerable<IHardDrive> hardDrives, IBattery battery)
     : base(cpu, ram, videoCard, hardDrives)
 {
     this.Battery = battery;
 }
Ejemplo n.º 23
0
 public LaptopMotherBoard(IRamMemory ram, ICpu cpu, IHardDrive hardDrive, IVideoCard videoCard, IBattery battery)
     : base(ram, cpu, hardDrive, videoCard)
 {
     this.Battery = battery;
 }
Ejemplo n.º 24
0
 public void UseBattery(IBattery battery)
 {
     battery.Discharge();
 }
Ejemplo n.º 25
0
 public Laptop(AbstractComputer.ComputerType type, CPU cpu, RAM ram, IEnumerable<HardDrive> hardDrives, VideoCard videoCard, IBattery battery, IMotherboard motherBoard)
     : base(type, cpu, ram, hardDrives, videoCard, battery, motherBoard)
 {
 }
Ejemplo n.º 26
0
        public static bool BatteryCheck(Pickupable pickupable)
        {
            EnergyMixin energyMixin = pickupable.gameObject.GetComponentInChildren <EnergyMixin>();

            if (energyMixin != null)
            {
                GameObject gameObject   = energyMixin.GetBattery();
                bool       defaultCheck = false;
                if (gameObject != null)
                {
                    defaultCheck = energyMixin.defaultBattery == CraftData.GetTechType(gameObject);
                }

                if (gameObject == null && QModServices.Main.ModPresent("NoBattery"))
                {
                    return(true);
                }
                if (gameObject != null && (defaultCheck || QModServices.Main.ModPresent("NoBattery")))
                {
                    IBattery battery = gameObject.GetComponent <IBattery>();
#if SUBNAUTICA
                    TechData techData = CraftDataHandler.GetTechData(pickupable.GetTechType());
#elif BELOWZERO
                    RecipeData techData = CraftDataHandler.GetRecipeData(pickupable.GetTechType());
#endif
                    bool recipeCheck = techData.Ingredients.FindAll((ingredient) => ingredient.techType == TechType.Battery || ingredient.techType == TechType.PrecursorIonBattery || ingredient.techType == TechType.LithiumIonBattery || ingredient.techType == TechType.PowerCell || ingredient.techType == TechType.PrecursorIonPowerCell).Count == 0;
                    if (battery != null && QModServices.Main.ModPresent("NoBattery") && recipeCheck)
                    {
                        ErrorMessage.AddMessage($"{pickupable.GetTechType().ToString()} has a battery in it. Cannot Recycle.");
                        return(false);
                    }
                    else if (battery != null && defaultCheck && battery.charge > (battery.capacity * 0.99))
                    {
                        return(true);
                    }
                    else
                    {
                        if (gameObject != null && !defaultCheck)
                        {
                            ErrorMessage.AddMessage($"{CraftData.GetTechType(gameObject).ToString()} is not the default battery for {pickupable.GetTechType().ToString()}.");
                        }
                        else
                        {
                            ErrorMessage.AddMessage($"{pickupable.GetTechType().ToString()} is not fully charged and cannot be recycled.");
                        }

                        return(false);
                    }
                }
                else
                {
                    if (gameObject != null)
                    {
                        ErrorMessage.AddMessage($"{CraftData.GetTechType(gameObject).ToString()} is not the default battery for {pickupable.GetTechType().ToString()}.");
                    }
                    else
                    {
                        ErrorMessage.AddMessage($"{pickupable.GetTechType().ToString()} has no battery.");
                    }

                    return(false);
                }
            }

            IBattery b2 = pickupable.GetComponent <IBattery>();
            if (b2 != null)
            {
                if (b2.charge > (b2.capacity * 0.99))
                {
                    return(true);
                }
                else
                {
                    ErrorMessage.AddMessage($"{pickupable.GetTechType().ToString()} is not fully charged and cannot be recycled.");
                    return(false);
                }
            }
            return(true);
        }
Ejemplo n.º 27
0
 public Laptop(IRam ram, ICpu cpu, IEnumerable<IHardDrive> drives, IVideoCard videoCard, IBattery battery)
     : base(ram, cpu, drives, videoCard)
 {
     this.Battery = battery;
 }
Ejemplo n.º 28
0
 public override void gm_add(IBattery b)
 {
     elems.Add(b);
 }