Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="remoteIP"></param>
        /// <param name="address"></param>
        /// <param name="ad"></param>
        public void InsertGRAlarmDataToDb(string remoteIP, int address, GRAlarmData ad)
        {
            ArgumentChecker.CheckNotNull(ad);
            int grStId = XGDB.GetGRStationID(remoteIP, address);

            if (grStId != -1)
            {
                InsertGRAlarmDataToDB(grStId, ad);
            }
        }
Пример #2
0
        private void InsertGRRealDataToDb(string remoteIP, int address, GRRealData realData)
        {
            int        grStId  = XGDB.GetGRStationID(remoteIP, address);
            GRRealData GRDatas = realData; //new GRRealData();

//            DBcon con=new DBcon();
            SqlConnection con = new SqlConnection(XGConfig.Default.ConnectionString /*XGDB.DbClient.Connection.ConnectionString*/);

            con.Open();

            SqlCommand cmd = new SqlCommand("AddGRDatas", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add("@p_grstation_id", grStId);

            cmd.Parameters.Add("@p_time", GRDatas.DT);//dtt);//
            cmd.Parameters.Add("@p_oneGiveTemp", GRDatas.OneGiveTemp);
            cmd.Parameters.Add("@p_oneBackTemp", GRDatas.OneBackTemp);
            cmd.Parameters.Add("@p_twoGiveTemp", GRDatas.TwoGiveTemp);
            cmd.Parameters.Add("@p_twoBackTemp", GRDatas.TwoBackTemp);
            cmd.Parameters.Add("@p_outsideTemp", GRDatas.OutSideTemp);
            cmd.Parameters.Add("@p_twoGiveBaseTemp", GRDatas.TwoGiveBaseTemp);
//            cmd.Parameters.Add("@p_oneGivePress",GRDatas.OnwGivePress);
            cmd.Parameters.Add("@p_oneGivePress", GRDatas.OneGivePress);

            cmd.Parameters.Add("@p_oneBackPress", GRDatas.OneBackPress);
            cmd.Parameters.Add("@p_WatBoxLevel", GRDatas.WatBoxLevel);
            cmd.Parameters.Add("@p_twoGivePress", GRDatas.TwoGivePress);
            cmd.Parameters.Add("@p_twoBackPress", GRDatas.TwoBackPress);
            cmd.Parameters.Add("@p_oneInstant", GRDatas.OneInstant);
            cmd.Parameters.Add("@p_twoInstant", GRDatas.TwoInstant);
            cmd.Parameters.Add("@p_oneAccum", GRDatas.OneAccum);
            cmd.Parameters.Add("@p_twoAccum", GRDatas.TwoAccum);
            cmd.Parameters.Add("@p_openDegree", GRDatas.OpenDegree);
            cmd.Parameters.Add("@p_twoPressCha", GRDatas.TwoPressCha);

//            GRPumpState GRState=new GRPumpState();
            GRPumpState GRState = GRDatas.GrPumpState;

            cmd.Parameters.Add("@p_pumpState1", GRState.CyclePump1);
            cmd.Parameters.Add("@p_pumpState2", GRState.CyclePump2);
            cmd.Parameters.Add("@p_pumpState3", GRState.CyclePump3);
            cmd.Parameters.Add("@p_addPumpState1", GRState.RecruitPump1);
            cmd.Parameters.Add("@p_addPumpState2", GRState.RecruitPump2);

            cmd.ExecuteNonQuery();
            cmd.Dispose();
            con.Close();
        }