Пример #1
0
        /// <summary>
        /// 同步
        /// </summary>
        /// <param name="condition">条件字符串</param>
        /// <returns></returns>
        public static bool KeySync(string WebID)
        {
            try
            {
                string sql = @"select KeyID, b.ECID, b.ECCode, b.ECName, c.EngunitName
                            from KPI_WebKey a
                            left outer join KPI_ECTag b on a.ECID = b.ECID
                            left outer join KPI_Engunit c on b.EngunitID= c.EngunitID
                            where WebID='{0}'";

                sql = string.Format(sql, WebID);

                DataTable dt = DBAccess.GetRelation().ExecuteDataset(sql).Tables[0];

                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    string keyid = dt.Rows[i]["KeyID"].ToString();

                    KPI_WebKeyEntity keyE = KPI_WebKeyDal.GetEntity(keyid);

                    keyE.ECCode     = dt.Rows[i]["ECCode"].ToString();
                    keyE.ECName     = dt.Rows[i]["ECName"].ToString();
                    keyE.KeyEngunit = dt.Rows[i]["EngunitName"].ToString();

                    keyE.KeyModifyTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");

                    KPI_WebKeyDal.Update(keyE);
                }
            }
            catch
            {
                return(false);
            }
            return(true);
        }
Пример #2
0
        /// <summary>
        /// 修改参数
        /// </summary>
        /// <param name="KeyID">主键</param>
        /// <param name="value">设定值</param>
        /// <returns></returns>
        public static bool Update(string KeyID, string ECName, string KeyIsValid, string KeyNote)
        {
            KPI_WebKeyEntity mEntity = new KPI_WebKeyEntity();

            mEntity.KeyID = KeyID;
            //mEntity.WebName = strName;
            mEntity.ECName     = ECName;
            mEntity.KeyIsValid = int.Parse(KeyIsValid);
            mEntity.KeyNote    = KeyNote;

            //mEntity.WebCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
            mEntity.KeyModifyTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");

            return(KPI_WebKeyDal.Update(mEntity));
        }