Beispiel #1
0
        public VD_Category getDetailsCategory(string ID)
        {
            VD_Category info = new VD_Category();

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

            ds = _DBAccess.GetEntityDetails("WEB_VD_GET_DETAILS_CATEGORY", ID);
            if (ds != null && ds.Tables.Count > 0)
            {
                if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                {
                    info.CategoryID      = Convert.ToString(ds.Tables[0].Rows[0]["CategoryID"]);
                    info.CategoryName    = Convert.ToString(ds.Tables[0].Rows[0]["CategoryName"]);
                    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.IsActive        = Convert.ToBoolean(ds.Tables[0].Rows[0]["IsActive"]);
                    info.zIndex          = Convert.ToInt32(ds.Tables[0].Rows[0]["zIndex"]);
                    info.IsHomeIndex     = Convert.ToBoolean(ds.Tables[0].Rows[0]["IsHomeIndex"]);
                }
            }

            return(info);
        }
Beispiel #2
0
        //Category
        public void insertUpdateCategory(string DataTitle, VD_Category category, ref string outputMsg, ref long outputResult)
        {
            SqlCommand command = this.DataManager.CreateCommand(DataTitle, CommandType.StoredProcedure);

            DataManager.AddParameterWithValue(command, "@CategoryID", category.CategoryID);
            DataManager.AddParameterWithValue(command, "@CategoryName", category.CategoryName);
            DataManager.AddParameterWithValue(command, "@IsActive", category.IsActive);
            DataManager.AddParameterWithValue(command, "@zIndex", category.zIndex);
            DataManager.AddParameterWithValue(command, "@IsHomeIndex", category.IsHomeIndex);

            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;
            }
        }
Beispiel #3
0
        public ActionResult InsertUpdateCategory(VD_Category category)
        {
            _rr = new ResultResponse();
            _rr = _cateModel.insertUpdateCategory(category);

            return(Json(_rr));
        }
Beispiel #4
0
        public ResultResponse insertUpdateCategory(VD_Category _category)
        {
            string _Msg    = string.Empty;
            long   _Result = 0;

            _rr       = new ResultResponse();
            _DBAccess = new DBController();
            _DBAccess.insertUpdateCategory("WEB_VD_INSERT_UPDATE_CATEGORY", _category, ref _Msg, ref _Result);
            _rr.Msg    = _Msg;
            _rr.Result = _Result;

            return(_rr);
        }
Beispiel #5
0
        public ActionResult EditCategory(string cateCode = "")
        {
            VD_Category _info = new VD_Category();

            if (!string.IsNullOrEmpty(cateCode))
            {
                _info = _cateModel.getDetailsCategory(cateCode);
            }
            else
            {
                _info.CategoryID = DateTime.Now.ToString("yyyyMMdd") + "_" + DateTime.Now.ToString("hhmmss");
            }

            return(View(_info));
        }
Beispiel #6
0
 public void insertUpdateCategory(string DataTitle, VD_Category category, ref string outputMsg, ref long outputResult)
 {
     _DB.insertUpdateCategory(DataTitle, category, ref outputMsg, ref outputResult);
 }