예제 #1
0
        /// <summary>
        /// 判断名称的唯一性
        /// </summary>
        /// <param name="GroupName"></param>
        /// <param name="GroupID"></param>
        /// <returns></returns>
        public static bool CodeExist(string Code, string ID)
        {
            //insert时, ID == ""
            //update时, ID == 必须为 原来的ID
            //Excel find  时, 对应表单操作 ID == ""

            bool bExist = false;

            bExist = KPI_RealTagDal.CodeExist(Code, ID) ||
                     KPI_InputTagDal.CodeExist(Code, ID) ||
                     CurveTagDal.CodeExist(Code, ID) ||
                     ECTagDal.CodeExist(Code, ID) ||
                     KPI_SATagDal.CodeExist(Code, ID);


            return(bExist);
        }
예제 #2
0
        /// <summary>
        /// 拷贝实体数据
        /// </summary>
        /// <returns></returns>
        public static bool CopySATag(string SAID)
        {
            KPI_SATagEntity et = KPI_SATagDal.GetEntity(SAID);

            //NewID
            string newid = Guid.NewGuid().ToString();

            et.SAID = newid;

            et.SACreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
            et.SAModifyTime = et.SACreateTime;

            KPI_SATagDal.Insert(et);

            //得分信息
            string sql = "select ScoreID, SAID from KPI_Score where SAID = '" + SAID + "'";

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

            if (dt.Rows.Count <= 0)
            {
                return(true);
            }
            else
            {
                foreach (DataRow dr in dt.Rows)
                {
                    //
                    KPI_SecurityEntity se = KPI_SecurityDal.GetEntity(dr["SecurityID"].ToString());

                    se.SecurityID = Guid.NewGuid().ToString();
                    se.SAID       = newid;

                    //se.SecurityCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss");
                    //se.SecurityModifyTime = se.SecurityCreateTime;

                    //KPI_SecurityDal.Insert(se);
                }
            }


            return(true);
        }