예제 #1
0
 private void DeleteByID(int BannerId)
 {
     try
     {
         string modulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory);
         BannerInfo bannerObj = new BannerInfo();
         BannerSqlProvider sqlObj = new BannerSqlProvider();
         sqlObj.CorporateBannerDeleteByBannerID(BannerId, GetPortalID, GetUsername);
         ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageFrameCorporateBanner/ModuleLocalText", "BannerDeletedSuccessfully"), "", SageMessageType.Success);
         BindBannerGrid();
         Session["EditBannerID"] = null;
     }
     catch (Exception ex)
     {
         ProcessException(ex);
     }
 }
예제 #2
0
    private void SaveImage()
    {
        try
        {
            string message = string.Empty;
            string modulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory);
            if (ddlReadMorePage.SelectedIndex != 0)
            {                
                BannerInfo bannerObj = new BannerInfo();
                BannerSqlProvider sqlObj = new BannerSqlProvider();

                //BannerController bc = new BannerController();               
                int BannerID = 0;
                if (Session["EditBannerID"] != null)
                {
                    BannerID = Int32.Parse(Session["EditBannerID"].ToString());
                    message = SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageFrameCorporateBanner/ModuleLocalText", "BannerUpdatedSuccessfully");
                }
                else
                {
                    message = SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageFrameCorporateBanner/ModuleLocalText", "BannerSavedSuccessfully");
                }

                string navigationImgPath = ResolveUrl(this.AppRelativeTemplateSourceDirectory + "uploads/NavigationImages");
                string bannerImgPath = ResolveUrl(this.AppRelativeTemplateSourceDirectory + "uploads/Banners");
                string navigationImage = ImageUpload(fluBannerNavigationImage, imgEditNavImage, navigationImgPath);
                string bannerImage = ImageUpload(fluBannerImage, imgEditBannerImage, bannerImgPath);

                if (navigationImage != "" && bannerImage != "")
                {
                    sqlObj.CorporateBannerAddUpdate(BannerID, Int32.Parse(SageUserModuleID), txtBannerTitle.Text.Trim(),
                        txtBannerDescription.Content.Trim(), txtBannerNavigationTitle.Text.Trim(), navigationImage,
                        int.Parse(txtDisplayOrder.Text.Trim()), bannerImage, txtImageToolTip.Text.Trim(),
                        txtReadButtonText.Text.Trim(), ddlReadMorePage.SelectedItem.Value, chkIsActive.Checked, DateTime.Now,
                        GetPortalID, GetUsername);
                    BindBannerGrid();
                    PanelVisibility(true, false);
                    Session["EditBannerID"] = null;
                    ClearForm();
                    ShowMessage(SageMessageTitle.Information.ToString(), message, "", SageMessageType.Success);
                }
                else if (navigationImage == "" || bannerImage == "" && Session["EditBannerID"] == null)
                {
                    message = SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageFrameCorporateBanner/ModuleLocalText", "SelectBothImage");
                    ShowMessage(SageMessageTitle.Notification.ToString(), message, "", SageMessageType.Alert);
                }
            }
            else
            {
                message = SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageFrameCorporateBanner/ModuleLocalText", "SelectThePageFirst");
                ShowMessage(SageMessageTitle.Notification.ToString(), message, "", SageMessageType.Alert);
            }
        }
        catch (Exception ex)
        {
            ProcessException(ex);
        }
    }
예제 #3
0
 private void EditByID(int BannerId)
 {
     string modulePath = ResolveUrl(this.AppRelativeTemplateSourceDirectory);
     BannerInfo bannerObj = new BannerInfo();
     BannerSqlProvider sqlObj = new BannerSqlProvider();
     bannerObj = sqlObj.GetCorporateBannerDetailsByBannerID(BannerId, GetPortalID);
     if (bannerObj != null)
     {
         txtBannerTitle.Text = bannerObj.Title;
         txtBannerDescription.Content = bannerObj.Description;
         txtBannerNavigationTitle.Text = bannerObj.NavigationTitle;
         txtImageToolTip.Text = bannerObj.ImageToolTip;
         ddlReadMorePage.SelectedIndex = ddlReadMorePage.Items.IndexOf(ddlReadMorePage.Items.FindByValue(bannerObj.ReadMorePage.ToString()));
         txtReadButtonText.Text = bannerObj.ReadButtonText;
         txtDisplayOrder.Text = bannerObj.BannerOrder.ToString();
         chkIsActive.Checked = bool.Parse(bannerObj.IsActive.ToString());
         imgEditNavImage.ImageUrl = modulePath + "uploads/NavigationImages/Small/" + bannerObj.NavigationImage;
         imgEditNavImage.Visible = true;
         imgEditBannerImage.ImageUrl = modulePath + "uploads/Banners/Small/" + bannerObj.BannerImage;
         imgEditBannerImage.Visible = true;
         Session["EditBannerID"] = BannerId;            
     }
 }