/// <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); }
/// <summary> /// 拷贝实体数据 /// </summary> /// <returns></returns> public static bool CopyECTag(string ECID) { ECTagEntity et = ECTagDal.GetEntity(ECID); //NewID string newid = Guid.NewGuid().ToString(); et.ECID = newid; et.ECCode = "Copy_" + et.ECCode; if (ALLDal.CodeExist(et.ECCode, "")) { return(false); } et.ECName = "Copy_" + et.ECName; et.ECCreateTime = DateTime.Now.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); et.ECModifyTime = et.ECCreateTime; ECTagDal.Insert(et); return(true); }