private void AddUpdateBanner() { ImageFlowController objCon = new ImageFlowController(); ImageFlowInfo objInfo = new ImageFlowInfo(); objInfo.BannerID = Int32.Parse(hdnBannerID.Value); objInfo.Title = txtTitle.Text; objInfo.Description = txtDescription.Text; objInfo.IsActive = chkIsactiveContent.Checked; objInfo.UserModuleID = userModuleID; objInfo.CultureCode = GetCurrentCultureName; objInfo.PortalID = GetPortalID; objInfo.AddedBy = GetUsername; objInfo.ImageName = hdnImageName.Text; if (fileBannerImage.HasFile) { objInfo.ImageName = SaveImage(); } objCon.AddUpdateImages(objInfo); if (objInfo.BannerID > 0) { ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageImageFlow/ModuleLocalText", "ContentUpdatedSuccessfully"), "", SageMessageType.Success); } else { ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageImageFlow/ModuleLocalText", "ContentSavedsuccesfully"), "", SageMessageType.Success); } ClearAll(); divGridContents.Visible = true; divBannerFrom.Visible = false; }
private void GetAllImages() { ImageFlowController ObjCon = new ImageFlowController(); List <ImageFlowInfo> ObjLst = ObjCon.GetAllImages(UserModuleID, GetPortalID, GetCurrentCultureName); if (ObjLst.Count > 0) { const string ImagePath = "/Modules/SageImageFlow/images/Thumbnail/large/"; StringBuilder sb = new StringBuilder(); sb.Append("<ul class='flip-items'>"); foreach (ImageFlowInfo objInfo in ObjLst) { if (objInfo.IsActive) { sb.Append("<li><div class='captionWrap'><h3>"); sb.Append(objInfo.Title); sb.Append("</h3>"); sb.Append("<span>"); sb.Append(objInfo.Description); sb.Append("</span></div>"); sb.Append("<img src='"); sb.Append(ImagePath); sb.Append(objInfo.ImageName); sb.Append("'/> </li>"); } } sb.Append("</ul>"); ltrlFlipItems.Text = sb.ToString(); } }
private void BindContentGrid() { ImageFlowController objCon = new ImageFlowController(); List <ImageFlowInfo> listInfo = objCon.GetAllImages(userModuleID, GetPortalID, GetCurrentCultureName); dhnTotalItem.Value = listInfo.Count.ToString(); gdvContents.DataSource = listInfo; gdvContents.DataBind(); }
private void GetSettingAndBind() { ImageFlowController ObjCon = new ImageFlowController(); ImageFlowSettingInfo objInfo = ObjCon.GetSetting(UserModuleID, GetPortalID); if (objInfo != null) { ddlStyle.SelectedValue = objInfo.Style; txtSpacing.Text = objInfo.Spacing; chkArrow.Checked = objInfo.Arrow; chkAutoPlay.Checked = objInfo.AutoPlay; chkLooping.Checked = objInfo.Looping; chkClickable.Checked = objInfo.Clickable; chkScrollwheel.Checked = objInfo.ScrollWheel; } }
private void GetSetting() { ImageFlowController ObjCon = new ImageFlowController(); ImageFlowSettingInfo objInfo = ObjCon.GetSetting(UserModuleID, GetPortalID); if (objInfo != null) { Style = objInfo.Style; Spacing = objInfo.Spacing; Arrow = objInfo.Arrow; AutoPlay = objInfo.AutoPlay; Looping = objInfo.Looping; Clickable = objInfo.Clickable; ScrollWheel = objInfo.ScrollWheel; } }
private void EditContent(int ID) { ImageFlowController objCon = new ImageFlowController(); ImageFlowInfo objInfo = objCon.GetImagesByID(ID); divBannerFrom.Visible = true; divGridContents.Visible = false; btnSaveContent.Text = "Update"; hdnBannerID.Value = objInfo.BannerID.ToString(); txtTitle.Text = objInfo.Title; txtDescription.Text = objInfo.Description; chkIsactiveContent.Checked = objInfo.IsActive; if (objInfo.ImageName != string.Empty) { hdnImageName.Text = objInfo.ImageName; imgPreview.ImageUrl = "~/Modules/SageImageFlow/images/Thumbnail/small/" + objInfo.ImageName; } }
private void AddUpdateSetting() { ImageFlowSettingInfo objInfo = new ImageFlowSettingInfo(); objInfo.Style = ddlStyle.SelectedValue; objInfo.Spacing = txtSpacing.Text.Trim(); objInfo.Arrow = chkArrow.Checked; objInfo.AutoPlay = chkAutoPlay.Checked; objInfo.Looping = chkLooping.Checked; objInfo.Clickable = chkClickable.Checked; objInfo.ScrollWheel = chkScrollwheel.Checked; objInfo.UserModuleID = UserModuleID; objInfo.PortalID = GetPortalID; ImageFlowController ObjCon = new ImageFlowController(); ObjCon.AddUpdateSetting(objInfo); ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageImageFlow/ModuleLocalText", "SettingUpdatedSuccessfully"), "", SageMessageType.Success); }
protected void gdvContents_RowCommand(object sender, GridViewCommandEventArgs e) { int ContentID = Int32.Parse(e.CommandArgument.ToString()); switch (e.CommandName) { case "ContentEdit": { EditContent(ContentID); break; } case "ContentDelete": { DeleteContent(ContentID); ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageImageFlow/ModuleLocalText", "ContentDeletedSucessfully"), "", SageMessageType.Success); BindContentGrid(); break; } case "SortUp": { ImageFlowController objCon = new ImageFlowController(); objCon.ChangeDisplayOrder(ContentID, true); BindContentGrid(); ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageImageFlow/ModuleLocalText", "DisplayOrderChanged"), "", SageMessageType.Success); break; } case "SortDown": { ImageFlowController objCon = new ImageFlowController(); objCon.ChangeDisplayOrder(ContentID, false); BindContentGrid(); ShowMessage(SageMessageTitle.Information.ToString(), SageMessage.GetSageModuleLocalMessageByVertualPath("Modules/SageImageFlow/ModuleLocalText", "DisplayOrderChanged"), "", SageMessageType.Success); break; } } }
private void DeleteContent(int ID) { ImageFlowController objCon = new ImageFlowController(); objCon.DeleteImagesByID(ID); }