예제 #1
0
    private void GetDetail()
    {
        RetrieveCriteria rc = new RetrieveCriteria(typeof(XiHuan_UserInfoEntity));
        Condition        c  = rc.GetNewCondition();

        c.AddEqualTo(XiHuan_UserInfoEntity.__USERNAME, txtUserName.Text.Trim());
        rc.AddSelect(XiHuan_UserInfoEntity.__ID);
        rc.AddSelect(XiHuan_UserInfoEntity.__ORIGNALPWD);
        rc.AddSelect(XiHuan_UserInfoEntity.__ISLOCKED);
        XiHuan_UserInfoEntity user = rc.AsEntity() as XiHuan_UserInfoEntity;

        if (user != null)
        {
            if (user.IsLocked == 0)
            {
                lblResult.Text = string.Format("密码为:<span class=\"highlight\">{0}</span>,<a href=\"###\" onclick=\"LockUser({1});\">锁定此账号</a>", user.OrignalPwd, user.ID);
            }
            if (user.IsLocked == 1)
            {
                lblResult.Text = string.Format("密码为:<span class=\"highlight\">{0}</span>,<a href=\"###\" onclick=\"UnLockUser({1});\">撤消锁定此账号</a>", user.OrignalPwd, user.ID);
            }
        }
        else
        {
            lblResult.Text = "<span class=\"highlight\">没有找到此会员的信息!</span>";
        }
    }
예제 #2
0
        private FNRETRIEVAL_STEntity GetRetrievalStation(string retrieval_station)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNRETRIEVAL_STEntity));

            rc.GetNewCondition().AddEqualTo(FNRETRIEVAL_STEntity.__RETRIEVAL_STATION, retrieval_station);
            return((FNRETRIEVAL_STEntity)rc.AsEntity());
        }
예제 #3
0
파일: xh.aspx.cs 프로젝트: gangqiang/xihuan
    private void InitPage()
    {
        int uid = CommonMethod.ConvertToInt(Request["Id"], 0);

        if (uid > 0)
        {
            #region 浏览过该换品的人

            #region 浏览历史

            int gid = GoodDetail.ID;
            if (IsUserAlreadyLogin)
            {
                RetrieveCriteria rcview = new RetrieveCriteria(typeof(XiHuan_GoodsViewUserEntity));
                Condition        cview  = rcview.GetNewCondition();
                cview.AddEqualTo(XiHuan_GoodsViewUserEntity.__GOODSID, gid);
                cview.AddEqualTo(XiHuan_GoodsViewUserEntity.__VISITORID, CurrentUserId);
                cview.AddEqualTo(XiHuan_GoodsViewUserEntity._TYPE, 1);
                XiHuan_GoodsViewUserEntity newview = rcview.AsEntity() as XiHuan_GoodsViewUserEntity;
                if (CurrentUserId != gid)
                {
                    if (newview == null)
                    {
                        newview             = new XiHuan_GoodsViewUserEntity();
                        newview.GoodsId     = gid;
                        newview.VisitorId   = CurrentUserId;
                        newview.VisitorName = CurrentUserName;
                        newview.Type        = 1;
                    }
                    newview.VisitorHeadImage = CurrentUser.HeadImage;
                    newview.VisitDate        = DateTime.Now;
                    newview.Save();
                }
            }
            #endregion

            #endregion

            StringBuilder sbSql = new StringBuilder("select top 18 Id,Name,DefaultPhoto,ViewCount,DetailUrl from XiHuan_UserGoods with(nolock) where OwnerId={0} and IsChecked=1 order by CreateDate desc, ViewCount desc ;");
            sbSql.Append("select * from XiHuan_UserGoodsChangeRequire with(nolock) where OwnerId={0} order by RequireDate desc; ");
            sbSql.Append("select * from XiHuan_UserGoodsChangeRequire with(nolock) where SenderId={0} order by RequireDate desc; ");
            sbSql.Append("select * from XiHuan_GuestBook with(nolock) where ToId={0} order by CreateDate desc; ");
            sbSql.Append("select FriendId,FriendName from XiHuan_UserFriends with(nolock) where OwnerId={0} order by AddDate desc; ");
            sbSql.Append("select top 10 VisitorId,VisitorName,VisitorHeadImage,VisitDate from XiHuan_GoodsViewUser with(nolock) where Type=1 and GoodsId=" + gid + " order by VisitDate desc;");
            DataSet ds = Query.ProcessMultiSql(string.Format(sbSql.ToString(), uid), GlobalVar.DataBase_Name);
            dlsHotGoods.DataSource = ds.Tables[0];
            dlsHotGoods.DataBind();
            rptSend.DataSource = ds.Tables[1];
            rptSend.DataBind();
            rptRequire.DataSource = ds.Tables[2];
            rptRequire.DataBind();
            rptUserNotes.DataSource = ds.Tables[3];
            rptUserNotes.DataBind();
            rptGoodFriends.DataSource = ds.Tables[4];
            rptGoodFriends.DataBind();
            rptVisitor.DataSource = ds.Tables[5];
            rptVisitor.DataBind();
        }
    }
예제 #4
0
        public static FNHANSOEntity GetHansoByBucketNo(string bucketNo)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNHANSOEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNHANSOEntity.__BUCKET_NO, bucketNo);
            return(rc.AsEntity() as FNHANSOEntity);
        }
예제 #5
0
        private bool IsBucketExist(string bucketNo)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNZAIKOEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNZAIKOEntity.__BUCKET_NO, bucketNo);
            return(rc.AsEntity() != null);
        }
예제 #6
0
파일: UserAction.cs 프로젝트: feidu/TBAPP
 public string GetSessionKey(string nick)
 {
     RetrieveCriteria rc = new RetrieveCriteria(typeof(tb_UserEntity));
     Condition c = rc.GetNewCondition();
     c.AddEqualTo(tb_UserEntity.__NICK, nick);
     tb_UserEntity user = (tb_UserEntity)rc.AsEntity();
     return user.SessionKey;
 }
예제 #7
0
        public static FNHANSOEntity GetTransData(string mcKey)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNHANSOEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNHANSOEntity.__MCKEY, mcKey);
            return(rc.AsEntity() as FNHANSOEntity);
        }
예제 #8
0
        public static FNLOCATEntity GetLocationBySystemid(string systemid)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNLOCATEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNLOCATEntity.__SYSTEMID, systemid);
            return(rc.AsEntity() as FNLOCATEntity);
        }
예제 #9
0
        public static TERMINALEntity GetTermByIP(string ipAddress)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(TERMINALEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(TERMINALEntity.__IPADDRESS, ipAddress);
            return(rc.AsEntity() as TERMINALEntity);
        }
예제 #10
0
        public static USERATTRIBUTEEntity GetUserAttributeByUserId(string userId)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(USERATTRIBUTEEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(USERATTRIBUTEEntity.__USERID, userId);
            return(rc.AsEntity() as USERATTRIBUTEEntity);
        }
예제 #11
0
        public static FNRANGEEntity GetRange(string termNo)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNRANGEEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNRANGEEntity.__TERMNO, termNo);
            return(rc.AsEntity() as FNRANGEEntity);
        }
예제 #12
0
        public static FNSTATIONEntity GetStation(string stNo)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNSTATIONEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNSTATIONEntity.__STNO, stNo);
            return(rc.AsEntity() as FNSTATIONEntity);
        }
예제 #13
0
        public static FNZAIKOEntity GetZaiKoByTicketNo(string ticketNo)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNZAIKOEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNZAIKOEntity.__TICKET_NO, ticketNo);
            return(rc.AsEntity() as FNZAIKOEntity);
        }
예제 #14
0
    private void LoadDetail()
    {
        #region 浏览过该换品的人

        #region 浏览历史

        int gid = CommonMethod.ConvertToInt(Request["gid"], 0);
        if (gid > 0)
        {
            if (IsUserAlreadyLogin)
            {
                RetrieveCriteria rcview = new RetrieveCriteria(typeof(XiHuan_GoodsViewUserEntity));
                Condition        cview  = rcview.GetNewCondition();
                cview.AddEqualTo(XiHuan_GoodsViewUserEntity.__GOODSID, gid);
                cview.AddEqualTo(XiHuan_GoodsViewUserEntity.__VISITORID, CurrentUserId);
                cview.AddEqualTo(XiHuan_GoodsViewUserEntity._TYPE, 0);
                XiHuan_GoodsViewUserEntity newview = rcview.AsEntity() as XiHuan_GoodsViewUserEntity;
                if (newview == null)
                {
                    newview             = new XiHuan_GoodsViewUserEntity();
                    newview.GoodsId     = gid;
                    newview.VisitorId   = CurrentUserId;
                    newview.VisitorName = CurrentUserName;
                    newview.Type        = 0;
                }
                newview.VisitorHeadImage = CurrentUser.HeadImage;
                newview.VisitDate        = DateTime.Now;
                newview.Save();
            }
            #endregion

            string        sql           = @"select  top 10 VisitorId,VisitorName,VisitorHeadImage,VisitDate from XiHuan_GoodsViewUser with(nolock) where Type=0 and GoodsId={0} order by VisitDate desc;
                              declare  @vcount int;
                              update xihuan_usergoods set viewcount=viewcount+1,@vcount=viewcount+1 where id= {0};
                              select @vcount;";
            DataSet       ds            = Query.ProcessMultiSql(string.Format(sql, gid), GlobalVar.DataBase_Name);
            DataTable     dt            = ds.Tables[0];
            DataTable     dt2           = ds.Tables[1];
            int           viewcount     = (dt2 != null && dt2.Rows.Count > 0 ? CommonMethod.ConvertToInt(dt2.Rows[0][0], 0) : 0);
            StringBuilder sbViewContent = new StringBuilder();
            if (dt != null && dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    sbViewContent.AppendFormat("<li style=\"width: 170px; text-align: left;\"><a title=\"浏览时间{0}\" href=\"{1}\" target=\"_blank\"><img style=\"border: 0px; vertical-align: middle;\" title=\"{2}\" src=\"{3}\" width=\"50\" height=\"40\" />&nbsp;&nbsp;{4}</a></li>",
                                               dr["VisitDate"], SrcRootPath + "xh.aspx?id=" + dr["VisitorId"], dr["VisitorName"], SrcRootPath + dr["VisitorHeadImage"], dr["VisitorName"]);
                }
            }
            else
            {
                CommonMethod.ResponseAjaxContent(this.Page, "尚无登录用户浏览过...$" + viewcount);
                return;
            }

            CommonMethod.ResponseAjaxContent(this.Page, "<ul>" + sbViewContent + "</ul>$" + viewcount);
        }
        #endregion
    }
예제 #15
0
        public static FMZKEYEntity GetUnmanagedZKey(string zaikey)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FMZKEYEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FMZKEYEntity.__ZAIKEY, zaikey);
            c.AddEqualTo(FMZKEYEntity.__MANAGE_ITEM_FLAG, '1');
            return(rc.AsEntity() as FMZKEYEntity);
        }
예제 #16
0
        public static FNZAIKOEntity GetZaiKoInFlatWarehouseByBucketNo(string bucketNo)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNZAIKOEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNZAIKOEntity.__BUCKET_NO, bucketNo);
            c.AddEqualTo(FNZAIKOEntity.__STORAGE_PLACE_FLAG, "1");//平库
            return(rc.AsEntity() as FNZAIKOEntity);
        }
예제 #17
0
        public static bool IsSystemOnline()
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNAREAEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNAREAEntity.__ARCNO, "1");
            c.AddEqualTo(FNAREAEntity.__SYSTEMFLG, "1");
            return(rc.AsEntity() != null);
        }
예제 #18
0
        public static FNRANGEEntity GetRange(string section, string line)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNRANGEEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNRANGEEntity.__MADE_SECTION, section);
            c.AddEqualTo(FNRANGEEntity.__MADE_LINE, line);
            return(rc.AsEntity() as FNRANGEEntity);
        }
예제 #19
0
        public static LOGINUSEREntity GetUser(string userId, string password)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(LOGINUSEREntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(LOGINUSEREntity.__USERID, userId);
            c.AddEqualTo(LOGINUSEREntity.__PASSWORD, password);
            return(rc.AsEntity() as LOGINUSEREntity);
        }
예제 #20
0
    private void CheckeNotes()
    {
        Transaction t            = new Transaction();
        DataTable   dt           = Query.ProcessSql(@"SELECT Id,Content,ReplyContent FROM XiHuan_GuestBook WITH(nolock) WHERE IsChecked=0 ", GlobalVar.DataBase_Name);
        string      content      = string.Empty;
        string      replycontent = string.Empty;
        int         nid          = 0;

        if (dt != null && dt.Rows.Count > 0)
        {
            foreach (DataRow dr in dt.Rows)
            {
                nid          = CommonMethod.ConvertToInt(dr["Id"], 0);
                content      = CommonMethod.FinalString(dr["Content"]);
                replycontent = CommonMethod.FinalString(dr["ReplyContent"]);
                if (CommonMethodFacade.ValidFFZF(content).Length == 0 && CommonMethodFacade.ValidFFZF(replycontent).Length == 0)
                {
                    XiHuan_GuestBookEntity notesinfo = new XiHuan_GuestBookEntity();
                    notesinfo.Id = nid;
                    notesinfo.Retrieve();
                    if (notesinfo.IsPersistent)
                    {
                        notesinfo.IsChecked = 1;
                        t.AddSaveObject(notesinfo);
                        XiHuan_MessageEntity notechecknoticemessage = new XiHuan_MessageEntity();
                        notechecknoticemessage.FromId   = 1;
                        notechecknoticemessage.FromName = "喜换网";
                        notechecknoticemessage.ToId     = notesinfo.FromId;
                        notechecknoticemessage.ToName   = notesinfo.FromName;
                        notechecknoticemessage.Content  = string.Format("尊敬的喜换网会员<strong>{0}</strong>,您好:<br/>您给\"{1}\"的留言\"{2}\",已经通过审核,请注意查看!",
                                                                        notesinfo.FromName, notesinfo.ToName, notesinfo.Content);
                        notechecknoticemessage.Flag       = byte.Parse(XiHuan_MessageFacade.MessageState.未读.ToString("d"));
                        notechecknoticemessage.CreateDate = DateTime.Now;
                        t.AddSaveObject(notechecknoticemessage);
                        if (t.Process())
                        {
                            #region   如果是对换品页面的留言,重新生成换品页
                            if (CommonMethod.ConvertToInt(nid, 0) > 0)
                            {
                                RetrieveCriteria rcgoods = new RetrieveCriteria(typeof(XiHuan_UserGoodsEntity));
                                rcgoods.AddSelect(XiHuan_UserGoodsEntity.__DETAILURL);
                                Condition cgoods = rcgoods.GetNewCondition();
                                cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ID, notesinfo.GoodsId);
                                cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ISCHECKED, 1);
                                XiHuan_UserGoodsEntity goods = rcgoods.AsEntity() as XiHuan_UserGoodsEntity;
                                if (goods != null)
                                {
                                    CommonMethod.readAspxAndWriteHtmlSoruce("../showdetail.aspx?id=" + notesinfo.GoodsId, "../" + goods.DetailUrl);
                                }
                            }
                            #endregion
                        }
                    }
                }
            }
        }
    }
예제 #21
0
        public static FNTOUCYAKUEntity GetArrivalReport(string stationNo)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNTOUCYAKUEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNTOUCYAKUEntity.__STNO, stationNo);
            c.AddEqualTo(FNTOUCYAKUEntity.__SYORIFLG, "1");
            return(rc.AsEntity() as FNTOUCYAKUEntity);
        }
예제 #22
0
파일: SqlDal.cs 프로젝트: sharespy/my-sim-m
        /// <summary>
        /// 返回某个系统选项的值
        /// </summary>
        /// <param name="setupKey">关键字</param>
        /// <returns></returns>
        public string GetAppSetupValue(string setupKey)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(Entity系统选项表));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(Entity系统选项表.__关键字, setupKey);
            Entity系统选项表 ex = (Entity系统选项表)rc.AsEntity();

            return(ex.值);
        }
예제 #23
0
        public static LedMessage getLedMessageByLedNo(string ledNo, bool justStart)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(LedMessage));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(LedMessage.__LEDNO, ledNo);
            if (!justStart)
            {
                c.AddEqualTo(LedMessage.__PROCESSED, '0');
            }
            return(rc.AsEntity() as LedMessage);
        }
예제 #24
0
    private void CheckNotes(string id, string gid)
    {
        #region 留言通过审核,给留言人发送提醒短消息,提醒留言已通过审核

        Transaction            t         = new Transaction();
        XiHuan_GuestBookEntity notesinfo = new XiHuan_GuestBookEntity();
        notesinfo.Id = CommonMethod.ConvertToInt(id, 0);
        notesinfo.Retrieve();
        if (notesinfo.IsPersistent)
        {
            notesinfo.IsChecked = 1;
            t.AddSaveObject(notesinfo);
            XiHuan_MessageEntity notechecknoticemessage = new XiHuan_MessageEntity();
            notechecknoticemessage.FromId   = 1;
            notechecknoticemessage.FromName = "喜换网";
            notechecknoticemessage.ToId     = notesinfo.FromId;
            notechecknoticemessage.ToName   = notesinfo.FromName;
            notechecknoticemessage.Content  = string.Format("尊敬的喜换网会员<strong>{0}</strong>,您好:<br/>您给\"{1}\"的留言\"{2}\",已经通过审核,请注意查看!",
                                                            notesinfo.FromName, notesinfo.ToName, notesinfo.Content);
            notechecknoticemessage.Flag       = byte.Parse(XiHuan_MessageFacade.MessageState.未读.ToString("d"));
            notechecknoticemessage.CreateDate = DateTime.Now;
            t.AddSaveObject(notechecknoticemessage);
        }

        #endregion

        if (t.Process())
        {
            #region   如果是对换品页面的留言,重新生成换品页
            if (CommonMethod.ConvertToInt(gid, 0) > 0)
            {
                RetrieveCriteria rcgoods = new RetrieveCriteria(typeof(XiHuan_UserGoodsEntity));
                rcgoods.AddSelect(XiHuan_UserGoodsEntity.__DETAILURL);
                Condition cgoods = rcgoods.GetNewCondition();
                cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ID, gid);
                cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ISCHECKED, 1);
                XiHuan_UserGoodsEntity goods = rcgoods.AsEntity() as XiHuan_UserGoodsEntity;
                if (goods != null)
                {
                    CommonMethod.readAspxAndWriteHtmlSoruce("../showdetail.aspx?id=" + gid, "../" + goods.DetailUrl);
                }
            }
            #endregion

            Alert("恭喜:留言审核成功!");
            BindNotes(0);
        }
        else
        {
            t.RollBack();
        }
    }
예제 #25
0
파일: UserAction.cs 프로젝트: feidu/TBAPP
 public int GetUserIdByNick(string nick)
 {
     RetrieveCriteria rc = new RetrieveCriteria(typeof(tb_UserEntity));
     Condition c = rc.GetNewCondition();
     c.AddEqualTo(tb_UserEntity.__NICK,nick);
     tb_UserEntity ue = (tb_UserEntity)rc.AsEntity();
     if (ue != null)
     {
         return ue.id;
     }
     else
     {
         return 0;
     }
 }
예제 #26
0
        private string GetPrintName(decimal printNo)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNPRINTEREntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FNPRINTEREntity.__PRINTER_NO, printNo);
            FNPRINTEREntity printer = rc.AsEntity() as FNPRINTEREntity;

            if (printer != null)
            {
                return(printer.PRINTER_NAME.Trim());
            }
            else
            {
                return(null);
            }
        }
예제 #27
0
        private string GetItemName(string itemcode)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FMZKEYEntity));
            Condition        c  = rc.GetNewCondition();

            c.AddEqualTo(FMZKEYEntity.__ZAIKEY, itemcode);
            FMZKEYEntity zkey = rc.AsEntity() as FMZKEYEntity;

            if (zkey != null)
            {
                return(zkey.ZKNAME1);
            }
            else
            {
                return(string.Empty);
            }
        }
예제 #28
0
파일: UserAction.cs 프로젝트: feidu/TBAPP
        public bool CheckIsOverTime(string nick)
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(tb_UserEntity));
            Condition c = rc.GetNewCondition();
            c.AddEqualTo(tb_UserEntity.__NICK,nick);

            tb_UserEntity ue=(tb_UserEntity)rc.AsEntity();
            //体验版或者过期
            if (ue.syslevel == ((int)Util.Enum.UserSysLevel.Experience).ToString() || ue.authEndTime < DateTime.Now)
            {
                return false;
            }
            else
            {
                return true;
            }
        }
예제 #29
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);
            }
        }
예제 #30
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        #region 验证

        if (txtContent.Text.Trim().Length == 0)
        {
            Alert("请输入回复内容!");
            return;
        }

        #endregion

        XiHuan_GuestBookEntity note = new XiHuan_GuestBookEntity();
        note.Id = CommonMethod.ConvertToInt(Request["id"], 0);
        if (note.Id > 0)
        {
            note.Retrieve();
        }
        if (note.IsPersistent)
        {
            note.Flag         = (byte)XiHuan_UserNotesFacade.NotesState.已回复;
            note.ReplyContent = CommonMethod.ClearInputText(txtContent.Text, 200);
            note.IsChecked    = 0;
            note.Save();
            if (note.GoodsId > 0)
            {
                RetrieveCriteria rcgoods = new RetrieveCriteria(typeof(XiHuan_UserGoodsEntity));
                rcgoods.AddSelect(XiHuan_UserGoodsEntity.__DETAILURL);
                Condition cgoods = rcgoods.GetNewCondition();
                cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ID, note.GoodsId);
                cgoods.AddEqualTo(XiHuan_UserGoodsEntity.__ISCHECKED, 1);
                XiHuan_UserGoodsEntity goods = rcgoods.AsEntity() as XiHuan_UserGoodsEntity;
                if (goods != null)
                {
                    CommonMethod.readAspxAndWriteHtmlSoruce("showdetail.aspx?id=" + note.GoodsId, goods.DetailUrl);
                }
            }
            Alert("恭喜:留言回复成功!");
            ExecScript(string.Format("parent.location='membernotes.aspx?type={0}';", Request["type"]));
        }
    }
예제 #31
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        RetrieveCriteria rc = new RetrieveCriteria(typeof(XiHuan_UserInfoEntity));
        Condition        c  = rc.GetNewCondition();

        c.AddEqualTo(XiHuan_UserInfoEntity.__USERNAME, txtName.Text.Trim());
        rc.AddSelect(XiHuan_UserInfoEntity.__USERNAME);
        rc.AddSelect(XiHuan_UserInfoEntity.__ORIGNALPWD);
        rc.AddSelect(XiHuan_UserInfoEntity.__QUESTION);
        rc.AddSelect(XiHuan_UserInfoEntity.__ANSWER);
        XiHuan_UserInfoEntity user = rc.AsEntity() as XiHuan_UserInfoEntity;

        if (user != null)
        {
            if (user.Question == txtQuestion.Text.Trim() && user.Answer == txtAnswer.Text.Trim())
            {
                try
                {
                    SendMailFacade.sendEmail(txtEmail.Text.Trim(), "喜换网-找回密码", "<strong>" + txtName.Text.Trim() + "</strong>您好,<br/>您在喜换网注册的账号密码为" + user.OrignalPwd + ",请妥善保管,此邮件为系统邮件,请勿回复!");
                    Alert("您的密码已成功发送到您的邮箱,请注意查收!");
                    ExecScript("parent.ymPrompt.close();");
                }
                catch
                {
                    Alert("抱歉:邮件发送出现错误!");
                    return;
                }
            }
            else
            {
                Alert("很抱歉:您输入的安全提问问题和答案不符合,我们不能为您提供找回密码的服务!");
                return;
            }
        }
        else
        {
            Alert("不存在换客名为" + txtName.Text + "的用户!");
            return;
        }
    }
예제 #32
0
    private void InitPage()
    {
        if (GoodDetail == null)
        {
            return;
        }

        #region 界面显示
        RetrieveCriteria rc = new RetrieveCriteria(typeof(XiHuan_UserInfoEntity));
        Condition        c  = rc.GetNewCondition();
        c.AddEqualTo(XiHuan_UserInfoEntity.__ID, GoodDetail.OwnerId);
        rc.AddSelect(XiHuan_UserInfoEntity.__GENDER);
        rc.AddSelect(XiHuan_UserInfoEntity.__SCORE);
        rc.AddSelect(XiHuan_UserInfoEntity.__HUANBI);
        rc.AddSelect(XiHuan_UserInfoEntity.__GOODFEED);
        rc.AddSelect(XiHuan_UserInfoEntity.__XINYU);
        rc.AddSelect(XiHuan_UserInfoEntity.__REGISTERDATE);
        rc.AddSelect(XiHuan_UserInfoEntity.__LASTLOGINTIME);
        rc.AddSelect(XiHuan_UserInfoEntity._TelePhone);
        rc.AddSelect(XiHuan_UserInfoEntity._WangWang);
        rc.AddSelect(XiHuan_UserInfoEntity.__EMAIL);
        rc.AddSelect(XiHuan_UserInfoEntity.__QQ);
        rc.AddSelect(XiHuan_UserInfoEntity.__MSN);
        rc.AddSelect(XiHuan_UserInfoEntity.__OTHERLINK);
        XiHuan_UserInfoEntity user = rc.AsEntity() as XiHuan_UserInfoEntity;
        lblScore.Text         = user.Score.ToString();
        lblHB.Text            = user.HuanBi.ToString();
        lblGoodFeed.Text      = user.GoodFeed.ToString();
        lblXY.Text            = user.XinYu.ToString();
        lblRegisterDate.Text  = user.RegisterDate.ToString("yyyy-MM-dd");
        lblLastLoginTime.Text = user.LastLoginTime.ToString("yyyy-MM-dd");
        lblWW.Text            = CommonMethod.FinalString(user.WangWang).Length > 0 ? "&nbsp;" + string.Format(GlobalVar.BIGSTRWW, Server.UrlEncode(user.WangWang)) : string.Empty;
        lblQQ.Text            = CommonMethod.FinalString(user.QQ).Length > 0 ? string.Format(GlobalVar.QQSTR, user.QQ) : string.Empty;
        linkMethod.Text       = string.Format("&nbsp;&nbsp;电话:{0}&nbsp;&nbsp;&nbsp;&nbsp;邮箱:{1}&nbsp;&nbsp;&nbsp;&nbsp;旺旺:{5}&nbsp;&nbsp;&nbsp;&nbsp;QQ:{2}&nbsp;&nbsp;&nbsp;&nbsp;MSN:{3}<br/>&nbsp;&nbsp;其他联系方式:{4}", user.TelePhone, user.Email, user.QQ + lblQQ.Text, user.Msn, user.OtherLink, lblWW.Text);
        lblGender.Text        = CommonMethodFacade.FormatGender(user.Gender, SrcRootPath);
        #endregion

        #region 换主热门换品

        RetrieveCriteria rchotgoods        = new RetrieveCriteria(typeof(XiHuan_UserGoodsEntity));
        Condition        hotgoodscondition = rchotgoods.GetNewCondition();
        hotgoodscondition.AddEqualTo(XiHuan_UserGoodsEntity.__OWNERID, GoodDetail.OwnerId);
        hotgoodscondition.AddEqualTo(XiHuan_UserGoodsEntity.__ISCHECKED, 1);
        rchotgoods.AddSelect(XiHuan_UserGoodsEntity.__DEFAULTPHOTO);
        rchotgoods.AddSelect(XiHuan_UserGoodsEntity.__NAME);
        rchotgoods.AddSelect(XiHuan_UserGoodsEntity.__DETAILURL);
        rchotgoods.Top = 10;
        rchotgoods.OrderBy(XiHuan_UserGoodsEntity.__VIEWCOUNT, false);
        rptHotGoods.DataSource = rchotgoods.AsDataTable();
        rptHotGoods.DataBind();

        #endregion

        #region 其它相关换品

        DataTable dtrelateGoods = Query.ProcessSql(
            @"select top 10 DefaultPhoto,Name,DetailUrl from XiHuan_UserGoods 
        with(nolock) where TypeId=" + GoodDetail.TypeId + " and OwnerId<>" + GoodDetail.OwnerId + " and IsChecked=1 order by newid() ",
            GlobalVar.DataBase_Name);
        rtpRelateGoods.DataSource = dtrelateGoods;
        rtpRelateGoods.DataBind();

        #endregion

        #region 留言
        BindNotes();
        #endregion

        #region 交换请求

        BindRequire();

        #endregion

        #region  一换品下一换品链接

        string  sqlpre  = "select top 1 Name,DetailUrl from XiHuan_UserGoods with(nolock) where Id<" + Request["id"] + " and IsChecked=1 order by Id desc;";
        string  sqlnext = "select top 1 Name,DetailUrl from XiHuan_UserGoods with(nolock) where Id>" + Request["id"] + " and IsChecked=1 order by Id asc;";
        DataSet dt      = Query.ProcessMultiSql(sqlpre + sqlnext, GlobalVar.DataBase_Name);
        lblPre.Text  = dt.Tables[0].Rows.Count > 0 ? string.Format("<a href=\"{0}\" title=\"{1}\">{2}</a>", SrcRootPath + (dt.Tables[0].Rows[0][1]), dt.Tables[0].Rows[0][0], CommonMethod.GetSubString(CommonMethod.FinalString(dt.Tables[0].Rows[0][0]), 20, "")) : "没有了";
        lblNext.Text = dt.Tables[1].Rows.Count > 0 ? string.Format("<a href=\"{0}\" title=\"{1}\">{2}</a>", SrcRootPath + (dt.Tables[1].Rows[0][1]), dt.Tables[1].Rows[0][0], CommonMethod.GetSubString(CommonMethod.FinalString(dt.Tables[1].Rows[0][0]), 20, "")) : "没有了";

        #endregion

        #region 换品图片加载
        if (GoodDetail.DefaultPhoto != null && GoodDetail.DefaultPhoto.Trim().Length > 0 && !GoodDetail.DefaultPhoto.Trim().Equals("images/none.jpg"))
        {
            RetrieveCriteria rcgoodimage = new RetrieveCriteria(typeof(XiHuan_GoodsImageEntity));
            Condition        cg          = rcgoodimage.GetNewCondition();
            cg.AddEqualTo(XiHuan_GoodsImageEntity.__GOODSID, GoodDetail.Id);
            cg.AddEqualTo(XiHuan_GoodsImageEntity.__ISDEFAULTPHOTO, 0);
            rcgoodimage.AddSelect(XiHuan_GoodsImageEntity.__IMGSRC);
            rcgoodimage.AddSelect(XiHuan_GoodsImageEntity.__IMGDESC);
            rcgoodimage.OrderBy(XiHuan_GoodsImageEntity.__CREATEDATE, false);
            rptGoodsImage.DataSource = rcgoodimage.AsDataTable();
            rptGoodsImage.DataBind();
        }
        #endregion
    }
예제 #33
0
        public static FNSYSTEMEntity GetSystemInfo()
        {
            RetrieveCriteria rc = new RetrieveCriteria(typeof(FNSYSTEMEntity));

            return(rc.AsEntity() as FNSYSTEMEntity);
        }