示例#1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string CreateBy = string.Empty;
            if (Utils.GetCookie(PTSKeys.ADMIN_NAME, PTSKeys.CDL_CMS_KEY) != null)
            {
                CreateBy = Utils.GetCookie(PTSKeys.ADMIN_NAME, PTSKeys.CDL_CMS_KEY);
            }

            int _ErrCode = 0;
            int _RowEffects = 0;

            Model.ContentTypes model = new Model.ContentTypes();
            model = bll.GetModel(id, -1, 1, 1);

            model.Title = title.Text.Trim();
            model.TitleUrl = Utils.GenURL(title.Text.Trim());
            model.Status = Convert.ToInt32(status.SelectedValue);
            model.Lang = Convert.ToInt32(ddlLang.SelectedValue);
            bll.Update(model, ref _ErrCode, ref _RowEffects);

            if (_RowEffects > 0)
            {

                JscriptMsg(_ErrCode.ToString(), "List.aspx", "Success");
            }
            else
            {
                JscriptMsg(_ErrCode.ToString(), "", "Error");
            }
        }
示例#2
0
        private void ShowInfo(int _id)
        {
            Model.ContentTypes model = new Model.ContentTypes();

            model = bll.GetModel(_id, -1, 1, 1);

            if (null != model && model.ContentTypeID > 0)
            {
                title.Text = model.Title;
                ddlLang.SelectedValue = model.Lang.ToString();
                status.SelectedValue = model.Status.ToString();
            }
        }
示例#3
0
        public List<Model.ContentTypes> GetList(Int64 _ContentTypeID, int _Status, int _Start, int _Limit)
        {
            List<Model.ContentTypes> lModel = new List<Model.ContentTypes>();

            try
            {

                SqlParameter[] p =  {
                                        new SqlParameter("@ContentTypeID", SqlDbType.Int, 4),
                                        new SqlParameter("@Status", SqlDbType.Int, 4),
                                        new SqlParameter("@Start", SqlDbType.Int, 4),
                                        new SqlParameter("@Limit", SqlDbType.Int, 4)
                                    };

                p[0].Value = _ContentTypeID;
                p[1].Value = _Status;
                p[2].Value = _Start;
                p[3].Value = _Limit;

                DataTable dt = db.ExcuteSelectReturnDataTable("ContentType_Select", CommandType.StoredProcedure, p);

                if (dt.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt.Rows)
                    {
                        Model.ContentTypes model = new Model.ContentTypes();

                        model.Ind = Convert.ToInt32(dr["Ind"]);
                        model.ContentTypeID = Convert.ToInt32(dr["ContentTypeID"]);
                        model.Title = dr["Title"].ToString();
                        model.TitleUrl = dr["TitleUrl"].ToString();
                        model.Status = Convert.ToInt32(dr["Status"]);
                        model.StatusText = dr["StatusText"].ToString();
                        model.Lang = Convert.ToInt32(dr["Lang"]);
                        model.TotalRow = Convert.ToInt32(dr["TotalRow"]);

                        lModel.Add(model);
                    }

                }

            }
            catch (Exception ex)
            {
                PTSLog.Error(ex.Message);
            }

            return lModel;
        }