示例#1
0
        public Expose178.Com.Model.Article GetArticle(string strArticleID)
        {
            Expose178.Com.Model.Article art = new Model.Article();
            DataSet dsArticle = GetArticleByID(strArticleID);

            if (Gadget.DatatSetIsNotNullOrEmpty(dsArticle))
            {
                art.ArticleID        = strArticleID;
                art.ArticleTile      = Gadget.GetDataRowStringValue(dsArticle.Tables[0].Rows[0], "ArticleTile");
                art.ArticleDate      = Gadget.GetDataRowDateTimeValue(dsArticle.Tables[0].Rows[0], "ArticleDate");
                art.ArticleBody      = Gadget.GetDataRowStringValue(dsArticle.Tables[0].Rows[0], "ArticleBody");
                art.BackgroundImgUrl = Gadget.GetDataRowStringValue(dsArticle.Tables[0].Rows[0], "BackgroundImgUrl");
                art.IsDraft          = Gadget.GetDataRowBoolValue(dsArticle.Tables[0].Rows[0], "IsDraft");
                art.IsValidated      = Gadget.GetDataRowBoolValue(dsArticle.Tables[0].Rows[0], "IsValidated");
                art.LastUpdatedDate  = Gadget.GetDataRowDateTimeValue(dsArticle.Tables[0].Rows[0], "LastUpdatedDate");

                string       strUID = Gadget.GetDataRowStringValue(dsArticle.Tables[0].Rows[0], "UpdatedByUserID");
                string       strstrAritcleTypeCode = Gadget.GetDataRowStringValue(dsArticle.Tables[0].Rows[0], "AritcleTypeCode");
                string       strReadRoleTypeCode   = Gadget.GetDataRowStringValue(dsArticle.Tables[0].Rows[0], "ReadRoleTypeCode");
                ArticleReply reply = new ArticleReply();
                User         user  = new User();
                art.ListReply    = reply.GetListReplyToArticle(strArticleID);
                art.ReadRoleType = GetReadRoleType(strReadRoleTypeCode);
                art.User         = user.GetUserByUID(strUID);
                art.AritcleType  = GetAritcleType(strstrAritcleTypeCode);
            }
            return(art);
        }
示例#2
0
        public Expose178.Com.Model.User GetUserByEmailID(string strEmailID)
        {
            Expose178.Com.Model.User user = new Model.User();
            DataSet   dsUser   = null;
            Hashtable hshParam = new Hashtable();

            Gadget.Addparamater(ref hshParam, "UserID", strEmailID);
            dsUser = dbOperator.ProcessData("usp_GetUserByUserIDEmail", hshParam, strDSN);
            if (Gadget.DatatSetIsNotNullOrEmpty(dsUser))
            {
                user.UserID          = Gadget.GetDataRowStringValue(dsUser.Tables[0].Rows[0], "UserID");;
                user.UserName        = Gadget.GetDataRowStringValue(dsUser.Tables[0].Rows[0], "UserName");
                user.UserEmail       = strEmailID;
                user.PwdHash         = Gadget.GetDataRowStringValue(dsUser.Tables[0].Rows[0], "PwdHash");
                user.PwdSalt         = Gadget.GetDataRowStringValue(dsUser.Tables[0].Rows[0], "PwdSalt");
                user.IsEffective     = Gadget.GetDataRowBoolValue(dsUser.Tables[0].Rows[0], "IsEffective");
                user.LastUpdatedDate = Gadget.GetDataRowDateTimeValue(dsUser.Tables[0].Rows[0], "LastUpdatedDate");
            }
            return(user);
        }
示例#3
0
        public IList <Expose178.Com.Model.ReplyToArticle> GetListReplyToArticle(string strArticleID)
        {
            IList <Expose178.Com.Model.ReplyToArticle> listReplyToArticle = null;
            DataSet   dsReplyToArticle = null;
            Hashtable hshParam         = new Hashtable();

            dsReplyToArticle = dbOperator.ProcessData("usp_GetReplyToArticle", hshParam, strDSN);
            if (Gadget.DatatSetIsNotNullOrEmpty(dsReplyToArticle))
            {
                listReplyToArticle = new List <Model.ReplyToArticle>();
                foreach (DataRow dr in dsReplyToArticle.Tables[0].Rows)
                {
                    Expose178.Com.Model.ReplyToArticle reply = new Model.ReplyToArticle();
                    reply.ArticleID       = strArticleID;
                    reply.IsValidated     = Gadget.GetDataRowBoolValue(dr, "IsValidated");
                    reply.LastUpdatedDate = Gadget.GetDataRowDateTimeValue(dr, "LastUpdatedDate");
                    reply.ReplyBody       = Gadget.GetDataRowStringValue(dr, "ReplyBody");
                    reply.ReplyID         = Gadget.GetDataRowStringValue(dr, "ReplyID");
                    reply.UpdatedByUserID = Gadget.GetDataRowStringValue(dr, "UpdatedByUserID");
                }
            }
            return(listReplyToArticle);
        }