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); } } }
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; Johnny.CMS.BLL.SeH.Release bllRelease = new Johnny.CMS.BLL.SeH.Release(); IList <Johnny.CMS.OM.SeH.Release> list = bllRelease.GetList(softwareid); StringBuilder sb = new StringBuilder(); foreach (Johnny.CMS.OM.SeH.Release release in list) { sb.Append("<tr>"); sb.Append(" <td>"); sb.Append(string.Format(" <p class=\"date\">{0}</p>", DataConvert.GetShortDateString(release.ReleaseDate))); sb.Append(string.Format(" <p class=\"release\">{0}</p>", release.ReleaseName)); sb.Append(string.Format(" {0}", release.Description)); sb.Append(" </td>"); sb.Append("</tr>"); } lblReleaseList.Text = StringHelper.htmlOutputText(sb.ToString()); } }
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; Johnny.CMS.BLL.SeH.Release bllRelease = new Johnny.CMS.BLL.SeH.Release(); IList<Johnny.CMS.OM.SeH.Release> list = bllRelease.GetList(softwareid); StringBuilder sb = new StringBuilder(); foreach (Johnny.CMS.OM.SeH.Release release in list) { sb.Append("<tr>"); sb.Append(" <td>"); sb.Append(string.Format(" <p class=\"date\">{0}</p>", DataConvert.GetShortDateString(release.ReleaseDate))); sb.Append(string.Format(" <p class=\"release\">{0}</p>", release.ReleaseName)); sb.Append(string.Format(" {0}", release.Description)); sb.Append(" </td>"); sb.Append("</tr>"); } lblReleaseList.Text = StringHelper.htmlOutputText(sb.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { Johnny.CMS.BLL.SeH.Software bll = new Johnny.CMS.BLL.SeH.Software(); IList<Johnny.CMS.OM.SeH.Software> list = bll.GetList(null); StringBuilder sb = new StringBuilder(); foreach(Johnny.CMS.OM.SeH.Software software in list) { sb.Append("<div class=\"big-box\">"); sb.Append(" <div class=\"big-box-inner\" style=\"height:140\" >"); sb.Append(" <div class=\"big-box-text\">"); sb.Append(string.Format(" <h4>{0}</h4>", software.SoftwareName)); sb.Append(string.Format(" <p>{0}</p>", software.ShortDescription)); sb.Append(string.Format(" <a class=\"big-box-link\" href=\"softwaredetail.aspx?softwareid={0}\">详细信息 <img class=\"arrow\" src=\"images/arrow.png\" /></a>", software.SoftwareId)); sb.Append(string.Format(" <a class=\"big-box-link\" href=\"download.aspx?softwareid={0}\">下载 <img class=\"arrow\" src=\"images/arrow.png\" /></a>", software.SoftwareId)); sb.Append(string.Format(" <a class=\"big-box-link\" href=\"{0}\">帮助文档 <img class=\"arrow\" src=\"images/arrow.png\" /></a>", software.DownloadUrl)); sb.Append(string.Format(" <a class=\"big-box-link\" href=\"releasehistory.aspx?softwareid={0}\">发布历史 <img class=\"arrow\" src=\"images/arrow.png\" /></a>", software.SoftwareId)); sb.Append(" </div>"); sb.Append(string.Format(" <div class=\"big-box-image\"><a href=\"softwaredetail.aspx?softwareid={0}\"><img src=\"{1}\" /></a></div>", software.SoftwareId, software.Image)); sb.Append(" </div>"); sb.Append("</div>"); } //lblWebsites.Text = StringHelper.ConvertToHtmlTags(sb.ToString()); lblWebsites.Text = sb.ToString(); }
protected void Page_Load(object sender, EventArgs e) { Johnny.CMS.BLL.SeH.Software bll = new Johnny.CMS.BLL.SeH.Software(); IList <Johnny.CMS.OM.SeH.Software> list = bll.GetList(null); StringBuilder sb = new StringBuilder(); foreach (Johnny.CMS.OM.SeH.Software software in list) { sb.Append("<div class=\"big-box\">"); sb.Append(" <div class=\"big-box-inner\" style=\"height:140\" >"); sb.Append(" <div class=\"big-box-text\">"); sb.Append(string.Format(" <h4>{0}</h4>", software.SoftwareName)); sb.Append(string.Format(" <p>{0}</p>", software.ShortDescription)); sb.Append(string.Format(" <a class=\"big-box-link\" href=\"softwaredetail.aspx?softwareid={0}\">详细信息 <img class=\"arrow\" src=\"images/arrow.png\" /></a>", software.SoftwareId)); sb.Append(string.Format(" <a class=\"big-box-link\" href=\"download.aspx?softwareid={0}\">下载 <img class=\"arrow\" src=\"images/arrow.png\" /></a>", software.SoftwareId)); sb.Append(string.Format(" <a class=\"big-box-link\" href=\"{0}\">帮助文档 <img class=\"arrow\" src=\"images/arrow.png\" /></a>", software.DownloadUrl)); sb.Append(string.Format(" <a class=\"big-box-link\" href=\"releasehistory.aspx?softwareid={0}\">发布历史 <img class=\"arrow\" src=\"images/arrow.png\" /></a>", software.SoftwareId)); sb.Append(" </div>"); sb.Append(string.Format(" <div class=\"big-box-image\"><a href=\"softwaredetail.aspx?softwareid={0}\"><img src=\"{1}\" /></a></div>", software.SoftwareId, software.Image)); sb.Append(" </div>"); sb.Append("</div>"); } //lblWebsites.Text = StringHelper.ConvertToHtmlTags(sb.ToString()); lblWebsites.Text = sb.ToString(); }
private void CreateddlSoftware() { Johnny.CMS.BLL.SeH.Software bll = new Johnny.CMS.BLL.SeH.Software(); ddlSoftware.DataSource = bll.GetList(null); ddlSoftware.DataTextField = "SoftwareName"; ddlSoftware.DataValueField = "SoftwareId"; ddlSoftware.DataBind(); }
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; lblUpdateTime.Text = DataConvert.GetString(model.UpdatedTime); lblDescription.Text = model.Description; } }
protected void btnDelete_Click(object sender, EventArgs e) { foreach (GridViewRow row in myManageGridView.Rows) { TableCell cell = row.Cells[0]; Johnny.Controls.Web.CheckBox.CheckBox chkSelect = (Johnny.Controls.Web.CheckBox.CheckBox)cell.FindControl("chkSelect"); if (chkSelect.Checked) { string strId = ((Label)row.FindControl(STR_LABEL_ID)).Text; //delete Johnny.CMS.BLL.SeH.Software bll = new Johnny.CMS.BLL.SeH.Software(); bll.Delete(DataConvert.GetInt32(strId)); } } SetMessage(GetMessage("C00005")); //update grid getData(); }
public override void getData() { Johnny.CMS.BLL.SeH.Software bll = new Johnny.CMS.BLL.SeH.Software(); myManageGridView.DataSource = bll.GetList(null); myManageGridView.DataBind(); }
protected override void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!this.IsPostBack) { litPageTitle.Text = GetLabelText("Software_Title"); litSoftwareName.Text = GetLabelText("Software_SoftwareName"); txtSoftwareName.ToolTip = GetLabelText("Software_SoftwareName"); litShortDescription.Text = GetLabelText("Software_ShortDescription"); txtShortDescription.ToolTip = GetLabelText("Software_ShortDescription"); litContent.Text = GetLabelText("Software_Description"); litImage.Text = GetLabelText("Software_Image"); txtImage.ToolTip = GetLabelText("Software_Image"); litFeature1.Text = GetLabelText("Software_Feature1"); txtFeature1.ToolTip = GetLabelText("Software_Feature1"); litFeature2.Text = GetLabelText("Software_Feature2"); txtFeature2.ToolTip = GetLabelText("Software_Feature2"); litFeature3.Text = GetLabelText("Software_Feature3"); txtFeature3.ToolTip = GetLabelText("Software_Feature3"); litFeature4.Text = GetLabelText("Software_Feature4"); txtFeature4.ToolTip = GetLabelText("Software_Feature4"); litDownloadUrl.Text = GetLabelText("Software_DownloadUrl"); txtDownloadUrl.ToolTip = GetLabelText("Software_DownloadUrl"); litDocumentTitle.Text = GetLabelText("Software_DocumentTitle"); txtDocumentTitle.ToolTip = GetLabelText("Software_DocumentTitle"); litDocumentDescription.Text = GetLabelText("Software_DocumentDescription"); txtDocumentDescription.ToolTip = GetLabelText("Software_DocumentDescription"); litDocumentUrl.Text = GetLabelText("Software_DocumentUrl"); txtDocumentUrl.ToolTip = GetLabelText("Software_DocumentUrl"); litHits.Text = GetLabelText("Software_Hits"); txtHits.ToolTip = GetLabelText("Software_Hits"); litDownloads.Text = GetLabelText("Software_Downloads"); txtDownloads.ToolTip = GetLabelText("Software_Downloads"); litIsDisplay.Text = GetLabelText("Software_IsDisplay"); rdbDisplay0.Text = GetLabelText("Common_Yes"); rdbDisplay1.Text = GetLabelText("Common_No"); litRdbDisplayTip.Text = GetLabelText("Software_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 SoftwareId = Convert.ToInt32(Request.QueryString["id"]); Johnny.CMS.BLL.SeH.Software bll = new Johnny.CMS.BLL.SeH.Software(); Johnny.CMS.OM.SeH.Software model = new Johnny.CMS.OM.SeH.Software(); model = bll.GetModel(SoftwareId); txtSoftwareName.Text = model.SoftwareName; txtShortDescription.Text = model.ShortDescription; fckContent.Value = StringHelper.htmlOutputText(model.Description); txtImage.Text = model.Image; txtFeature1.Text = model.Feature1; txtFeature2.Text = model.Feature2; txtFeature3.Text = model.Feature3; txtFeature4.Text = model.Feature4; txtDownloadUrl.Text = model.DownloadUrl; txtDocumentTitle.Text = model.DocumentTitle; txtDocumentDescription.Text = model.DocumentDescription; txtDocumentUrl.Text = model.DocumentUrl; 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 { rdbDisplay0.Checked = true; txtHits.Text = "0"; txtDownloads.Text = "0"; } } }
protected void btnAdd_Click(object sender, System.EventArgs e) { //validation if (!CheckInputEmptyAndLength(txtSoftwareName, "E00901", "E00902", false)) { return; } if (!CheckInputEmptyAndLength(txtHits, "E00901", "E00902", false)) { return; } Johnny.CMS.BLL.SeH.Software bll = new Johnny.CMS.BLL.SeH.Software(); Johnny.CMS.OM.SeH.Software model = new Johnny.CMS.OM.SeH.Software(); if (Request.QueryString["action"] == "modify") { //update model.SoftwareId = Convert.ToInt32(Request.QueryString["id"]); model.SoftwareName = txtSoftwareName.Text; model.ShortDescription = txtShortDescription.Text; model.Description = StringHelper.htmlInputText(fckContent.Value); model.Image = txtImage.Text; model.Feature1 = txtFeature1.Text; model.Feature2 = txtFeature2.Text; model.Feature3 = txtFeature3.Text; model.Feature4 = txtFeature4.Text; model.DownloadUrl = txtDownloadUrl.Text; model.DocumentTitle = txtDocumentTitle.Text; model.DocumentDescription = txtDocumentDescription.Text; model.DocumentUrl = txtDocumentUrl.Text; 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.SoftwareName = txtSoftwareName.Text; model.ShortDescription = txtShortDescription.Text; model.Description = StringHelper.htmlInputText(fckContent.Value); model.Image = txtImage.Text; model.Feature1 = txtFeature1.Text; model.Feature2 = txtFeature2.Text; model.Feature3 = txtFeature3.Text; model.Feature4 = txtFeature4.Text; model.DownloadUrl = txtDownloadUrl.Text; model.DocumentTitle = txtDocumentTitle.Text; model.DocumentDescription = txtDocumentDescription.Text; model.DocumentUrl = txtDocumentUrl.Text; 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")); txtSoftwareName.Text = ""; txtShortDescription.Text = ""; fckContent.Value = ""; txtImage.Text = ""; txtFeature1.Text = ""; txtFeature2.Text = ""; txtFeature3.Text = ""; txtFeature4.Text = ""; txtDownloadUrl.Text = ""; txtDocumentTitle.Text = ""; txtDocumentDescription.Text = ""; txtDocumentUrl.Text = ""; txtHits.Text = "0"; txtDownloads.Text = "0"; rdbDisplay0.Checked = true; lblCreatedTime.Text = ""; lblCreatedByName.Text = ""; lblUpdatedTime.Text = ""; lblUpdatedByName.Text = ""; } else { SetMessage(GetMessage("C00002")); } } }
protected void Page_Load(object sender, EventArgs e) { //blog Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); IList<Johnny.CMS.OM.SeH.Blog> list = bll.GetList(); StringBuilder sb = new StringBuilder(); foreach (Johnny.CMS.OM.SeH.Blog blog in list) { sb.Append(string.Format("<li><a href=\"blogdetail.aspx?blogid={0}\">{1}({2})</a></li>", blog.BlogId, blog.Title, DataConvert.GetShortDateString(blog.UpdatedTime))); } lblBlogList.Text = sb.ToString(); //website sb.Length = 0; Johnny.CMS.BLL.SeH.Website bllWebsite = new Johnny.CMS.BLL.SeH.Website(); IList<Johnny.CMS.OM.SeH.Website> listWebsite = bllWebsite.GetList(35); int ix = 0; for (ix = 0; ix < listWebsite.Count; ix++) { if (ix % 12 == 0) sb.Append("<ul>"); sb.Append(string.Format("<li><a href=\"{0}\" target=\"_blank\" title=\"{1}\">{2}</a></li>", listWebsite[ix].URL, listWebsite[ix].Description, listWebsite[ix].WebsiteName)); if (ix == listWebsite.Count - 1) sb.Append("<li><b><a href=\"websites.aspx\">更多 <img class=\"arrowimage\" src=\"images/arrow.png\" /></a></b></li>"); if (ix != 0 && (ix == listWebsite.Count - 1 || ix % 11 == 0)) sb.Append("</ul>"); } lblWebsites.Text = sb.ToString(); //software sb.Length = 0; Johnny.CMS.BLL.SeH.Software bllSoftware = new Johnny.CMS.BLL.SeH.Software(); IList<Johnny.CMS.OM.SeH.Software> listSoftware = bllSoftware.GetList(2); for (ix = 0; ix < listSoftware.Count; ix++) { sb.Append("<div class=\"home-block-inner\">"); sb.Append(string.Format(" <a href=\"softwaredetail.aspx?softwareid={0}\"><img class=\"shot\" src=\"{1}\" /></a>", listSoftware[ix].SoftwareId, listSoftware[ix].Image)); sb.Append(string.Format(" <h3><a href=\"softwaredetail.aspx?softwareid={0}\">{1}</a><span style=\"padding-left:10px\"><img style=\"position:relative;top:-7px;left:4px\" src=\"images/new.gif\"></span></h3>", listSoftware[ix].SoftwareId, listSoftware[ix].SoftwareName)); sb.Append(string.Format(" <p style=\"margin:0 0 8px 0\">{0}</p>", listSoftware[ix].ShortDescription)); sb.Append(" <ul>"); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature1)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature2)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature3)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature4)); sb.Append(" </ul>"); sb.Append(string.Format(" <a href=\"softwaredetail.aspx?softwareid={0}\"><img class=\"learn-more\" src=\"images/learn-more.png\" /></a>", listSoftware[ix].SoftwareId)); sb.Append(" <div style=\"clear:both\"></div>"); sb.Append("</div>"); if (ix == 0) { lblSoftware1.Text = sb.ToString(); sb.Length = 0; } else lblSoftware2.Text = sb.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { //blog Johnny.CMS.BLL.SeH.Blog bll = new Johnny.CMS.BLL.SeH.Blog(); IList <Johnny.CMS.OM.SeH.Blog> list = bll.GetList(); StringBuilder sb = new StringBuilder(); foreach (Johnny.CMS.OM.SeH.Blog blog in list) { sb.Append(string.Format("<li><a href=\"blogdetail.aspx?blogid={0}\">{1}({2})</a></li>", blog.BlogId, blog.Title, DataConvert.GetShortDateString(blog.UpdatedTime))); } lblBlogList.Text = sb.ToString(); //website sb.Length = 0; Johnny.CMS.BLL.SeH.Website bllWebsite = new Johnny.CMS.BLL.SeH.Website(); IList <Johnny.CMS.OM.SeH.Website> listWebsite = bllWebsite.GetList(35); int ix = 0; for (ix = 0; ix < listWebsite.Count; ix++) { if (ix % 12 == 0) { sb.Append("<ul>"); } sb.Append(string.Format("<li><a href=\"{0}\" target=\"_blank\" title=\"{1}\">{2}</a></li>", listWebsite[ix].URL, listWebsite[ix].Description, listWebsite[ix].WebsiteName)); if (ix == listWebsite.Count - 1) { sb.Append("<li><b><a href=\"websites.aspx\">更多 <img class=\"arrowimage\" src=\"images/arrow.png\" /></a></b></li>"); } if (ix != 0 && (ix == listWebsite.Count - 1 || ix % 11 == 0)) { sb.Append("</ul>"); } } lblWebsites.Text = sb.ToString(); //software sb.Length = 0; Johnny.CMS.BLL.SeH.Software bllSoftware = new Johnny.CMS.BLL.SeH.Software(); IList <Johnny.CMS.OM.SeH.Software> listSoftware = bllSoftware.GetList(2); for (ix = 0; ix < listSoftware.Count; ix++) { sb.Append("<div class=\"home-block-inner\">"); sb.Append(string.Format(" <a href=\"softwaredetail.aspx?softwareid={0}\"><img class=\"shot\" src=\"{1}\" /></a>", listSoftware[ix].SoftwareId, listSoftware[ix].Image)); sb.Append(string.Format(" <h3><a href=\"softwaredetail.aspx?softwareid={0}\">{1}</a><span style=\"padding-left:10px\"><img style=\"position:relative;top:-7px;left:4px\" src=\"images/new.gif\"></span></h3>", listSoftware[ix].SoftwareId, listSoftware[ix].SoftwareName)); sb.Append(string.Format(" <p style=\"margin:0 0 8px 0\">{0}</p>", listSoftware[ix].ShortDescription)); sb.Append(" <ul>"); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature1)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature2)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature3)); sb.Append(string.Format(" <li><span>{0}</span></li>", listSoftware[ix].Feature4)); sb.Append(" </ul>"); sb.Append(string.Format(" <a href=\"softwaredetail.aspx?softwareid={0}\"><img class=\"learn-more\" src=\"images/learn-more.png\" /></a>", listSoftware[ix].SoftwareId)); sb.Append(" <div style=\"clear:both\"></div>"); sb.Append("</div>"); if (ix == 0) { lblSoftware1.Text = sb.ToString(); sb.Length = 0; } else { lblSoftware2.Text = sb.ToString(); } } }
protected override void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!this.IsPostBack) { litPageTitle.Text = GetLabelText("Software_Title"); litSoftwareName.Text = GetLabelText("Software_SoftwareName"); txtSoftwareName.ToolTip = GetLabelText("Software_SoftwareName"); litShortDescription.Text = GetLabelText("Software_ShortDescription"); txtShortDescription.ToolTip = GetLabelText("Software_ShortDescription"); litContent.Text = GetLabelText("Software_Description"); litImage.Text = GetLabelText("Software_Image"); txtImage.ToolTip = GetLabelText("Software_Image"); litFeature1.Text = GetLabelText("Software_Feature1"); txtFeature1.ToolTip = GetLabelText("Software_Feature1"); litFeature2.Text = GetLabelText("Software_Feature2"); txtFeature2.ToolTip = GetLabelText("Software_Feature2"); litFeature3.Text = GetLabelText("Software_Feature3"); txtFeature3.ToolTip = GetLabelText("Software_Feature3"); litFeature4.Text = GetLabelText("Software_Feature4"); txtFeature4.ToolTip = GetLabelText("Software_Feature4"); litDownloadUrl.Text = GetLabelText("Software_DownloadUrl"); txtDownloadUrl.ToolTip = GetLabelText("Software_DownloadUrl"); litDocumentTitle.Text = GetLabelText("Software_DocumentTitle"); txtDocumentTitle.ToolTip = GetLabelText("Software_DocumentTitle"); litDocumentDescription.Text = GetLabelText("Software_DocumentDescription"); txtDocumentDescription.ToolTip = GetLabelText("Software_DocumentDescription"); litDocumentUrl.Text = GetLabelText("Software_DocumentUrl"); txtDocumentUrl.ToolTip = GetLabelText("Software_DocumentUrl"); litHits.Text = GetLabelText("Software_Hits"); txtHits.ToolTip = GetLabelText("Software_Hits"); litDownloads.Text = GetLabelText("Software_Downloads"); txtDownloads.ToolTip = GetLabelText("Software_Downloads"); litIsDisplay.Text = GetLabelText("Software_IsDisplay"); rdbDisplay0.Text = GetLabelText("Common_Yes"); rdbDisplay1.Text = GetLabelText("Common_No"); litRdbDisplayTip.Text = GetLabelText("Software_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 SoftwareId = Convert.ToInt32(Request.QueryString["id"]); Johnny.CMS.BLL.SeH.Software bll = new Johnny.CMS.BLL.SeH.Software(); Johnny.CMS.OM.SeH.Software model = new Johnny.CMS.OM.SeH.Software(); model = bll.GetModel(SoftwareId); txtSoftwareName.Text = model.SoftwareName; txtShortDescription.Text = model.ShortDescription; fckContent.Value = StringHelper.htmlOutputText(model.Description); txtImage.Text = model.Image; txtFeature1.Text = model.Feature1; txtFeature2.Text = model.Feature2; txtFeature3.Text = model.Feature3; txtFeature4.Text = model.Feature4; txtDownloadUrl.Text = model.DownloadUrl; txtDocumentTitle.Text = model.DocumentTitle; txtDocumentDescription.Text = model.DocumentDescription; txtDocumentUrl.Text = model.DocumentUrl; 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 { rdbDisplay0.Checked = true; txtHits.Text = "0"; txtDownloads.Text = "0"; } } }
protected void btnAdd_Click(object sender, System.EventArgs e) { //validation if (!CheckInputEmptyAndLength(txtSoftwareName, "E00901", "E00902", false)) return; if (!CheckInputEmptyAndLength(txtHits, "E00901", "E00902", false)) return; Johnny.CMS.BLL.SeH.Software bll = new Johnny.CMS.BLL.SeH.Software(); Johnny.CMS.OM.SeH.Software model = new Johnny.CMS.OM.SeH.Software(); if (Request.QueryString["action"] == "modify") { //update model.SoftwareId = Convert.ToInt32(Request.QueryString["id"]); model.SoftwareName = txtSoftwareName.Text; model.ShortDescription = txtShortDescription.Text; model.Description = StringHelper.htmlInputText(fckContent.Value); model.Image = txtImage.Text; model.Feature1 = txtFeature1.Text; model.Feature2 = txtFeature2.Text; model.Feature3 = txtFeature3.Text; model.Feature4 = txtFeature4.Text; model.DownloadUrl = txtDownloadUrl.Text; model.DocumentTitle = txtDocumentTitle.Text; model.DocumentDescription = txtDocumentDescription.Text; model.DocumentUrl = txtDocumentUrl.Text; 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.SoftwareName = txtSoftwareName.Text; model.ShortDescription = txtShortDescription.Text; model.Description = StringHelper.htmlInputText(fckContent.Value); model.Image = txtImage.Text; model.Feature1 = txtFeature1.Text; model.Feature2 = txtFeature2.Text; model.Feature3 = txtFeature3.Text; model.Feature4 = txtFeature4.Text; model.DownloadUrl = txtDownloadUrl.Text; model.DocumentTitle = txtDocumentTitle.Text; model.DocumentDescription = txtDocumentDescription.Text; model.DocumentUrl = txtDocumentUrl.Text; 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")); txtSoftwareName.Text = ""; txtShortDescription.Text = ""; fckContent.Value = ""; txtImage.Text = ""; txtFeature1.Text = ""; txtFeature2.Text = ""; txtFeature3.Text = ""; txtFeature4.Text = ""; txtDownloadUrl.Text = ""; txtDocumentTitle.Text = ""; txtDocumentDescription.Text = ""; txtDocumentUrl.Text = ""; txtHits.Text = "0"; txtDownloads.Text = "0"; rdbDisplay0.Checked = true; lblCreatedTime.Text = ""; lblCreatedByName.Text = ""; lblUpdatedTime.Text = ""; lblUpdatedByName.Text = ""; } else SetMessage(GetMessage("C00002")); } }