Esempio n. 1
0
 public Malt()
 {
     InitializeComponent();
     _all          = new List <Classes.MaltType>();
     _filteredList = new List <Classes.MaltType>();
     SelectedMalt  = null;
 }
Esempio n. 2
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="malt">Aktuelt malt som skal endres</param>
 /// <param name="brew_house_efficiency">Angis som et tall mellom 0 og 1</param>
 /// <param name="original_gravity">Angis som et tall mellom 0.099 og 1.170</param>
 /// <param name="batch_volume">Antall liter ønsket sluttvolum</param>
 public ModifyHelper(Classes.MaltType malt, double brew_house_efficiency, double original_gravity, double batch_volume)
 {
     if (null != malt)
     {
         Malt            = new Classes.MaltType(malt);
         BHE             = brew_house_efficiency;
         OriginalGravity = original_gravity;
         BatchVolume     = batch_volume;
     }
 }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            MaltType other = obj as MaltType;

            if (null != other)
            {
                return(this.ToString().Equals(other.ToString()));
            }
            return(false);
        }
Esempio n. 4
0
 public bool GetMalt(string key, out MaltType malt)
 {
     malt = null;
     try
     {
         if (ContainsMalt(key))
         {
             malt = new MaltType(_Malts[key]);
         }
     }
     catch { }
     return(null != malt);
 }
Esempio n. 5
0
        public bool ReplaceMalt(MaltType malt)
        {
            bool ret = false;

            try
            {
                if ((malt != null) && ContainsMalt(malt))
                {
                    _Malts[malt.Malttype.ToLower()] = new MaltType(malt);
                }
            }
            catch { }
            return(ret);
        }
Esempio n. 6
0
        public bool RemoveMalt(MaltType malt)
        {
            bool ret = false;

            try
            {
                if ((malt != null) && ContainsMalt(malt))
                {
                    ret = _Malts.Remove(malt.Malttype.ToLower());
                }
            }
            catch { }
            return(ret);
        }
Esempio n. 7
0
        public bool AddMalt(MaltType malt)
        {
            bool ret = false;

            try
            {
                if ((malt != null) && (_Malts != null) && !_Malts.ContainsKey(malt.Malttype.ToLower()))
                {
                    _Malts.Add(malt.Malttype.ToLower(), new MaltType(malt));
                    ret = _Malts.ContainsKey(malt.Malttype.ToLower());
                }
            }
            catch { ret = false; }
            return(ret);
        }
Esempio n. 8
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            double value;

            if (Classes.Util.ValidDouble(txtPercentageAmount.Text, out value) && listView1.SelectedIndices.Count > 0)
            {
                SelectedMalt = new Classes.MaltType(_filteredList[listView1.SelectedIndices[0]]);
                SelectedMalt.MengdeProsent = value;

                Properties.Settings.Default.Malt_Filter     = txtFilter.Text;
                Properties.Settings.Default.Malt_List       = cboMaltLister.Text;
                Properties.Settings.Default.Malt_Percentage = value;
                Properties.Settings.Default.Save();

                DialogResult = DialogResult.OK;
            }
        }
Esempio n. 9
0
 public MaltType(MaltType other)
     : this()
 {
     if (other != null)
     {
         this.AnbefaltMengde = other.AnbefaltMengde;
         this.Bruksområde    = other.Bruksområde;
         this.Enzymaktivitet = other.Enzymaktivitet;
         this.Fargebidrag    = other.Fargebidrag;
         this.Kategori       = other.Kategori;
         this.Kommentar      = other.Kommentar;
         this.Kornsort       = other.Kornsort;
         this.Malteri        = other.Malteri;
         this.Malttype       = other.Malttype;
         this.MEa            = other.MEa;
         this.MEb            = other.MEb;
         this.Mengde         = other.Mengde;
         this.MengdeProsent  = other.MengdeProsent;
         this.ParsedOk       = other.ParsedOk;
         this.RowDefinition  = other.RowDefinition;
         this.Smaksbidrag    = other.Smaksbidrag;
         this.Type           = other.Type;
     }
 }
Esempio n. 10
0
 public bool ContainsMalt(MaltType malt)
 {
     return((malt != null) && (_Malts != null) && _Malts.ContainsKey(malt.Malttype.ToLower()));
 }