Example #1
0
        private void SetTemperature(double temperature)
        {
            if (TempLabel.InvokeRequired)
            {
                TempLabel.Invoke(new MethodInvoker(() => { SetTemperature(temperature); }));
            }

            TempLabel.Text = string.Format("{0:000.00}", temperature) + "°C";
        }
Example #2
0
        public static int ADD(TempLabel _templabel)
        {
            SqlParameter idoutparam = DataBase.MakeOutParam("@Id", SqlDbType.Int, 4);

            SqlParameter[] prams = new SqlParameter[] { idoutparam, DataBase.MakeInParam("@Title", SqlDbType.VarChar, 200, _templabel.Title), DataBase.MakeInParam("@Content", SqlDbType.NText, 500, _templabel.Content), DataBase.MakeInParam("@info", SqlDbType.VarChar, 200, _templabel.Info), DataBase.MakeInParam("@TemplateId", SqlDbType.VarChar, 20, _templabel.TemplateId), DataBase.MakeInParam("@sort", SqlDbType.Int, 4, _templabel.Sort), DataBase.MakeInParam("@source", SqlDbType.VarChar, 200, _templabel.Source) };
            if (DataBase.ExecuteNonQuery(CommandType.StoredProcedure, "UP_TempLabel_ADD", prams) == 1)
            {
                _templabel.ID = (int)idoutparam.Value;
                return(_templabel.ID);
            }
            return(0);
        }
Example #3
0
        public override void DrawName()
        {
            if (!Name.Contains("_"))
            {
                base.DrawName();
                return;
            }

            string[] splitName = Name.Split('_');

            for (int s = 0; s < splitName.Count(); s++)
            {
                CreateNPCLabel(splitName[s], s);

                TempLabel.Text     = splitName[s];
                TempLabel.Location = new Point(DisplayRectangle.X + (48 - TempLabel.Size.Width) / 2, DisplayRectangle.Y - (32 - TempLabel.Size.Height / 2) + (Dead ? 35 : 8) - (((splitName.Count() - 1) * 10) / 2) + (s * 12));
                TempLabel.Draw();
            }
        }
Example #4
0
        public static TempLabel Get(int id)
        {
            TempLabel     _templabel = new TempLabel();
            string        slqstr     = "SELECT * FROM [TempLabel] WHERE [ID]=" + id;
            SqlDataReader dr         = DataBase.ExecuteReader(CommandType.Text, slqstr);

            if (dr.Read())
            {
                _templabel.ID         = (int)dr["id"];
                _templabel.Title      = dr["Title"].ToString();
                _templabel.Content    = dr["Content"].ToString();
                _templabel.Info       = dr["Info"].ToString();
                _templabel.TemplateId = dr["TemplateId"].ToString();
                _templabel.Sort       = int.Parse(dr["Sort"].ToString());
                _templabel.Source     = dr["Source"].ToString();
            }
            dr.Close();
            return(_templabel);
        }
        void ReleaseDesignerOutlets()
        {
            if (DayNameLabel != null)
            {
                DayNameLabel.Dispose();
                DayNameLabel = null;
            }

            if (DescriptionLabel != null)
            {
                DescriptionLabel.Dispose();
                DescriptionLabel = null;
            }

            if (HumidityLabel != null)
            {
                HumidityLabel.Dispose();
                HumidityLabel = null;
            }

            if (MainLabel != null)
            {
                MainLabel.Dispose();
                MainLabel = null;
            }

            if (TempLabel != null)
            {
                TempLabel.Dispose();
                TempLabel = null;
            }

            if (WindSpeedLabel != null)
            {
                WindSpeedLabel.Dispose();
                WindSpeedLabel = null;
            }
        }
Example #6
0
 public static bool Update(TempLabel _templabel)
 {
     SqlParameter[] prams = new SqlParameter[] { DataBase.MakeInParam("@id", SqlDbType.Int, 4, _templabel.ID), DataBase.MakeInParam("@Title", SqlDbType.VarChar, 200, _templabel.Title), DataBase.MakeInParam("@Content", SqlDbType.NText, 500, _templabel.Content), DataBase.MakeInParam("@info", SqlDbType.VarChar, 8, _templabel.Info), DataBase.MakeInParam("@TemplateId", SqlDbType.VarChar, 200, _templabel.TemplateId), DataBase.MakeInParam("@sort", SqlDbType.Int, 4, _templabel.Sort), DataBase.MakeInParam("@source", SqlDbType.VarChar, 200, _templabel.Source) };
     return(DataBase.ExecuteNonQuery(CommandType.StoredProcedure, "UP_TempLabel_Update", prams) == 1);
 }
Example #7
0
        void ReleaseDesignerOutlets()
        {
            if (ActivityIndicator != null)
            {
                ActivityIndicator.Dispose();
                ActivityIndicator = null;
            }

            if (BgImageView != null)
            {
                BgImageView.Dispose();
                BgImageView = null;
            }

            if (CityLabel != null)
            {
                CityLabel.Dispose();
                CityLabel = null;
            }

            if (ContentView != null)
            {
                ContentView.Dispose();
                ContentView = null;
            }

            if (ContentView_LayoutCenterY != null)
            {
                ContentView_LayoutCenterY.Dispose();
                ContentView_LayoutCenterY = null;
            }

            if (DayLabel != null)
            {
                DayLabel.Dispose();
                DayLabel = null;
            }

            if (HumidityLabel != null)
            {
                HumidityLabel.Dispose();
                HumidityLabel = null;
            }

            if (MainLabel != null)
            {
                MainLabel.Dispose();
                MainLabel = null;
            }

            if (MonthLabel != null)
            {
                MonthLabel.Dispose();
                MonthLabel = null;
            }

            if (TableView != null)
            {
                TableView.Dispose();
                TableView = null;
            }

            if (TempLabel != null)
            {
                TempLabel.Dispose();
                TempLabel = null;
            }

            if (WindLabel != null)
            {
                WindLabel.Dispose();
                WindLabel = null;
            }
        }