http://www.asp.net/web-pages/tutorials/files,-images,-and-media/9-working-with-images
Sr. Software Engineer
Wednesday, July 9, 2014
ASP.Net MVC Image
http://www.asp.net/web-pages/tutorials/files,-images,-and-media/9-working-with-images
Sunday, July 6, 2014
ASP.Net Grid
Grid with inner grid(collapsible show hide) and file
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Census.master" AutoEventWireup="true"
Inherits="Users_PlanDocument" CodeBehind="PlanDocument.aspx.cs" %>
<%@ Import Namespace="JulyUtilities" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentTitle" runat="Server">
Plan Document
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">
<script src="../ClientScript/OnlineDocument.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="Server">
<div style="border: solid 0px red; padding: 10px 10px 10px 10px;">
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="background-color: #fff;
border-bottom: solid 0px #cbcaca;">
<tr>
<td class="TableContainerMiddle">
<div style="width: 20px; float: left; padding-left: 5px;">
<img src="../App_Themes/<%=Session["CurrentTheme"] %>/Images/Icon/title_icon.png"
alt="" />
</div>
<div class="Title_CSS" style="padding-left: 30px;">
Plan Document Files
</div>
</td>
</tr>
<tr>
<td colspan="0" class="containerBorderLR">
<%-- <asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>--%>
<div style="padding: 10px 10px 10px 10px;">
<asp:GridView ID="gvPlanDocumentsInfo" Width="100%" GridLines="None" runat="server"
AutoGenerateColumns="False" CssClass="mGridDataRequest" AlternatingRowStyle-CssClass="alt"
AllowPaging="True" DataKeyNames="PlanDocId" PageSize="10" EmptyDataText="Record Not Available"
OnPageIndexChanging="gvPlanDocuments_PageIndexChanging" OnRowDataBound="gvPlanDocumentsInfo_RowDataBound"
PagerStyle-CssClass="gridViewPager">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<a href="javascript:switchViews('div<%# Eval("PlanDocId") %>', 'one');">
<img id="imgdiv<%# Eval("PlanDocId") %>" alt="Click to show/hide orders" border="0"
src="../App_Themes/<%=Session["CurrentTheme"] %>/Images/Icon/minus-2.png" />
</a>
</ItemTemplate>
<HeaderStyle Width="4%" />
<ItemStyle Width="4%" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Project Type">
<ItemTemplate>
<a href="javascript:switchViews('div<%# Eval("PlanDocId") %>', 'one');"><span id="imgdiv<%# Eval("PlanDocId") %>">
<%# Eval("ProjectType")%></span> </a>
<asp:Image ID="Image1" ImageUrl="~/Images/new.gif" runat="server" Visible='<%# Eval("HasNewFile") %>' />
</ItemTemplate>
<HeaderStyle Width="20%" />
<ItemStyle Width="20%" />
</asp:TemplateField>
<asp:BoundField DataField="SubType" HeaderText="Sub Type">
<HeaderStyle Width="18%" />
<ItemStyle Width="18%" />
</asp:BoundField>
<asp:BoundField DataField="ProjectDesc" HeaderText="Project Description" />
<asp:BoundField DataField="DateEffective" HeaderText="Effective Date" DataFormatString="{0:MM/dd/yyyy}">
<HeaderStyle Width="14%" />
<ItemStyle Width="14%" />
</asp:BoundField>
<asp:TemplateField>
<ItemTemplate>
<tr>
<td colspan="100%" style="border: solid 0px red;">
<div id="div<%# Eval("PlanDocId") %>" style="display: none; position: relative; left: 12px;">
<asp:GridView ID="gvPlanDocumentsFileInfo" Width="100%" GridLines="None" runat="server"
AutoGenerateColumns="False" CssClass="mGridDataRequest" AlternatingRowStyle-CssClass="alt"
EmptyDataText="Record Not Available">
<Columns>
<asp:TemplateField HeaderText="File Name">
<ItemTemplate>
<div style="width: 100%; border: solid 0px blue;">
<div style="width: 5%; height: 10px; float: left; border: solid 0px red;">
<img src='<%# clsStyle.GetIconSrcByExtension(System.IO.Path.GetExtension(Eval("FilePath").ToString())) %>'
alt="" />
</div>
<div style="border: solid 0px red; float: left; width: 95%">
<%-- <asp:HyperLink ID="lnkFileName" runat="server" NavigateUrl='<%# WebApp.GetClientPortalFilesUrl(Eval("FilePath").ToString()) %>'
Target="_blank" Text='<%# Eval("FileName").ToString().Replace("_", "-") %>'></asp:HyperLink>--%>
<asp:LinkButton ID="lnkFileName" runat="server" Text='<%# Eval("FileName").ToString().Replace("_", "-") %>'
CommandName='<%# Eval("FilePathID") %>' CommandArgument='<%# Eval("FilePath") %>'
OnClick="lnkFileName_Click" />
<%--<img id="img" src='<%# clsStyle.GetIconSrcByDate(Eval("DateUpload").ToString()) %>'
alt="" />--%>
<asp:Image ID="Image1" ImageUrl="~/Images/new.gif" runat="server" Visible='<%# Eval("HasNewFile") %>' />
</div>
</div>
</ItemTemplate>
<HeaderStyle Width="45%" />
<ItemStyle Width="45%" />
</asp:TemplateField>
<asp:BoundField DataField="FileDescription" HeaderText="File Description">
<HeaderStyle Width="30%" />
<ItemStyle Width="30%" />
</asp:BoundField>
<asp:BoundField DataField="FileCategory" HeaderText="File Category">
<HeaderStyle Width="25%" />
<ItemStyle Width="25%" />
</asp:BoundField>
</Columns>
<AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
<PagerStyle CssClass="pgr" />
</asp:GridView>
</div>
</td>
</tr>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
<%-- </ContentTemplate>
</asp:UpdatePanel>--%>
<div style="padding-left: 102px; padding-bottom: 10px;">
</div>
<div style="padding: 10px 0 5px 0px;">
</div>
</td>
</tr>
<tr>
<td colspan="0" class="containerBottom" style="border-right: solid 0px red;">
</td>
</tr>
</table>
<script type="text/javascript">
$(document).ready(function () {
$('img[src=""]').css('display', 'none');
});
</script>
</div>
</asp:Content>
***************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using July.BusinessServiceLayer.Facades;
using July.BusinessServiceLayer.Entities;
using July.BusinessServiceLayer.Helpers;
using JulyUtilities;
public partial class Users_PlanDocument : BasePage
{
List<PlanDocument> planDocuments = new List<PlanDocument>();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindPlanDocument();
}
}
private void BindPlanDocument()
{
PlanDocumentService _planDocumentsService = new PlanDocumentService();
planDocuments = _planDocumentsService.GetAllPlanDocuments(Convert.ToInt32(Page.CurrentWebUser().CurrentPlan.PlanID));
var comparer = new EqualityComparerUtil<PlanDocument>((arg1, arg2) => { return arg1.PlanDocId.EqualsIgnoreCase(arg2.PlanDocId); },
(arg) => arg.PlanDocId.GetHashCode());
var distinct = planDocuments.Distinct(comparer);
gvPlanDocumentsInfo.DataSource = distinct.ToList();
gvPlanDocumentsInfo.DataBind();
}
protected void gvPlanDocuments_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvPlanDocumentsInfo.PageIndex = e.NewPageIndex;
BindPlanDocument();
}
protected void gvPlanDocumentsInfo_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
GridView gv = e.Row.FindControl("gvPlanDocumentsFileInfo") as GridView;
var data = from f in planDocuments where f.PlanDocId == gvPlanDocumentsInfo.DataKeys[e.Row.RowIndex].Value.ToString() select f;
//var data = from f in planDocuments where f.PlanDocId == gvPlanDocumentsInfo.DataKeys[e.Row.RowIndex].Value.ToString() orderby f.DateEffective,f.HasNewFile descending select f;
gv.DataSource = data.ToList();
gv.DataBind();
}
}
protected void lnkFileName_Click(object sender, EventArgs e)
{
LinkButton lnkDownLoad = new LinkButton();
lnkDownLoad = (LinkButton)sender;
FileDownload fileDownload = new FileDownload();
fileDownload.FilePathID = Convert.ToInt32(lnkDownLoad.CommandName);
fileDownload.DownloadedBy = Convert.ToInt32(Page.CurrentWebUser().Contact.ContactId);
string path = lnkDownLoad.CommandArgument;
System.IO.FileInfo file = new System.IO.FileInfo(path);
if (file.Exists)
{
if (new FileDownloadService().InsertFileDownloadHistory(fileDownload))
{
Response.Clear();
Response.ContentType = "application/ms-word";
//Modified by Mamun Issue # 17 (Error: Found Duplicate Headers error in Chrome)
Response.AddHeader("Content-Disposition", "attachment; filename=\"" + lnkDownLoad.Text + "\"");
//End Issue # 17
Response.TransmitFile(path);
Response.End();
}
}
else
{
ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "FileDownload", "alert('This file does not exist.')", true);
}
}
}
// -------- Expand/Close row when click on button
function switchViews(obj, row) {
var div = document.getElementById(obj);
var img = document.getElementById('img' + obj);
var $currentTheme = $("input[id$='hidCurentTheme']");
var plusUrl = null;
var minusUrl = null;
plusUrl = '../App_Themes/' + $currentTheme.val() + '/Images/Icon/plus-2.png';
minusUrl = '../App_Themes/' + $currentTheme.val() + '/Images/Icon/minus-2.png';
if (div.style.display == "none") {
div.style.display = "inline";
if (row == 'alt') {
img.src = minusUrl; //"../Images/minus-2.gif";
mce_src = plusUrl; //"../Images/plus-2.gif";
}
else {
img.src = plusUrl;//"../Images/plus-2.gif";
mce_src = minusUrl; //"../Images/minus-2.gif";
}
img.alt = "Close to view other Plan";
}
else {
div.style.display = "none";
if (row == 'alt') {
img.src = plusUrl; //"../Images/plus-2.gif";
mce_src = plusUrl; //"../Images/plus-2.gif";
}
else {
img.src = minusUrl; //"../Images/minus-2.gif";
mce_src = minusUrl ;//"../Images/minus-2.gif";
}
img.alt = "Expand to show File";
}
}
Thursday, July 3, 2014
Client Portal
For July and DP Users:
Update sa_user set IsAccessAllPlans=1 where ContactID=52434
SELECT * FROM Contacts where contactId = 10030
select * from sa_user where contactId=10030
Select * from Plans where PlanName like 'Will J%'--PlanNumber : 453061770
Select * from ProjectFile where AccountID=453061770 order by DateUpload DESC
select * from plans where planclientnumber='0372410'
select * from ProjectFile where accountId=453065352 and projectid=44147 and webaccess=1
select * from tblProjectFileTypes
select * from ProjectFile
select * from tblProjectFileCategory
Select * from projectTable
tblplan_x_ref_webaccess
PlanDocs
tblProjectSubType
tblProjectFiles
tblplan_x_ref_webaccess
PlanDocs
tblProjectSubType
tblProjectFileCategory
192.168.1.66>Run>\\sharebear\Client_Project_Folders\453061578\Allocations\37656\Reviewer Reports\Test Agreement_SIGNED_20131226030858_e2b6ec3e-ddf4-49af-9066-8d82f9b9cc63.pdf
File
select top 100 * from tblprojectfiles where accountId=453061578
select top 100 * from plans where Planname='Test Plan'
https://clientportal.julyservices.com/Users/FileDownLoad.aspx?FilePathID=687198
http://localhost:3769/Users/FileDownLoad.aspx?FilePathID=687198
path=@"C:\Users\rubol\Desktop\CPFinal\PresentationLayer\ClientPortalWebUI\Content\Public\Test.pdf"
select * from plans where plannumber=453061339
SELECT * FROM Contacts where LastName like '%Dilling%'
SELECT * FROM Contacts WHERE COntactID=57411
select * from tblPlanSpec where plannumber = 453061339
Delete From uestionnaire List
Select *
From ccCensusUploadHistory Where Category = 'Questionnaire' and
FinalizedBy = 'Saidur Rahman' and ccStatusID in (23245,23245 )
delete
From ccCensusUploadHistory Where Category = 'Questionnaire' and
FinalizedBy = 'Saidur Rahman' and ccStatusID in (23245,23245 )
Select * from ccSoloContributionOwnerInfo where PlanID=453065380
and SoloContributionOwnerInfo_ID=1987
Update ccStatus set SoloContributionOwnerInfo_ID=Null
where PlanID=453065380 and AllocationNumber=54761
Update ccStatus set erisaCompliance_ID=Null
where PlanID=453065380 and AllocationNumber=54761
http://support.microsoft.com/kb/813444
http://support.microsoft.com/kb/968089
http://www.techsupportall.com/solved-cannot-access-secure-sites-https-websites-not-opening-view/
http://stackoverflow.com/questions/681695/what-do-i-need-to-do-to-get-internet-explorer-8-to-accept-a-self-signed-certifica
http://msdn.microsoft.com/en-us/library/ff649247.aspx
select * from ProjectFile where filepathid=2528868
update ProjectFile
set WebAccess = 0
where FilePathID = 2528868
Questionnaire
select * FROM tblPlanSpec_Matching
\\sicem\shared\Data\TPA_Manager\WindwardTemplates\ClientPortal\ComplaianceQuestionSOLO.docx
\\sicem\shared\Data\TPA_Manager\WindwardTemplates\ClientPortal\ComplaianceQuestion.docx
192.168.1.66>Run>\\sharebear\Client_Project_Folders\453061578\Allocations\37656\Reviewer Reports\Test Agreement_SIGNED_20131226030858_e2b6ec3e-ddf4-49af-9066-8d82f9b9cc63.pdf
File
select top 100 * from tblprojectfiles where accountId=453061578
select top 100 * from plans where Planname='Test Plan'
https://clientportal.julyservices.com/Users/FileDownLoad.aspx?FilePathID=687198
http://localhost:3769/Users/FileDownLoad.aspx?FilePathID=687198
path=@"C:\Users\rubol\Desktop\CPFinal\PresentationLayer\ClientPortalWebUI\Content\Public\Test.pdf"
SQL
http://www.codeproject.com/Tips/586395/Split-comma-separated-IDs-to-ge
- http://social.msdn.microsoft.com/Forums/vstudio/en-US/34d5bb3d-c2ce-4191-841d-ee6e31212fea/how-to-do-zip-and-unzip-in-c-and-aspnet-by-using-ioniczipdll?forum=netfxbcl
- http://www.aspdotnet-suresh.com/2013/04/aspnet-download-multiple-files-as-zip.html
select * from plans where plannumber=453061339
SELECT * FROM Contacts where LastName like '%Dilling%'
SELECT * FROM Contacts WHERE COntactID=57411
select * from sa_user where
contactId=22895
Delete From uestionnaire List
Select *
From ccCensusUploadHistory Where Category = 'Questionnaire' and
FinalizedBy = 'Saidur Rahman' and ccStatusID in (23245,23245 )
delete
From ccCensusUploadHistory Where Category = 'Questionnaire' and
FinalizedBy = 'Saidur Rahman' and ccStatusID in (23245,23245 )
Select * from ccSoloContributionOwnerInfo where PlanID=453065380
and SoloContributionOwnerInfo_ID=1987
Update ccStatus set SoloContributionOwnerInfo_ID=Null
where PlanID=453065380 and AllocationNumber=54761
Update ccStatus set erisaCompliance_ID=Null
where PlanID=453065380 and AllocationNumber=54761
http://support.microsoft.com/kb/813444
http://support.microsoft.com/kb/968089
http://www.techsupportall.com/solved-cannot-access-secure-sites-https-websites-not-opening-view/
http://stackoverflow.com/questions/681695/what-do-i-need-to-do-to-get-internet-explorer-8-to-accept-a-self-signed-certifica
http://msdn.microsoft.com/en-us/library/ff649247.aspx
select * from ProjectFile where filepathid=2528868
update ProjectFile
set WebAccess = 0
where FilePathID = 2528868
BL Peters, Inc. 401(k) Plan | 453064307 | Plan Document Files | SP_GetPlanDocumentByPlanID |
Test Plan | 453061578 | Participant Notices | GetParticipantNoticesFiles |
Questionnaire
Contributions
select * FROM tblPlanSpecselect * FROM tblPlanSpec_Matching
Ownership Information
Test Plan > 12/12/2030
select * FROM tblCompany where Id=8503
--delete FROM tblCompanyOwnerShip where CompanyId=8503
--delete FROM tblCompanySubsidiaries where CompanyId=8503
--delete FROM tblFamilyRelationship where CompanyId=8503
--delete FROM tblCompanyOfficers where CompanyId=8503
select CompanyOwnershipID,CompanyID,OwnerTypeID,OwnerID,OwnerName,OwnerPercent
FROM tblCompanyOwnerShip where CompanyId=8503
select * FROM tblCompanySubsidiaries where CompanyId=8503
select * FROM tblFamilyRelationship where CompanyId=8503
select * FROM tblCompanyOfficers where CompanyId=8503
All Tables
non-solo:contribution
tblPlanSpec
tblPlanSpec_Matching
solo::contribution
ccSoloOwnerContributions
ccBusinessPartnerSpouse
insertEachPartnerSpouse
insertEachPartnerSpouseFunded
ccOtherEmpContributions
OtherEmployeeContributionsChild
Non-Solo:Erisa
ccErisaCompliance
tblFormW3Info
Solo:Erisa
ccErisaCompliance
Non-Solo:ownership
select * FROM tblCompany
select * FROM tblCompanyOwnerShip
select * FROM tblCompanySubsidiaries
select * FROM tblFamilyRelationship
select * FROM tblCompanyOfficers
Solo:ownership
select * FROM tblCompany
select * FROM tblCompanyOwnerShip
select * FROM tblCompanySubsidiaries
select * FROM tblFamilyRelationship
Immediate Window
Local File Path set:
?CensusFileUrl = "\\\\soft-rubol\\SharedRubol\\Test.docx" ;
?CensusFileUrl = "soft-rubol\\SharedRubol\\Test.docx" ;
http://www.aspsnippets.com/Articles/Add-new-Row-to-GridView-on-Button-Click-in-ASPNet.aspx
--delete FROM tblCompanyOwnerShip where CompanyId=8503
--delete FROM tblCompanySubsidiaries where CompanyId=8503
--delete FROM tblFamilyRelationship where CompanyId=8503
--delete FROM tblCompanyOfficers where CompanyId=8503
select CompanyOwnershipID,CompanyID,OwnerTypeID,OwnerID,OwnerName,OwnerPercent
FROM tblCompanyOwnerShip where CompanyId=8503
select * FROM tblCompanySubsidiaries where CompanyId=8503
select * FROM tblFamilyRelationship where CompanyId=8503
select * FROM tblCompanyOfficers where CompanyId=8503
All Tables
non-solo:contribution
tblPlanSpec
tblPlanSpec_Matching
solo::contribution
ccSoloOwnerContributions
ccBusinessPartnerSpouse
insertEachPartnerSpouse
insertEachPartnerSpouseFunded
ccOtherEmpContributions
OtherEmployeeContributionsChild
Non-Solo:Erisa
ccErisaCompliance
tblFormW3Info
Solo:Erisa
ccErisaCompliance
Non-Solo:ownership
select * FROM tblCompany
select * FROM tblCompanyOwnerShip
select * FROM tblCompanySubsidiaries
select * FROM tblFamilyRelationship
select * FROM tblCompanyOfficers
Solo:ownership
select * FROM tblCompany
select * FROM tblCompanyOwnerShip
select * FROM tblCompanySubsidiaries
select * FROM tblFamilyRelationship
Immediate Window
Local File Path set:
?CensusFileUrl = "\\\\soft-rubol\\SharedRubol\\Test.docx" ;
?CensusFileUrl = "soft-rubol\\SharedRubol\\Test.docx" ;
http://www.aspsnippets.com/Articles/Add-new-Row-to-GridView-on-Button-Click-in-ASPNet.aspx
\\sicem\shared\Data\TPA_Manager\WindwardTemplates\ClientPortal\ComplaianceQuestionSOLO.docx
\\sicem\shared\Data\TPA_Manager\WindwardTemplates\ClientPortal\ComplaianceQuestion.docx
Subscribe to:
Posts (Atom)