Beispiel #1
0
        /// <summary>
        /// Method to get one recoder by primary key
        /// </summary>
        public Johnny.CMS.OM.SeH.Release GetModel(int releaseid)
        {
            //Set up a return value
            Johnny.CMS.OM.SeH.Release model = null;

            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT [ReleaseId], [SoftwareId], [ReleaseName], [ReleaseDate], [Description], [Hits], [Downloads], [IsDisplay], [CreatedTime], [CreatedById], [CreatedByName], [UpdatedTime], [UpdatedById], [UpdatedByName], [Sequence] ");
            strSql.Append(" FROM [seh_release] ");
            strSql.Append(" WHERE [ReleaseId]=@releaseid");
            SqlParameter[] parameters =
            {
                new SqlParameter("@releaseid", SqlDbType.Int, 4)
            };
            parameters[0].Value = releaseid;
            using (SqlDataReader sdr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters))
            {
                if (sdr.Read())
                {
                    model = new Johnny.CMS.OM.SeH.Release(sdr.GetInt32(0), sdr.GetInt32(1), sdr.GetString(2), sdr.GetDateTime(3), sdr.GetString(4), sdr.GetInt32(5), sdr.GetInt32(6), sdr.GetBoolean(7), sdr.GetDateTime(8), sdr.GetInt32(9), sdr.GetString(10), sdr.GetDateTime(11), sdr.GetInt32(12), sdr.GetString(13), sdr.GetInt32(14));
                }
                else
                {
                    model = new Johnny.CMS.OM.SeH.Release();
                }
            }
            return(model);
        }
Beispiel #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int softwareid = Convert.ToInt32(Request.QueryString["softwareid"]);

            Johnny.CMS.BLL.SeH.Software bll   = new Johnny.CMS.BLL.SeH.Software();
            Johnny.CMS.OM.SeH.Software  model = bll.GetModel(softwareid);

            if (model != null)
            {
                lblSoftwareName.Text        = model.SoftwareName;
                lblDocumentTitle.Text       = model.DocumentTitle;
                lblDocumentDescription.Text = model.DocumentDescription;
                lblDocumentUrl.Text         = string.Format("<a href=\"{0}\">下载</a>", model.DownloadUrl);


                Johnny.CMS.BLL.SeH.Release bllRelease   = new Johnny.CMS.BLL.SeH.Release();
                Johnny.CMS.OM.SeH.Release  modelRelease = bllRelease.GetLatestModel(softwareid);

                if (modelRelease != null)
                {
                    lblReleaseName.Text        = modelRelease.ReleaseName;
                    lblReleaseDescription.Text = StringHelper.htmlOutputText(modelRelease.Description);

                    lblDownloadUrl.Text = string.Format("<a href=\"{0}\">下载</a>", model.DownloadUrl);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Method to get recoders with condition
        /// </summary>
        public IList <Johnny.CMS.OM.SeH.Release> GetList(int softwareid)
        {
            IList <Johnny.CMS.OM.SeH.Release> list = new List <Johnny.CMS.OM.SeH.Release>();

            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT [ReleaseId], [seh_release].[SoftwareId], [seh_software].[SoftwareName], [ReleaseName], [ReleaseDate], [seh_release].[Description], [seh_release].[Hits], [seh_release].[Downloads], [seh_release].[IsDisplay], [seh_release].[CreatedTime], [seh_release].[CreatedById], [seh_release].[CreatedByName], [seh_release].[UpdatedTime], [seh_release].[UpdatedById], [seh_release].[UpdatedByName], [seh_release].[Sequence] ");
            strSql.Append(" FROM [seh_release] ");
            strSql.Append(" LEFT OUTER JOIN [seh_software] ");
            strSql.Append(" ON [seh_release].[SoftwareId] = [seh_software].[SoftwareId] ");
            strSql.Append(" WHERE [seh_release].[SoftwareId]=@softwareid");
            strSql.Append(" ORDER BY [seh_release].[Sequence] DESC");
            SqlParameter[] parameters =
            {
                new SqlParameter("@softwareid", SqlDbType.Int, 4)
            };
            parameters[0].Value = softwareid;

            using (SqlDataReader sdr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters))
            {
                while (sdr.Read())
                {
                    Johnny.CMS.OM.SeH.Release item = new Johnny.CMS.OM.SeH.Release(sdr.GetInt32(0), sdr.GetInt32(1), sdr.GetString(2), sdr.GetString(3), sdr.GetDateTime(4), sdr.GetString(5), sdr.GetInt32(6), sdr.GetInt32(7), sdr.GetBoolean(8), sdr.GetDateTime(9), sdr.GetInt32(10), sdr.GetString(11), sdr.GetDateTime(12), sdr.GetInt32(13), sdr.GetString(14), sdr.GetInt32(15));
                    list.Add(item);
                }
            }
            return(list);
        }
Beispiel #4
0
        /// <summary>
        /// Method to get recoders with condition
        /// </summary>    	 
        public IList<Johnny.CMS.OM.SeH.Release> GetList(int softwareid)
        {
            IList<Johnny.CMS.OM.SeH.Release> list = new List<Johnny.CMS.OM.SeH.Release>();

            StringBuilder strSql = new StringBuilder();
            strSql.Append("SELECT [ReleaseId], [seh_release].[SoftwareId], [seh_software].[SoftwareName], [ReleaseName], [ReleaseDate], [seh_release].[Description], [seh_release].[Hits], [seh_release].[Downloads], [seh_release].[IsDisplay], [seh_release].[CreatedTime], [seh_release].[CreatedById], [seh_release].[CreatedByName], [seh_release].[UpdatedTime], [seh_release].[UpdatedById], [seh_release].[UpdatedByName], [seh_release].[Sequence] ");
            strSql.Append(" FROM [seh_release] ");
            strSql.Append(" LEFT OUTER JOIN [seh_software] ");
            strSql.Append(" ON [seh_release].[SoftwareId] = [seh_software].[SoftwareId] ");
            strSql.Append(" WHERE [seh_release].[SoftwareId]=@softwareid");           
            strSql.Append(" ORDER BY [seh_release].[Sequence] DESC");
            SqlParameter[] parameters = {
					new SqlParameter("@softwareid", SqlDbType.Int,4)};
            parameters[0].Value = softwareid;

            using (SqlDataReader sdr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters))
            {
                while (sdr.Read())
                {
                    Johnny.CMS.OM.SeH.Release item = new Johnny.CMS.OM.SeH.Release(sdr.GetInt32(0), sdr.GetInt32(1), sdr.GetString(2), sdr.GetString(3), sdr.GetDateTime(4), sdr.GetString(5), sdr.GetInt32(6), sdr.GetInt32(7), sdr.GetBoolean(8), sdr.GetDateTime(9), sdr.GetInt32(10), sdr.GetString(11), sdr.GetDateTime(12), sdr.GetInt32(13), sdr.GetString(14), sdr.GetInt32(15));
                    list.Add(item);
                }
            }
            return list;
        }
Beispiel #5
0
        /// <summary>
        /// Add one record
        /// </summary>
        public int Add(Johnny.CMS.OM.SeH.Release model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("DECLARE @Sequence int");
            strSql.Append(" SELECT @Sequence=(max(Sequence)+1) FROM [seh_release]");
            strSql.Append(" if @Sequence is NULL");
            strSql.Append(" Set @Sequence=1");
            strSql.Append("INSERT INTO [seh_release](");
            strSql.Append("[SoftwareId],[ReleaseName],[ReleaseDate],[Description],[Hits],[Downloads],[IsDisplay],[CreatedTime],[CreatedById],[CreatedByName],[UpdatedTime],[UpdatedById],[UpdatedByName],[Sequence]");
            strSql.Append(")");
            strSql.Append(" VALUES (");
            strSql.Append("@softwareid,@releasename,@releasedate,@description,@hits,@downloads,@isdisplay,@createdtime,@createdbyid,@createdbyname,@updatedtime,@updatedbyid,@updatedbyname,@sequence");
            strSql.Append(")");
            strSql.Append(";SELECT @@IDENTITY");
            SqlParameter[] parameters =
            {
                new SqlParameter("@softwareid",    SqlDbType.Int,         4),
                new SqlParameter("@releasename",   SqlDbType.VarChar,   100),
                new SqlParameter("@releasedate",   SqlDbType.DateTime),
                new SqlParameter("@description",   SqlDbType.Text),
                new SqlParameter("@hits",          SqlDbType.Int,         4),
                new SqlParameter("@downloads",     SqlDbType.Int,         4),
                new SqlParameter("@isdisplay",     SqlDbType.Bit),
                new SqlParameter("@createdtime",   SqlDbType.DateTime),
                new SqlParameter("@createdbyid",   SqlDbType.Int,         4),
                new SqlParameter("@createdbyname", SqlDbType.VarChar,    50),
                new SqlParameter("@updatedtime",   SqlDbType.DateTime),
                new SqlParameter("@updatedbyid",   SqlDbType.Int,         4),
                new SqlParameter("@updatedbyname", SqlDbType.VarChar, 50)
            };
            parameters[0].Value  = model.SoftwareId;
            parameters[1].Value  = model.ReleaseName;
            parameters[2].Value  = model.ReleaseDate;
            parameters[3].Value  = model.Description;
            parameters[4].Value  = model.Hits;
            parameters[5].Value  = model.Downloads;
            parameters[6].Value  = model.IsDisplay;
            parameters[7].Value  = model.CreatedTime;
            parameters[8].Value  = model.CreatedById;
            parameters[9].Value  = model.CreatedByName;
            parameters[10].Value = model.UpdatedTime;
            parameters[11].Value = model.UpdatedById;
            parameters[12].Value = model.UpdatedByName;

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), parameters);

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
Beispiel #6
0
        /// <summary>
        /// Update one record
        /// </summary>
        public void Update(Johnny.CMS.OM.SeH.Release model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("UPDATE [seh_release] SET ");
            strSql.Append("[SoftwareId]=@softwareid,");
            strSql.Append("[ReleaseName]=@releasename,");
            strSql.Append("[ReleaseDate]=@releasedate,");
            strSql.Append("[Description]=@description,");
            strSql.Append("[Hits]=@hits,");
            strSql.Append("[Downloads]=@downloads,");
            strSql.Append("[IsDisplay]=@isdisplay,");
            //strSql.Append("[CreatedTime]=@createdtime,");
            //strSql.Append("[CreatedById]=@createdbyid,");
            //strSql.Append("[CreatedByName]=@createdbyname,");
            strSql.Append("[UpdatedTime]=@updatedtime,");
            strSql.Append("[UpdatedById]=@updatedbyid,");
            strSql.Append("[UpdatedByName]=@updatedbyname,");
            strSql.Append(" WHERE [ReleaseId]=@releaseid ");
            SqlParameter[] parameters =
            {
                new SqlParameter("@releaseid",     SqlDbType.Int,         4),
                new SqlParameter("@softwareid",    SqlDbType.Int,         4),
                new SqlParameter("@releasename",   SqlDbType.VarChar,   100),
                new SqlParameter("@releasedate",   SqlDbType.DateTime),
                new SqlParameter("@description",   SqlDbType.Text),
                new SqlParameter("@hits",          SqlDbType.Int,         4),
                new SqlParameter("@downloads",     SqlDbType.Int,         4),
                new SqlParameter("@isdisplay",     SqlDbType.Bit),
                //new SqlParameter("@createdtime", SqlDbType.DateTime),
                //new SqlParameter("@createdbyid", SqlDbType.Int,4),
                //new SqlParameter("@createdbyname", SqlDbType.VarChar,50),
                new SqlParameter("@updatedtime",   SqlDbType.DateTime),
                new SqlParameter("@updatedbyid",   SqlDbType.Int,         4),
                new SqlParameter("@updatedbyname", SqlDbType.VarChar,    50),
            };
            parameters[0].Value = model.ReleaseId;
            parameters[1].Value = model.SoftwareId;
            parameters[2].Value = model.ReleaseName;
            parameters[3].Value = model.ReleaseDate;
            parameters[4].Value = model.Description;
            parameters[5].Value = model.Hits;
            parameters[6].Value = model.Downloads;
            parameters[7].Value = model.IsDisplay;
            //parameters[8].Value = model.CreatedTime;
            //parameters[9].Value = model.CreatedById;
            //parameters[10].Value = model.CreatedByName;
            parameters[8].Value  = model.UpdatedTime;
            parameters[9].Value  = model.UpdatedById;
            parameters[10].Value = model.UpdatedByName;

            DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);
        }
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            Johnny.CMS.OM.SeH.Release model = new Johnny.CMS.OM.SeH.Release();
            base.ManageTable = model.TableName;
            base.ManageKey = model.PrimaryKey;
            base.IsDesc = model.IsDesc;

            if (!IsPostBack)
            {
                myManageGridView.Columns[2].HeaderText = GetLabelText("Release_SoftwareId");
                myManageGridView.Columns[3].HeaderText = GetLabelText("Release_ReleaseName");
                getData();                
            }
        }
Beispiel #8
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            Johnny.CMS.OM.SeH.Release model = new Johnny.CMS.OM.SeH.Release();
            base.ManageTable = model.TableName;
            base.ManageKey   = model.PrimaryKey;
            base.IsDesc      = model.IsDesc;

            if (!IsPostBack)
            {
                myManageGridView.Columns[2].HeaderText = GetLabelText("Release_SoftwareId");
                myManageGridView.Columns[3].HeaderText = GetLabelText("Release_ReleaseName");
                getData();
            }
        }
Beispiel #9
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            //validation
            if (!CheckInputEmptyAndLength(txtReleaseName, "E00901", "E00902", false))
                return;
            if (!CheckInputEmptyAndLength(txtHits, "E00901", "E00902", false))
                return;

            Johnny.CMS.BLL.SeH.Release bll = new Johnny.CMS.BLL.SeH.Release();
            Johnny.CMS.OM.SeH.Release model = new Johnny.CMS.OM.SeH.Release();
            if (Request.QueryString["action"] == "modify")
            {
                //update
                model.ReleaseId = Convert.ToInt32(Request.QueryString["id"]);
                model.SoftwareId = DataConvert.GetInt32(ddlSoftware.SelectedValue);
                model.ReleaseName = txtReleaseName.Text;
                model.ReleaseDate = DataConvert.GetDateTime(txtReleaseDate.Text);
                model.Description = StringHelper.htmlInputText(fckContent.Value);
                model.Hits = DataConvert.GetInt32(txtHits.Text);
                model.Downloads = DataConvert.GetInt32(txtDownloads.Text);
                model.IsDisplay = rdbDisplay0.Checked;
                model.UpdatedTime = System.DateTime.Now;
                model.UpdatedById = DataConvert.GetInt32(Session["UserId"]);
                model.UpdatedByName = DataConvert.GetString(Session["UserName"]);

                bll.Update(model);
                SetMessage(GetMessage("C00003"));
            }
            else
            {
                //insert                
                model.SoftwareId = DataConvert.GetInt32(ddlSoftware.SelectedValue);
                model.ReleaseName = txtReleaseName.Text;
                model.ReleaseDate = DataConvert.GetDateTime(txtReleaseDate.Text);
                model.Description = StringHelper.htmlInputText(fckContent.Value);
                model.Hits = DataConvert.GetInt32(txtHits.Text);
                model.Downloads = DataConvert.GetInt32(txtDownloads.Text);
                model.IsDisplay = rdbDisplay0.Checked;
                model.CreatedTime = System.DateTime.Now;
                model.CreatedById = DataConvert.GetInt32(Session["UserId"]);
                model.CreatedByName = DataConvert.GetString(Session["UserName"]);
                model.UpdatedTime = System.DateTime.Now;
                model.UpdatedById = DataConvert.GetInt32(Session["UserId"]);
                model.UpdatedByName = DataConvert.GetString(Session["UserName"]);

                if (bll.Add(model) > 0)
                {
                    SetMessage(GetMessage("C00001"));
                    ddlSoftware.SelectedIndex = 0;
                    txtReleaseName.Text = "";
                    txtReleaseDate.Text = "";
                    fckContent.Value = "";
                    txtHits.Text = "0";
                    txtDownloads.Text = "0";
                    rdbDisplay0.Checked = true;
                    lblCreatedTime.Text = "";
                    lblCreatedByName.Text = "";
                    lblUpdatedTime.Text = "";
                    lblUpdatedByName.Text = "";
                }
                else
                    SetMessage(GetMessage("C00002"));
            }
        }        
Beispiel #10
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                litPageTitle.Text = GetLabelText("Release_Title");
                litSoftware.Text = GetLabelText("Release_SoftwareId");
                ddlSoftware.ToolTip = GetLabelText("Release_SoftwareId");
                litReleaseName.Text = GetLabelText("Release_ReleaseName");
                txtReleaseName.ToolTip = GetLabelText("Release_ReleaseName");
                litReleaseDate.Text = GetLabelText("Release_ReleaseDate");
                txtReleaseDate.ToolTip = GetLabelText("Release_ReleaseDate");
                litContent.Text = GetLabelText("Release_Description");
                litHits.Text = GetLabelText("Release_Hits");
                txtHits.ToolTip = GetLabelText("Release_Hits");
                litDownloads.Text = GetLabelText("Release_Downloads");
                txtDownloads.ToolTip = GetLabelText("Release_Downloads");
                litIsDisplay.Text = GetLabelText("Release_IsDisplay");
                rdbDisplay0.Text = GetLabelText("Common_Yes");
                rdbDisplay1.Text = GetLabelText("Common_No");
                litRdbDisplayTip.Text = GetLabelText("Release_IsDisplay");
                litCreatedTime.Text = GetLabelText("Common_CreatedTime");
                litCreatedByName.Text = GetLabelText("Common_CreatedByName");
                litUpdatedTime.Text = GetLabelText("Common_UpdatedTime");
                litUpdatedByName.Text = GetLabelText("Common_UpdatedByName");

                if (Request.QueryString["action"] == "modify")
                {
                    //get id
                    int ReleaseId = Convert.ToInt32(Request.QueryString["id"]);

                    Johnny.CMS.BLL.SeH.Release bll = new Johnny.CMS.BLL.SeH.Release();
                    Johnny.CMS.OM.SeH.Release model = new Johnny.CMS.OM.SeH.Release();
                    model = bll.GetModel(ReleaseId);

                    CreateddlSoftware();
                    foreach (ListItem item in ddlSoftware.Items)
                    {
                        if (DataConvert.GetInt32(item.Value) == model.SoftwareId)
                        {
                            item.Selected = true;
                            break;
                        }
                    }

                    txtReleaseName.Text = model.ReleaseName;
                    txtReleaseDate.Text = DataConvert.GetShortDateString(model.ReleaseDate);
                    fckContent.Value = StringHelper.htmlOutputText(model.Description);
                    txtHits.Text = DataConvert.GetString(model.Hits);
                    txtDownloads.Text = DataConvert.GetString(model.Downloads);
                    if (model.IsDisplay)
                        rdbDisplay0.Checked = true;
                    else
                        rdbDisplay1.Checked = true;
                    
                    lblCreatedTime.Text = DataConvert.GetLongDateString(model.CreatedTime);
                    lblCreatedByName.Text = model.CreatedByName;
                    lblUpdatedTime.Text = DataConvert.GetLongDateString(model.UpdatedTime);
                    lblUpdatedByName.Text = model.UpdatedByName;

                    btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save;
                    //btnAdd.Text = CONST_BUTTONTEXT_SAVE;
                }
                else
                {
                    CreateddlSoftware();
                    rdbDisplay0.Checked = true;
                    txtHits.Text = "0";
                    txtDownloads.Text = "0";
                }
            }
        }
Beispiel #11
0
 /// <summary>
 /// Update one record
 /// </summary>
 public void Update(Johnny.CMS.OM.SeH.Release model)
 {
     dal.Update(model);
 }
Beispiel #12
0
 /// <summary>
 /// Add one record
 /// </summary>
 public int Add(Johnny.CMS.OM.SeH.Release model)
 {
     return(dal.Add(model));
 }
Beispiel #13
0
        protected void btnAdd_Click(object sender, System.EventArgs e)
        {
            //validation
            if (!CheckInputEmptyAndLength(txtReleaseName, "E00901", "E00902", false))
            {
                return;
            }
            if (!CheckInputEmptyAndLength(txtHits, "E00901", "E00902", false))
            {
                return;
            }

            Johnny.CMS.BLL.SeH.Release bll   = new Johnny.CMS.BLL.SeH.Release();
            Johnny.CMS.OM.SeH.Release  model = new Johnny.CMS.OM.SeH.Release();
            if (Request.QueryString["action"] == "modify")
            {
                //update
                model.ReleaseId     = Convert.ToInt32(Request.QueryString["id"]);
                model.SoftwareId    = DataConvert.GetInt32(ddlSoftware.SelectedValue);
                model.ReleaseName   = txtReleaseName.Text;
                model.ReleaseDate   = DataConvert.GetDateTime(txtReleaseDate.Text);
                model.Description   = StringHelper.htmlInputText(fckContent.Value);
                model.Hits          = DataConvert.GetInt32(txtHits.Text);
                model.Downloads     = DataConvert.GetInt32(txtDownloads.Text);
                model.IsDisplay     = rdbDisplay0.Checked;
                model.UpdatedTime   = System.DateTime.Now;
                model.UpdatedById   = DataConvert.GetInt32(Session["UserId"]);
                model.UpdatedByName = DataConvert.GetString(Session["UserName"]);

                bll.Update(model);
                SetMessage(GetMessage("C00003"));
            }
            else
            {
                //insert
                model.SoftwareId    = DataConvert.GetInt32(ddlSoftware.SelectedValue);
                model.ReleaseName   = txtReleaseName.Text;
                model.ReleaseDate   = DataConvert.GetDateTime(txtReleaseDate.Text);
                model.Description   = StringHelper.htmlInputText(fckContent.Value);
                model.Hits          = DataConvert.GetInt32(txtHits.Text);
                model.Downloads     = DataConvert.GetInt32(txtDownloads.Text);
                model.IsDisplay     = rdbDisplay0.Checked;
                model.CreatedTime   = System.DateTime.Now;
                model.CreatedById   = DataConvert.GetInt32(Session["UserId"]);
                model.CreatedByName = DataConvert.GetString(Session["UserName"]);
                model.UpdatedTime   = System.DateTime.Now;
                model.UpdatedById   = DataConvert.GetInt32(Session["UserId"]);
                model.UpdatedByName = DataConvert.GetString(Session["UserName"]);

                if (bll.Add(model) > 0)
                {
                    SetMessage(GetMessage("C00001"));
                    ddlSoftware.SelectedIndex = 0;
                    txtReleaseName.Text       = "";
                    txtReleaseDate.Text       = "";
                    fckContent.Value          = "";
                    txtHits.Text          = "0";
                    txtDownloads.Text     = "0";
                    rdbDisplay0.Checked   = true;
                    lblCreatedTime.Text   = "";
                    lblCreatedByName.Text = "";
                    lblUpdatedTime.Text   = "";
                    lblUpdatedByName.Text = "";
                }
                else
                {
                    SetMessage(GetMessage("C00002"));
                }
            }
        }
Beispiel #14
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);

            if (!this.IsPostBack)
            {
                litPageTitle.Text      = GetLabelText("Release_Title");
                litSoftware.Text       = GetLabelText("Release_SoftwareId");
                ddlSoftware.ToolTip    = GetLabelText("Release_SoftwareId");
                litReleaseName.Text    = GetLabelText("Release_ReleaseName");
                txtReleaseName.ToolTip = GetLabelText("Release_ReleaseName");
                litReleaseDate.Text    = GetLabelText("Release_ReleaseDate");
                txtReleaseDate.ToolTip = GetLabelText("Release_ReleaseDate");
                litContent.Text        = GetLabelText("Release_Description");
                litHits.Text           = GetLabelText("Release_Hits");
                txtHits.ToolTip        = GetLabelText("Release_Hits");
                litDownloads.Text      = GetLabelText("Release_Downloads");
                txtDownloads.ToolTip   = GetLabelText("Release_Downloads");
                litIsDisplay.Text      = GetLabelText("Release_IsDisplay");
                rdbDisplay0.Text       = GetLabelText("Common_Yes");
                rdbDisplay1.Text       = GetLabelText("Common_No");
                litRdbDisplayTip.Text  = GetLabelText("Release_IsDisplay");
                litCreatedTime.Text    = GetLabelText("Common_CreatedTime");
                litCreatedByName.Text  = GetLabelText("Common_CreatedByName");
                litUpdatedTime.Text    = GetLabelText("Common_UpdatedTime");
                litUpdatedByName.Text  = GetLabelText("Common_UpdatedByName");

                if (Request.QueryString["action"] == "modify")
                {
                    //get id
                    int ReleaseId = Convert.ToInt32(Request.QueryString["id"]);

                    Johnny.CMS.BLL.SeH.Release bll   = new Johnny.CMS.BLL.SeH.Release();
                    Johnny.CMS.OM.SeH.Release  model = new Johnny.CMS.OM.SeH.Release();
                    model = bll.GetModel(ReleaseId);

                    CreateddlSoftware();
                    foreach (ListItem item in ddlSoftware.Items)
                    {
                        if (DataConvert.GetInt32(item.Value) == model.SoftwareId)
                        {
                            item.Selected = true;
                            break;
                        }
                    }

                    txtReleaseName.Text = model.ReleaseName;
                    txtReleaseDate.Text = DataConvert.GetShortDateString(model.ReleaseDate);
                    fckContent.Value    = StringHelper.htmlOutputText(model.Description);
                    txtHits.Text        = DataConvert.GetString(model.Hits);
                    txtDownloads.Text   = DataConvert.GetString(model.Downloads);
                    if (model.IsDisplay)
                    {
                        rdbDisplay0.Checked = true;
                    }
                    else
                    {
                        rdbDisplay1.Checked = true;
                    }

                    lblCreatedTime.Text   = DataConvert.GetLongDateString(model.CreatedTime);
                    lblCreatedByName.Text = model.CreatedByName;
                    lblUpdatedTime.Text   = DataConvert.GetLongDateString(model.UpdatedTime);
                    lblUpdatedByName.Text = model.UpdatedByName;

                    btnAdd.ButtonType = Johnny.Controls.Web.Button.Button.EnumButtonType.Save;
                    //btnAdd.Text = CONST_BUTTONTEXT_SAVE;
                }
                else
                {
                    CreateddlSoftware();
                    rdbDisplay0.Checked = true;
                    txtHits.Text        = "0";
                    txtDownloads.Text   = "0";
                }
            }
        }
Beispiel #15
0
        /// <summary>
        /// Method to get one recoder by primary key
        /// </summary>    	 
        public Johnny.CMS.OM.SeH.Release GetModel(int releaseid)
        {
            //Set up a return value
            Johnny.CMS.OM.SeH.Release model = null;

            StringBuilder strSql = new StringBuilder();
            strSql.Append("SELECT [ReleaseId], [SoftwareId], [ReleaseName], [ReleaseDate], [Description], [Hits], [Downloads], [IsDisplay], [CreatedTime], [CreatedById], [CreatedByName], [UpdatedTime], [UpdatedById], [UpdatedByName], [Sequence] ");
            strSql.Append(" FROM [seh_release] ");
            strSql.Append(" WHERE [ReleaseId]=@releaseid");
            SqlParameter[] parameters = {
					new SqlParameter("@releaseid", SqlDbType.Int,4)};
            parameters[0].Value = releaseid;
            using (SqlDataReader sdr = DbHelperSQL.ExecuteReader(strSql.ToString(), parameters))
            {
                if (sdr.Read())
                    model = new Johnny.CMS.OM.SeH.Release(sdr.GetInt32(0), sdr.GetInt32(1), sdr.GetString(2), sdr.GetDateTime(3), sdr.GetString(4), sdr.GetInt32(5), sdr.GetInt32(6), sdr.GetBoolean(7), sdr.GetDateTime(8), sdr.GetInt32(9), sdr.GetString(10), sdr.GetDateTime(11), sdr.GetInt32(12), sdr.GetString(13), sdr.GetInt32(14));
                else
                    model = new Johnny.CMS.OM.SeH.Release();
            }
            return model;
        }