Beispiel #1
0
 private void SaveData()
 {
     _bannerInfo.Title = txtTitle.Text;
     _bannerInfo.Slug  = HtmlHelper.RemoveIllegalCharacters(txtTitle.Text);
     if (!String.IsNullOrEmpty(Request.Params["thumbnailSrcAvatar"]))
     {
         _bannerInfo.ImagePath = Request.Params["thumbnailSrcAvatar"];
     }
     _bannerInfo.Priority   = 1;
     _bannerInfo.Position   = Convert.ToInt32(txtPosition.Text);
     _bannerInfo.Type       = int.Parse(ddlType.SelectedValue);
     _bannerInfo.IsMobile   = false;//cbIsMobile.Checked;
     _bannerInfo.Content    = txtContent.Text;
     _bannerInfo.CategoryId = int.Parse(ddlCategory.SelectedValue);
     if (!String.IsNullOrEmpty(dteStartDate.Value))
     {
         var startDate = Convert.ToDateTime(dteStartDate.Value, new CultureInfo("vi-VN"));
         _bannerInfo.StartDate = new DateTime(startDate.Year, startDate.Month, startDate.Day, Convert.ToInt32(ddlStartHours.Value), Convert.ToInt32(ddlStartMinute.Value), 0);
     }
     if (!String.IsNullOrEmpty(dteEndDate.Value))
     {
         var endDate = Convert.ToDateTime(dteEndDate.Value, new CultureInfo("vi-VN"));
         _bannerInfo.EndDate = new DateTime(endDate.Year, endDate.Month, endDate.Day, Convert.ToInt32(ddlEndHours.Value), Convert.ToInt32(ddlEndMinute.Value), 0);
     }
     if (_bannerInfo.BannerId == 0)
     {
         _bannerController.InsertBanner(_bannerInfo);
     }
     else
     {
         _bannerController.UpdateBanner(_bannerInfo);
     }
     Response.Redirect("~/Pages/ListPrice.aspx?xml=Price");
 }
Beispiel #2
0
 private void SaveData()
 {
     _bannerInfo.Title = txtTitle.Text;
     if (!String.IsNullOrEmpty(Request.Params["thumbnailSrcAvatar"]))
     {
         _bannerInfo.ImagePath = Request.Params["thumbnailSrcAvatar"];
     }
     _bannerInfo.Priority = byte.Parse(ddlPriority.SelectedValue);
     _bannerInfo.Position = int.Parse(txtPosition.Text);
     _bannerInfo.Type     = 1;
     _bannerInfo.Url      = txtUrl.Text;
     if (!String.IsNullOrEmpty(dteStartDate.Value))
     {
         var startDate = Convert.ToDateTime(dteStartDate.Value, new CultureInfo("vi-VN"));
         _bannerInfo.StartDate = new DateTime(startDate.Year, startDate.Month, startDate.Day, Convert.ToInt32(ddlStartHours.Value), Convert.ToInt32(ddlStartMinute.Value), 0);
     }
     if (!String.IsNullOrEmpty(dteEndDate.Value))
     {
         var endDate = Convert.ToDateTime(dteEndDate.Value, new CultureInfo("vi-VN"));
         _bannerInfo.EndDate = new DateTime(endDate.Year, endDate.Month, endDate.Day, Convert.ToInt32(ddlEndHours.Value), Convert.ToInt32(ddlEndMinute.Value), 0);
     }
     if (_bannerInfo.BannerId == 0)
     {
         _bannerController.InsertBanner(_bannerInfo);
     }
     else
     {
         _bannerController.UpdateBanner(_bannerInfo);
     }
     Response.Redirect("~/Pages/ListBanner.aspx?xml=Banner");
 }