Пример #1
0
        /// <summary>
        /// 判断用户名是否已经被占用,被占用返回TRUE,否则False
        /// </summary>
        /// <param name="username">用户名</param>
        /// <returns>被占用返回TRUE,否则False</returns>
        public static bool IsUserNameAlreayUse(string username)
        {
            username = CommonMethodFacade.FinalString(username);
            Query     checkuser = new Query(typeof(XiHuan_UserInfoEntity));
            Condition c         = checkuser.GetQueryCondition();

            c.AddEqualTo(XiHuan_UserInfoEntity.__USERNAME, username);
            checkuser.SelectCount(XiHuan_UserInfoEntity.__ID, "usercount");
            return(Convert.ToInt32(checkuser.ExecuteScalar()) > 0);
        }
Пример #2
0
        public static string GetProvinceNameById(string pid)
        {
            DataTable dt = ProvinceCityFacade.GetInstance().GetProvince();

            DataRow[] dr = dt.Select("provinceID=" + pid);
            if (dr.Length > 0)
            {
                return(CommonMethodFacade.FinalString(dr[0]["province"]));
            }
            else
            {
                return(string.Empty);
            }
        }
Пример #3
0
        public static string GetSchoolNameById(string pid, string cid, string sid)
        {
            DataTable dt = ProvinceCityFacade.GetInstance().GetSchoolInfo(pid, cid);

            DataRow[] dr = dt.Select("Id=" + sid);
            if (dr.Length > 0)
            {
                return(CommonMethodFacade.FinalString(dr[0]["SchoolName"]));
            }
            else
            {
                return(string.Empty);
            }
        }
Пример #4
0
        public static string GetAreaNameById(string aid)
        {
            DataTable dt = ProvinceCityFacade.GetInstance().GetAreaInfo("");

            DataRow[] dr = dt.Select("areaId=" + aid);
            if (dr.Length > 0)
            {
                return(CommonMethodFacade.FinalString(dr[0]["area"]));
            }
            else
            {
                return(string.Empty);
            }
        }
Пример #5
0
        public static int GetIdByName(string uname)
        {
            uname = CommonMethodFacade.FinalString(uname);
            RetrieveCriteria rc = new RetrieveCriteria(typeof(XiHuan_UserInfoEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(XiHuan_UserInfoEntity.__USERNAME, uname);
            rc.AddSelect(XiHuan_UserInfoEntity.__ID);
            XiHuan_UserInfoEntity user = rc.AsEntity() as XiHuan_UserInfoEntity;

            if (user != null)
            {
                return(user.ID);
            }
            else
            {
                return(0);
            }
        }
Пример #6
0
 public static bool IsUserValid(string uname, string upass)
 {
     uname = CommonMethodFacade.FinalString(uname);
     upass = CommonMethodFacade.FinalString(upass);
     if (uname.Length > 0 && upass.Length > 0)
     {
         string sqlLogin = @"UPDATE XiHuan_UserInfo SET LastLoginTime=getdate(), 
                                Score=Score+(CASE WHEN LastLoginTime<'{0}' THEN {1} ELSE 0 END ) 
                                WHERE UserName='******' AND  OrignalPwd='{3}' ;";
         int    effcount = Query.ProcessSqlNonQuery(string.Format(sqlLogin, DateTime.Now.ToString("yyyy-MM-dd"),
                                                                  SystemConfigFacade.Instance().LoginAddScore(), ValidatorHelper.SafeSql(uname),
                                                                  ValidatorHelper.SafeSql(upass)),
                                                    GlobalVar.DataBase_Name);
         return(effcount > 0);
     }
     else
     {
         return(false);
     }
 }
Пример #7
0
 public DataTable GetGoodsChildType(string parentid)
 {
     this.dtinfo = this.dtChildTypeInfo.Clone();
     if (CommonMethodFacade.FinalString(parentid).Length > 0)
     {
         DataRow[] dr = this.dtChildTypeInfo.Select("ParentId=" + parentid);
         foreach (DataRow row in dr)
         {
             DataRow newrow = dtinfo.NewRow();
             newrow["Id"]   = row["Id"];
             newrow["Name"] = row["Name"];
             dtinfo.Rows.Add(newrow);
         }
         return(this.dtinfo);
     }
     else
     {
         return(this.dtChildTypeInfo);
     }
 }
Пример #8
0
        public DataTable GetSchoolInfo(string pid, string cid)
        {
            pid = CommonMethodFacade.FinalString(pid);
            cid = CommonMethodFacade.FinalString(cid);
            if (pid.Length == 0 && cid.Length == 0)
            {
                return(this.schoolDt);
            }
            else
            {
                string filter = string.Empty;
                schoolInfo = schoolDt.Clone();
                if (pid.Length > 0 && cid.Length > 0)
                {
                    filter += string.Format("ProvinceId={0} and CityId={1} ", pid, cid);
                }
                else
                {
                    if (pid.Length > 0)
                    {
                        filter += string.Format("ProvinceId={0} ", pid);
                    }
                    if (cid.Length > 0)
                    {
                        filter += string.Format("CityId={0} ", cid);
                    }
                }

                DataRow[] schoolrow = schoolDt.Select(filter);
                foreach (DataRow row in schoolrow)
                {
                    DataRow newschoolrow = schoolInfo.NewRow();
                    newschoolrow["SchoolName"] = row["SchoolName"];
                    newschoolrow["Id"]         = row["Id"];
                    newschoolrow["ProvinceId"] = row["ProvinceId"];
                    newschoolrow["CityId"]     = row["CityId"];
                    schoolInfo.Rows.Add(newschoolrow);
                }
                return(this.schoolInfo);
            }
        }
Пример #9
0
 public DataTable GetAreaInfo(string cid)
 {
     cid = CommonMethodFacade.FinalString(cid);
     if (cid.Length > 0)
     {
         this.areaInfo = areaDt.Clone();
         DataRow[] arearow = areaDt.Select("father='" + cid + "'");
         foreach (DataRow row in arearow)
         {
             DataRow newarearow = areaInfo.NewRow();
             newarearow["area"]   = row["area"];
             newarearow["areaId"] = row["areaId"];
             areaInfo.Rows.Add(newarearow);
         }
         return(areaInfo);
     }
     else
     {
         return(this.areaDt);
     }
 }
Пример #10
0
        public static string GetCityNameById(string cid)
        {
            string    result = string.Empty;
            DataTable dt     = ProvinceCityFacade.GetInstance().GetCityInfo("");

            DataRow[] dr = dt.Select("cityID=" + cid);
            if (dr.Length > 0)
            {
                result = CommonMethodFacade.FinalString(dr[0]["city"]);
            }
            else
            {
                dr = dt.Select("father=" + cid);
                if (dr.Length > 0)
                {
                    result = CommonMethodFacade.FinalString(dr[0]["city"]);
                }
            }

            return(result);
        }
Пример #11
0
 /// <summary>
 /// 悄悄话是否可见
 /// </summary>
 /// <param name="fromid">留言人Id</param>
 /// <param name="toid">留言对象Id</param>
 /// <param name="uid">当前人Id</param>
 /// <param name="issceret">是否悄悄话</param>
 /// <returns>是否需要显示留言内容</returns>
 public static bool IsSceretNoteShow(string fromid, string toid, string uid, string issceret)
 {
     fromid   = CommonMethodFacade.FinalString(fromid);
     toid     = CommonMethodFacade.FinalString(toid);
     issceret = CommonMethodFacade.FinalString(issceret);
     if (issceret.Equals("1"))
     {
         if (uid.Equals("0"))
         {
             return(false);
         }
         else
         {
             return(uid == fromid || uid == toid);
         }
     }
     else
     {
         return(true);
     }
 }
Пример #12
0
 public DataTable GetCityInfo(string pid)
 {
     pid = CommonMethodFacade.FinalString(pid);
     if (pid.Length > 0)
     {
         this.cityInfo = cityDt.Clone();
         DataRow[] cityrow = cityDt.Select("father='" + pid + "'");
         foreach (DataRow row in cityrow)
         {
             DataRow newcityrow = cityInfo.NewRow();
             newcityrow["city"]   = row["city"];
             newcityrow["cityId"] = row["cityId"];
             newcityrow["father"] = row["father"];
             cityInfo.Rows.Add(newcityrow);
         }
         return(cityInfo);
     }
     else
     {
         return(this.cityDt);
     }
 }
Пример #13
0
 public string RegMesContent()
 {
     DataRow[] dr = dt.Select("ConfigKey='RegisterMessageContent'");
     return(dr.Length > 0 ? CommonMethodFacade.FinalString(dr[0]["ConfigValue"]) : string.Empty);
 }