Exemple #1
0
        public ActionResult PostInfo(long ID)
        {
            VD_POST _post = new VD_POST();

            _post = _postModel.getDetailsPost(ID);

            return(PartialView(_post));
        }
Exemple #2
0
        public ResultResponse insertUpdatePost(VD_POST _post)
        {
            string _Msg    = string.Empty;
            long   _Result = 0;

            _rr       = new ResultResponse();
            _DBAccess = new DBController();
            _DBAccess.InsertPost("WEB_VD_INSERT_POST", _post, ref _Msg, ref _Result);
            _rr.Msg    = _Msg;
            _rr.Result = _Result;

            return(_rr);
        }
Exemple #3
0
        public VD_POST getPostIndexByCategory(string CateID)
        {
            VD_POST info = new VD_POST();

            _DBAccess = new DBController();
            DataSet ds = new DataSet();

            ds = _DBAccess.GetEntityDetails("WEB_VD_GET_POST_INDEX_BY_CATEGORY", CateID);
            if (ds != null && ds.Tables.Count > 0)
            {
                if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                {
                    info.ID                = Convert.ToInt64(ds.Tables[0].Rows[0]["ID"]);
                    info.CategoryID        = Convert.ToString(ds.Tables[0].Rows[0]["CategoryID"]);
                    info.CategoryName      = Convert.ToString(ds.Tables[0].Rows[0]["CategoryName"]);
                    info.MetaTitleCategory = Convert.ToString(ds.Tables[0].Rows[0]["MetaTitleCategory"]);
                    info.MainMenuID        = Convert.ToString(ds.Tables[0].Rows[0]["MainMenuID"]);
                    info.MainMenuName      = Convert.ToString(ds.Tables[0].Rows[0]["MainMenuName"]);
                    info.MetaTitleMainMenu = Convert.ToString(ds.Tables[0].Rows[0]["MetaTitleMainMenu"]);
                    info.SubMenuID         = Convert.ToString(ds.Tables[0].Rows[0]["SubMenuID"]);
                    info.SubMenuName       = Convert.ToString(ds.Tables[0].Rows[0]["SubMenuName"]);
                    info.MetaTitleSubMenu  = Convert.ToString(ds.Tables[0].Rows[0]["MetaTitleSubMenu"]);
                    info.TitlePost         = Convert.ToString(ds.Tables[0].Rows[0]["TitlePost"]);
                    info.ContentPost       = Convert.ToString(ds.Tables[0].Rows[0]["ContentPost"]);
                    info.CreatedBy         = Convert.ToString(ds.Tables[0].Rows[0]["CreatedBy"]);
                    info.CreatedDate       = Convert.ToDateTime(ds.Tables[0].Rows[0]["CreatedDate"]);
                    info.ChangeBy          = Convert.ToString(ds.Tables[0].Rows[0]["ChangeBy"]);
                    info.ChangeDate        = Convert.ToDateTime(ds.Tables[0].Rows[0]["ChangeDate"]);
                    info.IsPublish         = Convert.ToBoolean(ds.Tables[0].Rows[0]["IsPublish"]);
                    info.IsSlide           = Convert.ToBoolean(ds.Tables[0].Rows[0]["IsSlide"]);
                    info.IsHome            = Convert.ToBoolean(ds.Tables[0].Rows[0]["IsHome"]);
                    info.IsActive          = Convert.ToBoolean(ds.Tables[0].Rows[0]["IsActive"]);
                    info.Comment           = Convert.ToString(ds.Tables[0].Rows[0]["Comment"]);
                    info.ImagesDisplay     = Convert.ToString(ds.Tables[0].Rows[0]["ImagesDisplay"]);
                    info.ShortDescription  = Convert.ToString(ds.Tables[0].Rows[0]["ShortDescription"]);
                    info.MetaDescription   = Convert.ToString(ds.Tables[0].Rows[0]["MetaDescription"]);
                    info.MetaKeywords      = Convert.ToString(ds.Tables[0].Rows[0]["MetaKeywords"]);
                    info.MetaTitle         = Convert.ToString(ds.Tables[0].Rows[0]["MetaTitle"]);
                    info.AdminComment      = Convert.ToString(ds.Tables[0].Rows[0]["AdminComment"]);
                }
            }

            return(info);
        }
Exemple #4
0
        //POST
        public void InsertPost(string DataTitle, VD_POST _post, ref string outputMsg, ref long outputResult)
        {
            SqlCommand command = this.DataManager.CreateCommand(DataTitle, CommandType.StoredProcedure);

            DataManager.AddParameterWithValue(command, "@ID", _post.ID);
            DataManager.AddParameterWithValue(command, "@CategoryID", _post.CategoryID);
            DataManager.AddParameterWithValue(command, "@MainMenuID", _post.MainMenuID);
            DataManager.AddParameterWithValue(command, "@SubMenuID", _post.SubMenuID);
            DataManager.AddParameterWithValue(command, "@TitlePost", _post.TitlePost);
            DataManager.AddParameterWithValue(command, "@ContentPost", _post.ContentPost);
            DataManager.AddParameterWithValue(command, "@CreatedBy", _post.CreatedBy);
            DataManager.AddParameterWithValue(command, "@ChangeBy", _post.ChangeBy);
            DataManager.AddParameterWithValue(command, "@IsPublish", _post.IsPublish);
            DataManager.AddParameterWithValue(command, "@IsSlide", _post.IsSlide);
            DataManager.AddParameterWithValue(command, "@IsHome", _post.IsHome);
            DataManager.AddParameterWithValue(command, "@IsActive", _post.IsActive);
            DataManager.AddParameterWithValue(command, "@Comment", _post.Comment);
            DataManager.AddParameterWithValue(command, "@ImagesDisplay", _post.ImagesDisplay);

            SqlParameter paramOutputMsg = new SqlParameter("@outputMsg", SqlDbType.NVarChar, 1000);

            paramOutputMsg.Direction = ParameterDirection.Output;
            DataManager.AddParameter(command, paramOutputMsg);

            SqlParameter paramOutputResult = new SqlParameter("@outputResult", SqlDbType.BigInt);

            paramOutputResult.Direction = ParameterDirection.Output;
            DataManager.AddParameter(command, paramOutputResult);

            DataManager.ExecuteNonQuery(command);
            if (paramOutputResult.Value != null)
            {
                outputResult = (long)paramOutputResult.Value;
                outputMsg    = paramOutputMsg.Value.ToString();
            }
            else
            {
                outputResult = -1;
                outputMsg    = string.Empty;
            }
        }
Exemple #5
0
 public void InsertPost(string DataTitle, VD_POST _post, ref string outputMsg, ref long outputResult)
 {
     _DB.InsertPost(DataTitle, _post, ref outputMsg, ref outputResult);
 }
 public ActionResult InsertUpdatePosts(VD_POST posts)
 {
     _rr = new ResultResponse();
     return(Json(_rr));
 }