Beispiel #1
0
        public List <assets> getassets()
        {
            string        sql    = "getassets";
            List <assets> assets = null;

            try
            {
                if (thiconnect != null)
                {
                    SqlCommand cmd = new SqlCommand(sql, thiconnect)
                    {
                        CommandType = CommandType.StoredProcedure, CommandText = sql
                    };
                    assets = SQLHelpers.ExecuteDataFetch <assets>(cmd);

                    return(assets);
                }

                else
                {
                    return(null);
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void simpleButton3_Click(object sender, EventArgs e)
        {
            string    sql    = "getlog";
            DataTable assets = new DataTable();

            gridControl3.DataSource = null;
            try
            {
                if (Connection != null)
                {
                    SqlCommand cmd = new SqlCommand(sql, Connection)
                    {
                        CommandType = CommandType.StoredProcedure
                    };
                    cmd.Parameters.Add(new SqlParameter("@begin_date", begin_date));
                    cmd.Parameters.Add(new SqlParameter("@end_date", end_date));
                    assets = SQLHelpers.ExecuteDataFetch(cmd).Tables[0];
                    gridControl3.DataSource = assets;
                }
            }

            catch (Exception ex)
            {
                writelog("Dashboard Log: " + ex.Message);
            }
        }
        public List <graphassets> getseries(string ids, string begindate, string enddate)
        {
            string             sql    = "getpriceactionforassets";
            List <graphassets> assets = null;

            try
            {
                if (thisConnection != null)
                {
                    SqlCommand cmd = new SqlCommand(sql, thisConnection)
                    {
                        CommandType = CommandType.StoredProcedure
                    };
                    SqlParameter pcustomerName = new SqlParameter("@assetids", SqlDbType.VarChar, 200)
                    {
                        Value = ids
                    };
                    SqlParameter begindates = new SqlParameter("@begindate", SqlDbType.VarChar, 200)
                    {
                        Value = begindate
                    };
                    SqlParameter enddates = new SqlParameter("@enddate", SqlDbType.VarChar, 200)
                    {
                        Value = enddate
                    };
                    cmd.Parameters.Add(pcustomerName);
                    cmd.Parameters.Add(begindates);
                    cmd.Parameters.Add(enddates);
                    assets = SQLHelpers.ExecuteDataFetch <graphassets>(cmd);

                    return(assets);
                }

                else
                {
                    return(null);
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #4
0
        private void loadgrid()
        {
            string sql = "getassetmonitor";
            List <assetmonitor> assets = null;

            gridControl1.DataSource = null;
            try
            {
                if (thiconnect != null)
                {
                    SqlCommand cmd = new SqlCommand(sql, thiconnect)
                    {
                        CommandType = CommandType.StoredProcedure
                    };
                    SqlParameter pcustomerName = new SqlParameter("@assetids", SqlDbType.VarChar, 200)
                    {
                        Value = assetids
                    };
                    SqlParameter begindates = new SqlParameter("@begin_date", SqlDbType.DateTime, 200)
                    {
                        Value = begin_date
                    };
                    SqlParameter enddates = new SqlParameter("@end_date", SqlDbType.DateTime, 200)
                    {
                        Value = end_date
                    };
                    cmd.Parameters.Add(pcustomerName);
                    cmd.Parameters.Add(begindates);
                    cmd.Parameters.Add(enddates);
                    assets = SQLHelpers.ExecuteDataFetch <assetmonitor>(cmd);
                    gridControl1.DataSource = assets;
                }
            }

            catch (Exception ex)
            {
                throw ex;
            }
        }