Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 public Expose178.Com.Model.ArticleAddtional GetArticleAddtional(string strArticleID)
 {
     Expose178.Com.Model.ArticleAddtional addtion = new Model.ArticleAddtional();
     try
     {
         DataSet dsArticleAdd = GetArticleAddtionalByArticleID(strArticleID);
         if (Gadget.DatatSetIsNotNullOrEmpty(dsArticleAdd))
         {
             addtion.AdditionalID    = Gadget.GetDataRowStringValue(dsArticleAdd.Tables[0].Rows[0], "AdditionalID");
             addtion.ArticleID       = strArticleID;
             addtion.LastUpdatedDate = Gadget.GetDataRowDateTimeValue(dsArticleAdd.Tables[0].Rows[0], "LastUpdatedDate");
             addtion.ReadNum         = Gadget.GetDataRowIntValue(dsArticleAdd.Tables[0].Rows[0], "ReadNum");
             addtion.ReplyNum        = Gadget.GetDataRowIntValue(dsArticleAdd.Tables[0].Rows[0], "ReplyNum");
             addtion.UpdatedByUserID = Gadget.GetDataRowStringValue(dsArticleAdd.Tables[0].Rows[0], "UpdatedByUserID");
         }
     }
     catch (Exception ex)
     {
         Hashtable hshParam = new Hashtable();
         hshParam.Add("Error", ex.Message);
         hshParam.Add("UID", Expose178.Com.GadgetScripts.Gadget.GetUserID());
         Expose178.Com.UtilityFactory.Log.WriteLog(hshParam, "ProxyArticle.GetArticleAddtional", UtilityFactory.LogType.LogToDB);
     }
     return(addtion);
 }
Ejemplo n.º 3
0
 public bool UpdateArticleAddtional(Expose178.Com.Model.ArticleAddtional addtional)
 {
     if (Gadget.DatatSetIsNotNullOrEmpty(UpdateDataSetArticleAddtional(addtional)))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 4
0
        public Expose178.Com.Model.AritcleType GetArticleType(string strArticleTypeCode)
        {
            DataSet dsArticleType = GetDataSetArticleType(strArticleTypeCode);

            Expose178.Com.Model.AritcleType mAritcleType = null;
            if (Gadget.DatatSetIsNotNullOrEmpty(dsArticleType))
            {
                mAritcleType = new Model.AritcleType();
                mAritcleType.AritcleTypeCode = Gadget.GetDataRowStringValue(dsArticleType.Tables[0].Rows[0], "AritcleTypeCode");
                mAritcleType.AritcleTypeDesc = Gadget.GetDataRowStringValue(dsArticleType.Tables[0].Rows[0], "AritcleTypeDesc");
                mAritcleType.UpdatedByUserID = Gadget.GetDataRowStringValue(dsArticleType.Tables[0].Rows[0], "UpdatedByUserID");
                mAritcleType.LastUpdatedDate = Gadget.GetDataRowDateTimeValue(dsArticleType.Tables[0].Rows[0], "LastUpdatedDate");
            }
            return(mAritcleType);
        }
Ejemplo n.º 5
0
        public Expose178.Com.Model.ReadRoleType GetReadRole(string strReadRoleTypeCode)
        {
            DataSet dsReadRole = GetDataSetReadRole("");

            Expose178.Com.Model.ReadRoleType read = null;
            if (Gadget.DatatSetIsNotNullOrEmpty(dsReadRole))
            {
                read = new Model.ReadRoleType();
                read.ReadRoleTypeCode = Gadget.GetDataRowStringValue(dsReadRole.Tables[0].Rows[0], "ReadRoleTypeCode");
                read.ReadRoleTypeDesc = Gadget.GetDataRowStringValue(dsReadRole.Tables[0].Rows[0], "ReadRoleTypeDesc");
                read.UpdatedByUserID  = Gadget.GetDataRowStringValue(dsReadRole.Tables[0].Rows[0], "UpdatedByUserID");
                read.LastUpdatedDate  = Gadget.GetDataRowDateTimeValue(dsReadRole.Tables[0].Rows[0], "LastUpdatedDate");
            }
            return(read);
        }
Ejemplo n.º 6
0
        private Expose178.Com.Model.ReadRoleType GetReadRoleType(string strReadRoleTypeCode)
        {
            Expose178.Com.Model.ReadRoleType ReadRoleType = new Model.ReadRoleType();
            DataSet   dsReadRoleType = null;
            Hashtable hshParam       = new Hashtable();

            dsReadRoleType = dbOperator.ProcessData("usp_GetReadRoleType", hshParam, strDSN);
            if (Gadget.DatatSetIsNotNullOrEmpty(dsReadRoleType))
            {
                ReadRoleType.ReadRoleTypeCode = strReadRoleTypeCode;
                ReadRoleType.ReadRoleTypeDesc = Gadget.GetDataRowStringValue(dsReadRoleType.Tables[0].Rows[0], "ReadRoleTypeDesc");
                ReadRoleType.LastUpdatedDate  = Gadget.GetDataRowDateTimeValue(dsReadRoleType.Tables[0].Rows[0], "LastUpdatedDate");
                ReadRoleType.UpdatedByUserID  = Gadget.GetDataRowStringValue(dsReadRoleType.Tables[0].Rows[0], "UpdatedByUserID");
            }
            return(ReadRoleType);
        }
Ejemplo n.º 7
0
        private Expose178.Com.Model.AritcleType GetAritcleType(string strAritcleTypeCode)
        {
            Expose178.Com.Model.AritcleType arType = new Model.AritcleType();
            DataSet   dsAritcleType = null;
            Hashtable hshParam      = new Hashtable();

            Gadget.Addparamater(ref hshParam, "AritcleTypeCode", strAritcleTypeCode);
            dsAritcleType = dbOperator.ProcessData("usp_GetAritcleType", hshParam, strDSN);
            if (Gadget.DatatSetIsNotNullOrEmpty(dsAritcleType))
            {
                arType.AritcleTypeCode = strAritcleTypeCode;
                arType.AritcleTypeDesc = Gadget.GetDataRowStringValue(dsAritcleType.Tables[0].Rows[0], "AritcleTypeDesc");
                arType.LastUpdatedDate = Gadget.GetDataRowDateTimeValue(dsAritcleType.Tables[0].Rows[0], "LastUpdatedDate");
                arType.UpdatedByUserID = Gadget.GetDataRowStringValue(dsAritcleType.Tables[0].Rows[0], "UpdatedByUserID");
            }
            return(arType);
        }
Ejemplo n.º 8
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);
        }
Ejemplo n.º 9
0
        public IList <Expose178.Com.Model.AritcleType> GetListArticleType()
        {
            IList <Expose178.Com.Model.AritcleType> listAritcleType = null;
            DataSet dsArticleType = GetDataSetArticleType("");

            if (Gadget.DatatSetIsNotNullOrEmpty(dsArticleType))
            {
                listAritcleType = new List <Expose178.Com.Model.AritcleType>();
                foreach (DataRow dr in dsArticleType.Tables[0].Rows)
                {
                    Expose178.Com.Model.AritcleType mAritcleType = new Model.AritcleType();
                    mAritcleType.AritcleTypeCode = Gadget.GetDataRowStringValue(dr, "AritcleTypeCode");
                    mAritcleType.AritcleTypeDesc = Gadget.GetDataRowStringValue(dr, "AritcleTypeDesc");
                    mAritcleType.UpdatedByUserID = Gadget.GetDataRowStringValue(dr, "UpdatedByUserID");
                    mAritcleType.LastUpdatedDate = Gadget.GetDataRowDateTimeValue(dr, "LastUpdatedDate");
                    listAritcleType.Add(mAritcleType);
                }
            }
            return(listAritcleType);
        }
Ejemplo n.º 10
0
        public bool AddUpdateReplyToArticle(Expose178.Com.Model.ReplyToArticle reply)
        {
            DataSet   dsReplyToArticle = null;
            Hashtable hshParam         = new Hashtable();

            Gadget.Addparamater(ref hshParam, "ArticleID", reply.ArticleID);
            Gadget.Addparamater(ref hshParam, "ReplyID", reply.ReplyID);
            Gadget.Addparamater(ref hshParam, "ReplyBody", reply.ReplyBody);
            Gadget.Addparamater(ref hshParam, "IsValidated", reply.IsValidated == true ? "1" : "0");
            Gadget.Addparamater(ref hshParam, "UpdatedByUserID", reply.UpdatedByUserID);
            dsReplyToArticle = dbOperator.ProcessData("usp_AddUpdateReplyToArticleByReplyID", hshParam, strDSN);
            if (Gadget.DatatSetIsNotNullOrEmpty(dsReplyToArticle))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 11
0
        public IList <Expose178.Com.Model.ReadRoleType> GetListReadRole()
        {
            DataSet dsReadRole = GetDataSetReadRole("");
            IList <Expose178.Com.Model.ReadRoleType> listReadRole = null;

            if (Gadget.DatatSetIsNotNullOrEmpty(dsReadRole))
            {
                listReadRole = new List <Expose178.Com.Model.ReadRoleType>();
                foreach (DataRow dr in dsReadRole.Tables[0].Rows)
                {
                    Expose178.Com.Model.ReadRoleType read = new Model.ReadRoleType();
                    read.ReadRoleTypeCode = Gadget.GetDataRowStringValue(dr, "ReadRoleTypeCode");
                    read.ReadRoleTypeDesc = Gadget.GetDataRowStringValue(dr, "ReadRoleTypeDesc");
                    read.UpdatedByUserID  = Gadget.GetDataRowStringValue(dr, "UpdatedByUserID");
                    read.LastUpdatedDate  = Gadget.GetDataRowDateTimeValue(dr, "LastUpdatedDate");
                    listReadRole.Add(read);
                }
            }
            return(listReadRole);
        }
Ejemplo n.º 12
0
        public IList <Expose178.Com.Model.ArticleTitle> GetArticleTitle()
        {
            IList <Expose178.Com.Model.ArticleTitle> listArticleTile = null;
            DataSet dsArtileTitle = GetDataSetArticleTitle();

            if (Gadget.DatatSetIsNotNullOrEmpty(dsArtileTitle))
            {
                listArticleTile = new List <Expose178.Com.Model.ArticleTitle>();
                foreach (DataRow dr in dsArtileTitle.Tables[0].Rows)
                {
                    Expose178.Com.Model.ArticleTitle art = new Model.ArticleTitle();
                    art.ArticleID      = Gadget.GetDataRowStringValue(dr, "ArticleID");
                    art.ArticleDate    = Gadget.GetDataRowDateTimeValue(dr, "ArticleDate");
                    art.ArticleTile    = Gadget.GetDataRowStringValue(dr, "ArticleTile");
                    art.ArticleSummary = Gadget.GetDataRowStringValue(dr, "ArticleSummary");
                    art.ReadNum        = Gadget.GetDataRowIntValue(dr, "ReadNum");
                    art.ReplyNum       = Gadget.GetDataRowIntValue(dr, "ReplyNum");
                    listArticleTile.Add(art);
                }
            }
            return(listArticleTile);
        }
Ejemplo n.º 13
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);
        }
Ejemplo n.º 14
0
        public bool AddUpdateUser(Model.User user)
        {
            DataSet   dsUser   = null;
            Hashtable hshPamra = new Hashtable();

            Gadget.Addparamater(ref hshPamra, "UserID", user.UserID);
            Gadget.Addparamater(ref hshPamra, "UserEmail", user.UserEmail);
            Gadget.Addparamater(ref hshPamra, "UserName", user.UserName);
            Gadget.Addparamater(ref hshPamra, "PwdHash", user.PwdHash);
            Gadget.Addparamater(ref hshPamra, "PwdSalt", user.PwdSalt);
            Gadget.Addparamater(ref hshPamra, "IsEffective", user.IsEffective == true?"1":"0");
            Gadget.Addparamater(ref hshPamra, "IsTempUser", user.IsTempUser == true ? "1" : "0");
            Gadget.Addparamater(ref hshPamra, "IP", user.IP);
            Gadget.Addparamater(ref hshPamra, "Browser", user.Browser);
            dsUser = dbOperator.ProcessData("usp_AddUpdateUserInfoByUserID", hshPamra, strDSN);
            if (Gadget.DatatSetIsNotNullOrEmpty(dsUser))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 15
0
        public bool AddUpdateArticle(Expose178.Com.Model.Article article)
        {
            DataSet   dsArticle = null;
            Hashtable hshParam  = new Hashtable();

            Gadget.Addparamater(ref hshParam, "ArticleID", article.ArticleID);
            Gadget.Addparamater(ref hshParam, "ArticleTile", article.ArticleTile);
            Gadget.Addparamater(ref hshParam, "ArticleBody", article.ArticleBody);
            Gadget.Addparamater(ref hshParam, "BackgroundImgUrl", article.BackgroundImgUrl);
            Gadget.Addparamater(ref hshParam, "IsDraft", article.IsDraft == true ? "1" : "0");
            Gadget.Addparamater(ref hshParam, "IsValidated", article.IsValidated == true ? "1" : "0");
            Gadget.Addparamater(ref hshParam, "UpdatedByUserID", article.UID);
            Gadget.Addparamater(ref hshParam, "ReadRoleTypeCode", article.ReadRoleTypeCode);
            Gadget.Addparamater(ref hshParam, "AritcleTypeCode", article.AritcleTypeCode);
            dsArticle = dbOperator.ProcessData("usp_AddUpdateArticleByArticleID", hshParam, strDSN);
            if (Gadget.DatatSetIsNotNullOrEmpty(dsArticle))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }