/// <summary>
 /// 查看记录是否存在
 /// </summary>
 /// <param name="KeyNames">字段名数组</param>
 /// <param name="_SqlDbTypes">字段类型数组</param>
 /// <param name="Values">字段值数组</param>
 /// <returns>bool</returns>
 public static bool Exists(string[] KeyNames, System.Data.SqlDbType[] _SqlDbTypes, object[] Values)
 {
     System.Collections.ArrayList SqlWhere = new System.Collections.ArrayList();
     Common.Net.CreateParameter   _C       = new Common.Net.CreateParameter();
     for (int i = 0; i < KeyNames.Length; i++)
     {
         _C.CanShu.Add("@" + KeyNames[i], _SqlDbTypes[i], Values[i]);
         SqlWhere.Add(string.Format(" {0}=@{0} ", KeyNames[i]));
     }
     return(Exists(SqlWhere.JArrayListToString(" and ", true), _C.Re_SqlParameter()));
 }
示例#2
0
        public static Admin getAdminByAdminID(string AdminID)
        {
            try
            {
                Common.Net.CreateParameter _C = new Common.Net.CreateParameter();
                _C.CanShu.Add("@AdminID", System.Data.SqlDbType.NVarChar, AdminID);
                List <Admin> m_AdminList = Orm.EntityCore <Admin> .GetModelList("AdminID=@AdminID", _C.Re_SqlParameter()).List;

                if (m_AdminList.Count == 0)
                {
                    return(null);
                }
                else
                {
                    return(m_AdminList[0]);
                }
            }
            catch
            {
                //Exception.MyExceptionLog.AddLogError("获取后体帐号model失败, Admin - getAdminByAdminID");
                return(null);
            }
        }