How To Design Certificate using Html css And Format for print landscape and portrait Mode page Design

How To Design Certificate using Html CSS And Format for print landscape and portrait Mode page Design

OUTPUT:-


HTML AND CSS CODE FOR DESIGN CIRTIFICATE



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cirtificate</title>
<style type="text/css">
    .Page{

    width:800px; height:600px;background-image: url('Background.png');background-size: 100% 100%;
}
.BorderDiv{
width:759px;margin-left: 1px; height:559px; padding:20px;background-image: url('Border.png');background-size: 100% 100%;
}
.Name{
top: -368px;position: relative;font-size: 26px;left: 21px;color: #1713eadb;width: 404px;
}
.Phone{
  top: -400px; width:686px;position: relative;font-size: 26px;color: #1713eadb;left: 307px;
}
.Email{
  top: -387px;width:400px;position: relative;font-size: 20px;left: 43px;color: #1713eadb;
}
.Header{
  width: 100%;
}
.Footer{
  width: 100%;position: relative;top: -285px;
}
.LogoDivyang{
  position: relative;width: 91px;top: 5px;left: 51px;
}
.Signature{
  position: relative;width: 91px;top: 12px;left: 229px;
}
.PramanText{
  width: 100%;width: 260px;position: relative;top: -78px;
}
.Sveeplogo{
  position: relative;width: 91px;top: 33px;left: 51px;
}

.Electionlogo{
  position: relative;width: 91px;top: 33px;left: 229px;
}
.Text{
  width: 100%; position: relative;    top: -163px; 
}
</style>
<style type="text/css" media="print">
   * {
    -webkit-print-color-adjust: exact !important;   /* Chrome, Safari */
    color-adjust: exact !important;                 /*Firefox*/
}


@page {

 size:A4 portrait;
    margin-left: 0px;
    margin-right: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    margin: 0;
    width: 100%;
    -webkit-print-color-adjust: exact;
}
@media print {
.Page{
width: 100%;
height: 600px;
}
.BorderDiv{
  width: 95%;
  height: 560px;
}

.Name{
  padding-left: 5px;
left: 21px;width: 49%;
margin-top: -8px;
}
.Phone{
  padding-left: 85px;
 left: 420px;width:42%;
margin-top: -2px;
}
.Email{
  padding-left: 0px;
left: 60px;
}
.Header{
  width: 100%;
}
.Footer{
  top: -315px;
}
.LogoDivyang{
  width: 98px;top: 20px;left: 65px;
}
.Signature{
  width: 98px;top: 12px;left: 240px;
}
.PramanText{
  position: relative;top: -78px;
}
.Sveeplogo{
  top: 33px;left: 51px;
}

.Electionlogo{
  top: 33px;left: 249px;
}
.Text{
   top: -163px; 
}


 .noprint{
display: none;
 }
 }
</style>
</head>

<body>
<div style="" class="Page">
<div style=" " class="BorderDiv">
<div style="" class="Header">
     <div style="float: left;width: 50%">
        <img src="sveeplogo.png" class="Sveeplogo" style="" />
     </div>
     <div style="float: left;width: 50%">
        <img src="electionlogo.png" class="Electionlogo" style=""/>
     </div>
 </div>      
 <div style="width: 100% ;">
        <img src="heading.png" style="width: 100%" />      
</div>
<div style="width: 100% ;text-align: center">
    <img src="PramanText.png" style="" class="PramanText" />
</div>

<div style="width: 100% ;text-align: center">
    <img src="Text.png" style=""  class="Text" />
<div class="Name"><span><?php echo $result1[0]['name']?></span></div>
<div class="Phone"><span ><?php echo $result1[0]['phone'];?></span></div>
<div class="Email"><span ><?php echo $result1[0]['email'];?></span></div>   
</div>
<div style="" class="Footer">
           <div style="float: left;width: 50%;">
            <img src="LogoDivyang.png" style="" class="LogoDivyang" />
           </div>
           <div style="float: left;width: 50%">
            <img src="Signature.png" style="" class="Signature" />
           </div>
</div>    
</div>
</div>
<input type="button" name="print" value="print" onclick="print()" class="noprint" />
</body>
</html>

Visual Studio 2017 short cut keys

Visual Studio 2017 short cut keys 

Build
Build Solution
Ctrl+Shift+B
Cancel
Ctrl+Break
Run Code Analysison Solution
Alt+F11
Class View Context Menus
Properties
Alt+Enter
Misc
Commit All Edits
Shift+Alt+U
Move Left Edgetotheleft
Ctrl+Shift+,
Move Left Edgetotheright
Ctrl+Shift+.
Move Right Edgetotheleft
Ctrl+Shift+Alt+,
Move Right Edgetotheright
Ctrl+Shift+Alt+.
TSql Editor Clone Query
Ctrl+Alt+N
TSql Editor Database Combo
Shift+Alt+PgDn
View File In Script Panel
Shift+Alt+PgDn
Debug
Apply Code Changes
Alt+F10
Attachto Process
Ctrl+Alt+P
Autos
Ctrl+Alt+V, A
Break All
Ctrl+Alt+Break
Breakpoints
Ctrl+Alt+B
Call Stack
Ctrl+Alt+C
Delete All Breakpoints
Ctrl+Shift+F9
Launch
Alt+F2
Stop Collection
Ctrl+Shift+F2
Show
Ctrl+Alt+F2
Disassembly
Ctrl+Alt+D
Enable Breakpoint
Ctrl+F9
Exception Settings
Ctrl+Alt+E
Function Breakpoint
Ctrl+B
Go To Disassembly
Alt+G
Go To Previous Callor Intelli Trace Event
Ctrl+Shift+F11
Immediate
Ctrl+Alt+I
Intelli Trace Calls
Ctrl+Alt+Y, T
Intelli Trace Events
Ctrl+Alt+Y, F
Java Script Console
Ctrl+Alt+V, C
Locals
Ctrl+Alt+V, L
Process Combo
Ctrl+5
Stack Frame Combo
Ctrl+7
Thread Combo
Ctrl+6
Toggle Current Thread Flagged State
Ctrl+8
Toggle Flagged Threads
Ctrl+9
Memory1
Ctrl+Alt+M, 1
Memory2
Ctrl+Alt+M, 2
Memory3
Ctrl+Alt+M, 3
Memory4
Ctrl+Alt+M, 4
Modules
Ctrl+Alt+U
Navigate Backward
Shift+Alt+3
Navigate Forward
Shift+Alt+4
Parallel Stacks
Ctrl+Shift+D, S
Parallel Watch1
Ctrl+Shift+D, 1
Parallel Watch2
Ctrl+Shift+D, 2
Parallel Watch3
Ctrl+Shift+D, 3
Parallel Watch4
Ctrl+Shift+D, 4
Processes
Ctrl+Alt+Z
Quick Watch
Shift+F9
Ctrl+Alt+Q
Reattachto Process
Shift+Alt+P
Refresh
F5
Registers
Ctrl+Alt+G
Restart
Ctrl+Shift+F5
Run To Cursor
Ctrl+F10
Select Element
Ctrl+B
Set Next Statement
Ctrl+Shift+F10
Show All
Ctrl+Alt+V, D
Show Layout
Ctrl+Shift+I
Show Next Statement
Alt+Num *
Start
F5
Start Without Debugging
Ctrl+F5
Step Into
F11
Step Into Current Process
Ctrl+Alt+F11
Step Into Specific
Shift+Alt+F11
Step Out
Shift+F11
Step Out Current Process
Ctrl+Shift+Alt+F11
Step Over
F10
Step Over Current Process
Ctrl+Alt+F10
Stop Debugging
Shift+F5
Stop Performance Analysis
Shift+Alt+F2
Tasks
Ctrl+Shift+D, K
Threads
Ctrl+Alt+H
Toggle Breakpoint
F9
Toggle Disassembly
Ctrl+F11
Watch1
Ctrl+Alt+W, 1
Watch2
Ctrl+Alt+W, 2
Watch3
Ctrl+Alt+W, 3
Watch4
Ctrl+Alt+W, 4
Debugger Context Menus
Breakpoint Conditions
Alt+F9, C
Breakpoint Editlabels
Alt+F9, L
Delete
Alt+F9, D
Go To Disassembly
Alt+F9, A
Go To Source Code
Alt+F9, S
Design
Fit All
Ctrl+0
Refresh Page
Ctrl+R
Show Handles
F9
Zoom In
Ctrl+Alt+=
Zoom Out
Ctrl+Alt+-
Diff
Ignore Trim Whitespace
Ctrl+\, Ctrl+Space
Inline View
Ctrl+\, Ctrl+1
Left Only View
Ctrl+\, Ctrl+3
Next Difference
F8
Previous Difference
Shift+F8
Right Only View
Ctrl+\, Ctrl+4
Side By Side View
Ctrl+\, Ctrl+2
Switch Between Left And Right
Ctrl+\, Ctrl+Tab
Synchronize View Toggle
Ctrl+\, Ctrl+Down Arrow
Edit
Break Line
Enter
Char Left
Left Arrow
Char Left Extend
Shift+Left Arrow
Char Left Extend Column
Shift+Alt+Left Arrow
Char Right
Right Arrow
Char Right Extend
Shift+Right Arrow
Char Right Extend Column
Shift+Alt+Right Arrow
Clear Bookmarks
Ctrl+K, Ctrl+L
Collapse All Outlining
Ctrl+M, Ctrl+A
Collapse Current Region
Ctrl+M, Ctrl+S
Collapse Tag
Ctrl+M, Ctrl+T
Collapseto Definitions
Ctrl+M, Ctrl+O
Comment Selection
Ctrl+K, Ctrl+C
Complete Word
Ctrl+Space
Alt+Right Arrow
Contract Selection
Alt+2
Copy
Ctrl+C
Ctrl+Ins
Copy Parameter Tip
Ctrl+Shift+Alt+C
Create Copyof Work Item
Shift+Alt+C
Cut
Ctrl+X
Shift+Del
Cycle Clipboard Ring
Ctrl+Shift+V
Ctrl+Shift+Ins
Decrease Filter Level
Alt+,
Delete
Del
Delete Backwards
Bkspce
Shift+Bkspce
Delete Horizontal White Space
Ctrl+K, Ctrl+\
Document End
Ctrl+End
End
Document End Extend
Ctrl+Shift+End
Shift+End
Document Start
Ctrl+Home
Home
Document Start Extend
Ctrl+Shift+Home
Shift+Home
Edit Cell
F2
Expand All Outlining
Ctrl+M, Ctrl+X
Expand Current Region
Ctrl+M, Ctrl+E
Expand Selection
Alt+1
Find
Ctrl+F
Find All References
Shift+F12
Findin Files
Ctrl+Shift+F
Find Next
F3
Find Next Selected
Ctrl+F3
Find Previous
Shift+F3
Find Previous Selected
Ctrl+Shift+F3
Format Document
Ctrl+K, Ctrl+D
Format Selection
Ctrl+K, Ctrl+F
Go To
Ctrl+G
Goto Brace
Ctrl+]
Goto Brace Extend
Ctrl+Shift+]
Go To Declaration
Ctrl+F12
Go To Definition
F12
Go To File
Ctrl+1, Ctrl+F
Ctrl+1, F
Go To Find Combo
Ctrl+D
Go To Implementation
Ctrl+F12
Go To Member
Ctrl+1, Ctrl+M
Ctrl+1, M
Go To Next Location
F8
Go To Prev Location
Shift+F8
Go To Symbol
Ctrl+1, Ctrl+S
Ctrl+1, S
Go To Type
Ctrl+1, Ctrl+T
Ctrl+1, T
Hide Selection
Ctrl+M, Ctrl+H
Increase Filter Level
Alt+.
Incremental Search
Ctrl+I
Indent
Shift+Alt+Right Arrow
Insert Snippet
Ctrl+K, Ctrl+X
Insert Tab
Tab
Line Cut
Ctrl+L
Line Delete
Ctrl+Shift+L
Line Down
Down Arrow
Line Down Extend
Shift+Down Arrow
Shift+Up Arrow
Line Down Extend Column
Shift+Alt+Down Arrow
Line End
End
Line End Extend
Shift+End
Line End Extend Column
Shift+Alt+End
Line Open Above
Ctrl+Enter
Line Open Below
Ctrl+Shift+Enter
Line Start
Home
Line Start Extend
Shift+Home
Line Start Extend Column
Shift+Alt+Home
Line Transpose
Shift+Alt+T
Line Up
Up Arrow
Line Up Extend
Shift+Up Arrow
Shift+Down Arrow
Line Up Extend Column
Shift+Alt+Up Arrow
List Members
Ctrl+J
Make Lowercase
Ctrl+U
Make Uppercase
Ctrl+Shift+U
Move Control Down
Ctrl+Down Arrow
Move Control Down Grid
Down Arrow
Move Control Left
Ctrl+Left Arrow
Move Control Left Grid
Left Arrow
Move Control Right
Ctrl+Right Arrow
Move Control Right Grid
Right Arrow
Move Control Up
Ctrl+Up Arrow
Move Control Up Grid
Up Arrow
Move Selected Lines Down
Alt+Down Arrow
Move Selected Lines Up
Alt+Up Arrow
Navigate To
Ctrl+T
Ctrl+,
Next Bookmark
Ctrl+K, Ctrl+N
Next Bookmark In Folder
Ctrl+Shift+K, Ctrl+Shift+N
Next Highlighted Reference
Ctrl+Shift+Down Arrow
Open File
Ctrl+Shift+G
Outdent
Shift+Alt+Left Arrow
Overtype Mode
Ins
Page Down
PgDn
Page Down Extend
Shift+PgDn
Page Up
PgUp
Page Up Extend
Shift+PgUp
Parameter Info
Ctrl+Shift+Space
Paste
Ctrl+V
Shift+Ins
Paste Parameter Tip
Ctrl+Shift+Alt+P
Peek Backward
Ctrl+Alt+-
Peek Definition
Alt+F12
Peek Forward
Ctrl+Alt+=
Previous Bookmark
Ctrl+K, Ctrl+P
Previous Bookmark In Folder
Ctrl+Shift+K, Ctrl+Shift+P
Previous Highlighted Reference
Ctrl+Shift+Up Arrow
Quick Find Symbol
Shift+Alt+F12
Quick Info
Ctrl+K, Ctrl+I
Redo
Ctrl+Y
Ctrl+Shift+Z
Shift+Alt+Bkspce
Refresh Remote References
Ctrl+Shift+J
Refresh Work Item
F5
Remove
Del
Remove Row
Ctrl+Del
Replace
Ctrl+H
Replacein Files
Ctrl+Shift+H
Scroll Line Down
Ctrl+Down Arrow
Scroll Line Up
Ctrl+Up Arrow
Select All
Ctrl+A
Select Current Word
Ctrl+W
Selection Cancel
Esc
Select Next Control
Tab
Select Previous Control
Shift+Tab
Select To Last Go Back
Ctrl+=
Show Code Lens Menu
Alt+`
Show Tile Grid
Enter
Size Control Down
Ctrl+Shift+Down Arrow
Size Control Down Grid
Shift+Down Arrow
Size Control Left
Ctrl+Shift+Left Arrow
Size Control Left Grid
Shift+Left Arrow
Size Control Right
Ctrl+Shift+Right Arrow
Size Control Right Grid
Shift+Right Arrow
Size Control Up
Ctrl+Shift+Up Arrow
Size Control Up Grid
Shift+Up Arrow
Smart Break Line
Shift+Enter
Stop Hiding Current
Ctrl+M, Ctrl+U
Stop Outlining
Ctrl+M, Ctrl+P
Stop Search
Alt+F3, S
Surround With
Ctrl+K, Ctrl+S
Swap Anchor
Ctrl+K, Ctrl+A
Tab Left
Shift+Tab
Toggle All Outlining
Ctrl+M, Ctrl+L
Toggle Bookmark
Ctrl+K, Ctrl+K
Toggle Completion Mode
Ctrl+Alt+Space
Toggle Outlining Expansion
Ctrl+M, Ctrl+M
Toggle Task List Shortcut
Ctrl+K, Ctrl+H
Toggle Word Wrap
Ctrl+E, Ctrl+W
Uncomment Selection
Ctrl+K, Ctrl+U
Undo
Ctrl+Z
Alt+Bkspce
View Bottom
Ctrl+PgDn
View Bottom Extend
Ctrl+Shift+PgDn
View Top
Ctrl+PgUp
View Top Extend
Ctrl+Shift+PgUp
View White Space
Ctrl+R, Ctrl+W
Word Delete To End
Ctrl+Del
Word Delete To Start
Ctrl+Bkspce
Word Next
Ctrl+Right Arrow
Word Next Extend
Ctrl+Shift+Right Arrow
Word Next Extend Column
Ctrl+Shift+Alt+Right Arrow
Word Previous
Ctrl+Left Arrow
Word Previous Extend
Ctrl+Shift+Left Arrow
Word Previous Extend Column
Ctrl+Shift+Alt+Left Arrow
Editor Context Menus
Add Comment
Ctrl+Shift+K
Edit Local File
Ctrl+Shift+P
Execute
Ctrl+Alt+F5
Go To View
Ctrl+M, Ctrl+G
Quick Actions For Position
Ctrl+.
Remove And Sort
Ctrl+R, Ctrl+G
Ctrl+R, G
View Call Hierarchy
Ctrl+K, Ctrl+T
Ctrl+K, T
File
Exit
Alt+F4
New File
Ctrl+N
New Project
Ctrl+Shift+N
New Web Site
Shift+Alt+N
Open File
Ctrl+O
Open Folder
Ctrl+Shift+Alt+O
Open Project
Ctrl+Shift+O
Open Web Site
Shift+Alt+O
Print
Ctrl+P
Rename
F2
Save All
Ctrl+Shift+S
Save Selected Items
Ctrl+S
Viewin Browser
Ctrl+Shift+W
Format
Bold
Ctrl+B
Convertto Hyperlink
Ctrl+L
Edit Text
F2
Insert Bookmark
Ctrl+Shift+L
Italic
Ctrl+I
Reset All
Ctrl+Shift+R
Underline
Ctrl+U
Graph View
Bottomto Top
Alt+Up Arrow
Leftto Right
Alt+Right Arrow
Rightto Left
Alt+Left Arrow
Topto Bottom
Alt+Down Arrow
Help
Addand Remove Help Content
Ctrl+Alt+F1
F1 Help
F1
View Help
Ctrl+F1
Window Help
Shift+F1
Interactive Console
Break Line
Shift+Enter
Copy Code
Ctrl+Shift+C
Copy To Interactive
Ctrl+K, Ctrl+Enter
Execute In Interactive
Ctrl+E, Ctrl+E
Ctrl+E, E
Execute Or Paste Input
Ctrl+Enter
History Next
Alt+Down Arrow
History Previous
Alt+Up Arrow
Search History Next
Ctrl+Alt+Down Arrow
Search History Previous
Ctrl+Alt+Up Arrow
Other Context Menus
Refresh Linked Browsers
Ctrl+Alt+Enter
Insert Column
Ins
Column
Ctrl+L
Removefrom Workspace
Del
Go To Controller
Ctrl+M, Ctrl+G
Wrap Withdiv
Shift+Alt+W
Reload Schemas
Ctrl+Shift+J
Add New Diagram
Ins
Down
Alt+Down Arrow
Down5
Alt+PgDn
To Bottom
Alt+End
To Top
Alt+Home
Up
Alt+Up Arrow
Up5
Alt+PgUp
Rename
Ctrl+R, R
Removefrom Diagram
Shift+Del
Project
Add Content Page
Ctrl+M, Ctrl+C
Add Existing Item
Shift+Alt+A
Add New Item
Ctrl+Shift+A
Override
Ctrl+Alt+Ins
Previewchanges
Alt+;, Alt+C
Publishselectedfiles
Alt+;, Alt+P
Replaceselectedfilesfromserver
Alt+;, Alt+R
Query Designer
Cancel Retrieving Data
Ctrl+T
Criteria
Ctrl+2
Diagram
Ctrl+1
Execute SQL
Ctrl+R
Goto Row
Ctrl+G
Join Mode
Ctrl+Shift+J
Results
Ctrl+4
SQL
Ctrl+3
Refactor
Encapsulate Field
Ctrl+R, Ctrl+E
Extract Interface
Ctrl+R, Ctrl+I
Extract Method
Ctrl+R, Ctrl+M
Remove Parameters
Ctrl+R, Ctrl+V
Rename
Ctrl+R, Ctrl+R
Reorder Parameters
Ctrl+R, Ctrl+O
Resources
Audio
Ctrl+4
Files
Ctrl+5
Icons
Ctrl+3
Images
Ctrl+2
Other
Ctrl+6
Strings
Ctrl+1
Solution Explorer
Open Files Filter
Ctrl+[, O
Ctrl+[, Ctrl+O
Pending Changes Filter
Ctrl+[, P
Ctrl+[, Ctrl+P
Sync With Active Document
Ctrl+[, S
Ctrl+[, Ctrl+S
SQL
Execute With Debugger
Alt+F5
Expand Wildcards
Ctrl+R, E
Ctrl+R, Ctrl+E
Fullyqualify Names
Ctrl+R, Q
Ctrl+R, Ctrl+Q
Moveto Schema
Ctrl+R, M
Ctrl+R, Ctrl+M
Query Results New Row
Alt+End
Query Results Refresh
Shift+Alt+R
Query Results Stop
Alt+Break
Rename
Ctrl+R, R
F2
Ctrl+R, Ctrl+R
SSDTSchema Compare Compare
Shift+Alt+C
SSDTSchema Compare Generate Script
Shift+Alt+G
SSDTSchema Compare Next Change
Shift+Alt+.
SSDTSchema Compare Previous Change
Shift+Alt+,
SSDTSchema Compare Stop
Alt+Break
SSDTSchema Compare Write Updates
Shift+Alt+U
TSql Editor Cancel Query
Alt+Break
TSql Editor Execute Query
Ctrl+Shift+E
TSql Editor Results As File
Ctrl+D, F
TSql Editor Results As Grid
Ctrl+D, G
TSql Editor Results As Text
Ctrl+D, T
TSql Editor Show Estimated Plan
Ctrl+D, E
TSql Editor Toggle Execution Plan
Ctrl+D, A
TSql Editor Toggle Results Pane
Ctrl+D, R
Table
Columntothe Left
Ctrl+Alt+Left Arrow
Columntothe Right
Ctrl+Alt+Right Arrow
Row Above
Ctrl+Alt+Up Arrow
Row Below
Ctrl+Alt+Down Arrow
Team
Go To Child
Alt+PgUp
Go To Git Active Repositories
Ctrl+0, Ctrl+E
Ctrl+0, E
Go To Git Changes
Ctrl+0, Ctrl+G
Ctrl+0, G
Go To Git Synchronization
Ctrl+0, Ctrl+Y
Ctrl+0, Y
Go To Parent
Alt+PgDn
Goto Next Work Item
Shift+Alt+N
Goto Previous Work Item
Shift+Alt+P
New Linked Work Item
Shift+Alt+L
Refresh
F5
Team Explorer Search
Ctrl+'
Team Foundation Context Menus
Tfs Annotate Move Next Region
Alt+PgDn
Tfs Annotate Move Previous Region
Alt+PgUp
Go To Builds
Ctrl+0, Ctrl+B
Ctrl+0, B
Go To Connect
Ctrl+0, Ctrl+C
Ctrl+0, C
Go To Documents
Ctrl+0, Ctrl+D
Ctrl+0, D
Go To Home
Ctrl+0, Ctrl+H
Ctrl+0, H
Go To My Work
Ctrl+0, Ctrl+M
Ctrl+0, M
Go To Pending Changes
Ctrl+0, Ctrl+P
Ctrl+0, P
Go To Reports
Ctrl+0, Ctrl+R
Ctrl+0, R
Go To Settings
Ctrl+0, Ctrl+S
Ctrl+0, S
Go To Team Explorer Navigation
Alt+Home
Go To Team Explorer Next Section Content
Alt+Down Arrow
Go To Team Explorer Page Content
Alt+0
Go To Team Explorer Previous Section Content
Alt+Up Arrow
Go To Team Explorer Section1 Content
Alt+1
Go To Team Explorer Section2 Content
Alt+2
Go To Team Explorer Section3 Content
Alt+3
Go To Team Explorer Section4 Content
Alt+4
Go To Team Explorer Section5 Content
Alt+5
Go To Team Explorer Section6 Content
Alt+6
Go To Team Explorer Section7 Content
Alt+7
Go To Team Explorer Section8 Content
Alt+8
Go To Team Explorer Section9 Content
Alt+9
Go To Web Access
Ctrl+0, Ctrl+A
Ctrl+0, A
Go To Work Items
Ctrl+0, Ctrl+W
Ctrl+0, W
Team Explorer Navigate Backward
Alt+Left Arrow
Team Explorer Navigate Forward
Alt+Right Arrow
Set Focuson Left Window
Alt+1
Set Focuson Result Window
Alt+2
Set Focuson Right Window
Alt+3
Tfs Context My Work Page Create Copy WI
Shift+Alt+C
Tfs Context My Work Page New Linked WI
Shift+Alt+L
Test Explorer
Debug All Tests
Ctrl+R, Ctrl+A
Debug All Tests In Context
Ctrl+R, Ctrl+T
Open Test
F12
Repeat Last Run
Ctrl+R, L
Run All Tests
Ctrl+R, A
Run All Tests In Context
Ctrl+R, T
Tools
Code Snippets Manager
Ctrl+K, Ctrl+B
Force GC
Ctrl+Shift+Alt+F12, Ctrl+Shift+Alt+F12
Go To Command Line
Ctrl+/
View
All Windows
Shift+Alt+M
NETNonvisual Controls
Ctrl+Shift+N
Backward
Alt+Left Arrow
Bookmark Window
Ctrl+K, Ctrl+W
Browse Next
Ctrl+Shift+1
Browse Previous
Ctrl+Shift+2
Call Hierarchy
Ctrl+Alt+K
Class View
Ctrl+Shift+C
Class View Go To Search Combo
Ctrl+K, Ctrl+V
Code Definition Window
Ctrl+\, D
Ctrl+\, Ctrl+D
Command Window
Ctrl+Alt+A
Data Sources
Shift+Alt+D
Document Outline
Ctrl+Alt+T
Edit Label
F2
Edit Master
Ctrl+M, Ctrl+M
Entity Data Model Browser
Ctrl+1
Entity Data Model Mapping Details
Ctrl+2
Error List
Ctrl+\, E
Ctrl+\, Ctrl+E
Find Symbol Results
Ctrl+Alt+F12
Forward
Alt+Right Arrow
Forward Browse Context
Ctrl+Shift+7
Full Screen
Shift+Alt+Enter
Navigate Backward
Ctrl+-
Navigate Forward
Ctrl+Shift+-
Next Error
Ctrl+Shift+F12
Next View
Ctrl+PgDn
Notifications
Ctrl+W, N
Ctrl+W, Ctrl+N
Object Browser
Ctrl+Alt+J
Object Browser Go To Search Combo
Ctrl+K, Ctrl+R
Output
Ctrl+Alt+O
Pop Browse Context
Ctrl+Shift+8
Properties Window
F4
Property Pages
Shift+F4
Quick Actions
Ctrl+.
Quick Actions For Position
Ctrl+\, Ctrl+.
Refresh
F5
Resource View
Ctrl+Shift+E
Server Explorer
Ctrl+Alt+S
Show Smart Tag
Shift+Alt+F10
Ctrl+.
Solution Explorer
Ctrl+Alt+L
SQLServer Object Explorer
Ctrl+\, Ctrl+S
Synchronize Views
Ctrl+Shift+Y
Task List
Ctrl+\, T
Ctrl+\, Ctrl+T
Task Runner Explorer
Ctrl+Alt+Bkspce
Tfs Team Explorer
Ctrl+\, Ctrl+M
Toolbox
Ctrl+Alt+X
View Code
F7
View Designer
Shift+F7
View Markup
Shift+F7
Web Browser
Ctrl+Alt+R
Zoom In
Ctrl+Shift+.
Zoom Out
Ctrl+Shift+,
Window
Activate Document Window
Esc
Activate Quick Launch
Ctrl+Q
Activate Quick Launch Previous Category
Ctrl+Shift+Q
Activate Solution Explorer Search
Ctrl+;
Activate Window Search
Alt+`
Add Tabto Selection
Ctrl+Shift+Alt+Space
Apply Window Layout1
Ctrl+Alt+1
Apply Window Layout10
Ctrl+Alt+0
Apply Window Layout2
Ctrl+Alt+2
Apply Window Layout3
Ctrl+Alt+3
Apply Window Layout4
Ctrl+Alt+4
Apply Window Layout5
Ctrl+Alt+5
Apply Window Layout6
Ctrl+Alt+6
Apply Window Layout7
Ctrl+Alt+7
Apply Window Layout8
Ctrl+Alt+8
Apply Window Layout9
Ctrl+Alt+9
Close Document Window
Ctrl+F4
Close Tool Window
Shift+Esc
Keep Tab Open
Ctrl+Alt+Home
Moveto Navigation Bar
Ctrl+F2
Next Document Window
Ctrl+F6
Next Document Window Nav
Ctrl+Tab
Next Pane
Alt+F6
Next Split Pane
F6
Next Tab
Ctrl+Alt+PgDn
Ctrl+PgDn
Next Taband Addto Selection
Ctrl+Shift+Alt+PgDn
Next Tool Window Nav
Alt+F7
Previous Document Window
Ctrl+Shift+F6
Previous Document Window Nav
Ctrl+Shift+Tab
Previous Pane
Shift+Alt+F6
Previous Split Pane
Shift+F6
Previous Tab
Ctrl+Alt+PgUp
Ctrl+PgUp
Previous Taband Addto Selection
Ctrl+Shift+Alt+PgUp
Previous Tool Window Nav
Shift+Alt+F7
Show Dock Menu
Alt+-
Show Ez MDIFile List
Ctrl+Alt+Down Arrow
Toggle
Shift+Alt+V
XML
Start XSLTDebugging
Alt+F5
Start XSLTWithout Debugging
Ctrl+Alt+F5
Xsd Designer
Show Content Model View
Ctrl+2
Show Graph View
Ctrl+3
Show Start View
Ctrl+1

How To Create Menu Active link Using java script in website



How To Create Menu Active link Using java script in website 



<script>
        function onCancel() {
            window.location.href = "/Home/Index";
        }

        $(function () {
            setNavigation();
        });

        function setNavigation() {
            var path = window.location.pathname;
            path = path.replace(/\/$/, "");
            path = decodeURIComponent(path);

            $(".sidebar-menu a").each(function () {
                var href = $(this).attr('href');
           
                if (path.substring(0, href.length) === href) {
                    $(this).parents('li').parents('li').addClass('active');
                    var path1 = path.split('/');
                    var heref1 = href.split('/');
                    if (path1[2] === heref1[2]) {
                        $(this).parents('li').addClass('active');
                    }
                }
               
            });
        }
    </script>

DataTable Using Tabs in Responsive pettern

DataTable Using Tabs in Responsive pettern


______________________________________
//Create Bundle for Datatable


 public class BundleConfig
    {
        // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
        public static void RegisterBundles(BundleCollection bundles)
        {
bundles.Add(new ScriptBundle("~/bundles/datatable").Include(
                "~/plugins/datatables/jquery.dataTables.min.js",
                "~/plugins/datatables/dataTables.bootstrap.min.js",
                 "~/plugins/datatables/extensions/Responsive/js/dataTables.responsive.min.js",
                "~/plugins/datatables/extensions/Responsive/js/dataTables.responsive.js"
                ));

 //datatable css
            bundles.Add(new StyleBundle("~/Content/datatable").Include(
                //"~/plugins/datatables/dataTables.bootstrap.css",
                "~/plugins/datatables/jquery.dataTables.min.css",
                    "~/plugins/datatables/jquery.dataTables_themeroller.min.css",
                    "~/plugins/datatables/extensions/Responsive/css/dataTables.responsive.css"
                    ));

}
}
_____________________________________________________________________________
//

 @Styles.Render("~/Content/datatable")
    @Scripts.Render("~/bundles/datatable")

______________________________________________________________________________
<div class="nav-tabs-custom">
                        <ul class="nav nav-tabs">
                            <li class="active" id="period1_group"><a href="#tab_1" data-toggle="tab">Group</a></li>
                            <li id="period2_operator" ><a href="#tab_2" data-toggle="tab">Operator</a></li>
                            <li id="period3_user" ><a href="#tab_3" data-toggle="tab">User</a></li>

                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane active" id="tab_1">
                                <div id="ProfileValue_Group">
                                    @Html.Partial("v1")
                                 
                                 
                                 
                                </div>
                            </div>
                            <div class="tab-pane" id="tab_2">
                                <div id="divProfileValue_Operator">
                                    @Html.Partial("v2")

                                </div>
                            </div>
                            <div class="tab-pane" id="tab_3">
                                <div id="divProfileValue_User">
                                    @Html.Partial("v3")

                                </div>
                            </div>
                        </div>
                    </div>

_______________________________________________________________________
@section FooterSection
{
    <script>
        calldatatable();
        $(document).ready(function () {
            calldatatable();
            $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
              $($.fn.dataTable.tables({ visible: true, api: true, responsive: true})).DataTable().columns.adjust().responsive.recalc();             
            });
        });
        function calldatatable() {
            $('#Profile_GroupMaster').DataTable({
                responsive: true, "destroy": true, 'retrieve': true, select: true,
            });
            $('#Profile_OperatorMaster').DataTable({
                responsive: true,
                "destroy": true, 'retrieve': true, select: true,
            });
            $('#ProfileValue_User').DataTable({
                responsive: true, "destroy": true, 'retrieve': true, select: true
            });
        }

    </script>

}

____________________________________________________________________________
//v1
<table id="Profile_GroupMaster" class="table table-bordered" style="width:100%">
    <thead>
        <tr>
            <th>GroupID</th>
            <th>Tritex Group Name</th>
            <th>AgentLegalName</th>
            <th>IsAgent</th>
            <th>Address</th>
            <th>Country</th>
            <th>Postalcode</th>
            <th>EmailID</th>
            <th>WorkPhoneNo</th>
            <th>Operator Name</th>
        </tr>
    </thead>
    <tbody>
        @if (ViewBag.GroupMaster != null)
        {
            if (Enumerable.Count(ViewBag.GroupMaster) > 0)
            {
                foreach (var item in ViewBag.GroupMaster)
                {
                    <tr>
                        <td>@item.GroupID</td>
                        <td>@item.GroupName</td>
                        <td>@item.AgentLegalName</td>
                        <td>@item.IsAgent</td>
                        <td>@item.Address</td>
                        <td> @item.CountryName</td>
                        <td>@item.Postalcode</td>
                        <td>@item.EmailID</td>
                        <td>@item.WorkPhoneNo</td>
                        <td>@item.OperatorGroupName</td>
                    </tr>
                }
            }
        }
    </tbody>
</table>
_______________________________________________________________________________

<table id="Profile_OperatorMaster" class="table table-bordered" style="width:100%">
    <thead>
        <tr>
            <th>OperatorID</th>
            <th>Tritex Operator Name</th>
            <th>Address</th>
            <th>Country</th>
            <th>Postalcode</th>
            <th>EmailID</th>
            <th>WorkPhoneNo</th>
            <th>Operator Name</th>
            <th>Tritex Group Name</th>
        </tr>
    </thead>
    <tbody>
        @if (ViewBag.OperatorMaster != null)
        {
            if (Enumerable.Count(ViewBag.OperatorMaster) > 0)
            {
                foreach (var item in ViewBag.OperatorMaster)
                {
                    <tr>
                        <td>@item.OperatorID</td>
                        <td>@item.OperatorName</td>
                        <td>@item.Address</td>
                        <td> @item.CountryName </td>
                        <td>@(item.Postalcode == "0" ? null : item.Postalcode)</td>
                        <td>@item.EmailID</td>
                        <td>@item.WorkPhoneNo</td>
                        <td>@item.OperatorGroupName</td>
                        <td>@item.GroupName</td>
                    </tr>
                }
            }
        }
    </tbody>

</table>
______________________________________________________________________________
v3

<table id="ProfileValue_User" class="table table-bordered" style="width:100%">
    <thead>
        <tr>
            <th>UserID</th>
            <th>EmailID</th>
            <th>Role</th>
            <th>Address</th>
            <th>Country</th>
            <th>Postalcode</th>
            <th>WorkPhoneNo</th>
            <th>IsActive</th>
        </tr>
    </thead>
    <tbody>
        @if (ViewBag.UserMaster != null)
        {
            if (Enumerable.Count(ViewBag.UserMaster) > 0)
            {
                foreach (var item in ViewBag.UserMaster)
                {
                    <tr>
                        <td>@item.UserID</td>
                        <td>@item.EmailID</td>
                        <td>@item.RoleName</td>
                        <td>@item.Address</td>
                        <td> @item.CountryName </td>
                        <td>@item.Postalcode</td>
                        <td>@item.WorkPhoneNo</td>
                        <td>@item.IsActive</td>
                    </tr>
                }
            }
        }
    </tbody>
</table>
_______________________________________________________________________________

How To Insert Multiple table , Multiple Row In database using sql user define type table


How To Insert Multiple table , Multiple Row In database using sql user define type table




CREATE TABLE [dbo].[LabReport](
[Id] [int] IDENTITY(1,1) NOT NULL,
[LRCId] [int] NULL,
[LRTId] [int] NULL,
[Title] [varchar](200) NULL,
[LabName] [varchar](200) NULL,
[LabAddress] [varchar](400) NULL,
[LabContactNo] [varchar](15) NULL,
[LabEmail] [varchar](200) NULL,
[LabUserName] [varchar](200) NULL,
[Details] [varchar](500) NULL,
[DetailsData] [nvarchar](max) NULL,
[PID] [int] NULL,
[ReportDate] [datetime] NULL,
[AddedOn] [datetime] NULL,
[ModifiedOn] [datetime] NULL,
[IsActive] [bit] NULL,
 CONSTRAINT [PK__LabRepor__3214EC07C2B6BB24] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[LabReport]  WITH CHECK ADD  CONSTRAINT [FK__LabReport__LRCId__12C8C788] FOREIGN KEY([LRCId])
REFERENCES [dbo].[LabReportCategory] ([Id])
GO

ALTER TABLE [dbo].[LabReport] CHECK CONSTRAINT [FK__LabReport__LRCId__12C8C788]
GO

ALTER TABLE [dbo].[LabReport]  WITH CHECK ADD  CONSTRAINT [FK__LabReport__LRTId__13BCEBC1] FOREIGN KEY([LRTId])
REFERENCES [dbo].[LabReportType] ([Id])
GO

ALTER TABLE [dbo].[LabReport] CHECK CONSTRAINT [FK__LabReport__LRTId__13BCEBC1]
GO

ALTER TABLE [dbo].[LabReport]  WITH CHECK ADD  CONSTRAINT [FK__LabReport__PID__14B10FFA] FOREIGN KEY([PID])
REFERENCES [dbo].[PatientDetail] ([PID])
GO

ALTER TABLE [dbo].[LabReport] CHECK CONSTRAINT [FK__LabReport__PID__14B10FFA]
GO




/****** Object:  Table [dbo].[LabReportCategory]    Script Date: 26-09-2018 23:07:50 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[LabReportCategory](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Title] [varchar](200) NULL,
[Code] [varchar](100) NULL,
[AddedOn] [datetime] NULL,
[ModifiedOn] [datetime] NULL,
[IsActive] [bit] NULL,
PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO






CREATE TABLE [dbo].[LabReportImegenary](
[Id] [int] IDENTITY(1,1) NOT NULL,
[LRId] [int] NULL,
[FIleType] [varchar](100) NULL,
[FileExtention] [varchar](10) NULL,
[FileUrl] [text] NULL,
[AddedOn] [datetime] NULL,
[ModifiedOn] [datetime] NULL,
[IsActive] [bit] NULL,
PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[LabReportImegenary]  WITH CHECK ADD  CONSTRAINT [FK__LabReportI__LRId__178D7CA5] FOREIGN KEY([LRId])
REFERENCES [dbo].[LabReport] ([Id])
GO

ALTER TABLE [dbo].[LabReportImegenary] CHECK CONSTRAINT [FK__LabReportI__LRId__178D7CA5]
GO




/****** Object:  Table [dbo].[LabReportType]    Script Date: 26-09-2018 23:07:57 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[LabReportType](
[Id] [int] IDENTITY(1,1) NOT NULL,
[CatID] [int] NULL,
[Title] [varchar](200) NULL,
[Code] [varchar](100) NULL,
[AddedOn] [datetime] NULL,
[ModifiedOn] [datetime] NULL,
[IsActive] [bit] NULL,
PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[LabReportType]  WITH CHECK ADD FOREIGN KEY([CatID])
REFERENCES [dbo].[LabReportCategory] ([Id])
GO




SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[PatientDetail](
[PID] [int] IDENTITY(1,1) NOT NULL,
[Title] [varchar](10) NULL,
[UserName] [varchar](50) NULL,
[FirstName] [varchar](50) NULL,
[MiddleName] [varchar](50) NULL,
[LastName] [varchar](50) NULL,
[Gender] [char](2) NULL,
[DOB] [date] NULL,
[DOD] [date] NULL,
[DOD_SubReasonID] [int] NULL,
[RegistrationDate] [date] NULL,
[SSN] [int] NULL,
[Mode_of_Communication_ID] [int] NULL,
[EmailID] [varchar](50) NULL,
[Address1] [varchar](50) NULL,
[Address2] [varchar](50) NULL,
[CityID] [int] NULL,
[StateID] [int] NULL,
[Zip] [char](10) NULL,
[CountryID] [int] NULL,
[ProviderID] [int] NULL,
[MobilePhone] [varchar](15) NULL,
[WorkPhone] [varchar](15) NULL,
[HomePhone] [varchar](15) NULL,
[EthnicityID] [int] NULL,
[RaceID] [int] NULL,
[Notification] [bit] NULL,
[MaritalStatusID] [int] NULL,
[PatientPhoto] [varchar](100) NULL,
[Emerg_Contact_Name] [varchar](50) NULL,
[Emerg_Phone] [varchar](15) NULL,
[Emerg_RelationID] [int] NULL,
[Decline_Clinical_Summary] [bit] NULL,
[Medication_History_Consent] [bit] NULL,
[Notes] [varchar](300) NULL,
[IsActive] [bit] NULL,
[CreatedOn] [datetime] NULL,
[ModifiedOn] [datetime] NULL,
[UserID] [int] NULL,
[SmokeID] [int] NULL,
[BloodGroupID] [int] NULL,
 CONSTRAINT [PK_PatientDetail] PRIMARY KEY CLUSTERED
(
[PID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO





CREATE TYPE [dbo].[LabReportImegenarys] AS TABLE(
[LRId] [int] NULL,
[FIleType] [varchar](100) NULL,
[FileExtention] [varchar](10) NULL,
[FileUrl] [text] NULL,
[AddedOn] [datetime] NULL,
[ModifiedOn] [datetime] NULL,
[IsActive] [bit] NULL
)
GO


CREATE TYPE [dbo].[LabReports] AS TABLE(
[LRCId] [int] NULL,
[LRTId] [int] NULL,
[Title] [varchar](200) NULL,
[LabName] [varchar](200) NULL,
[LabAddress] [varchar](400) NULL,
[LabContactNo] [varchar](15) NULL,
[LabEmail] [varchar](200) NULL,
[LabUserName] [varchar](200) NULL,
[Details] [varchar](500) NULL,
[DetailsData] [nvarchar](max) NULL,
[PID] [int] NULL,
[ReportDate] [datetime] NULL,
[AddedOn] [datetime] NULL,
[ModifiedOn] [datetime] NULL,
[IsActive] [bit] NULL
)
GO




Create PROCEDURE [dbo].[sp_InsertLabReports]
(
@LabReport LabReports readonly,
@LabReportImegenarys  LabReportImegenarys readonly
)
AS
BEGIN
BEGIN TRANSACTION;
    SAVE TRANSACTION MySavePoint;
    BEGIN TRY

      SET NOCOUNT ON;
declare @ReportID int;
 
      INSERT INTO [dbo].[LabReport]
           ([LRCId]
           ,[LRTId]
           ,[Title]
           ,[LabName]
           ,[LabAddress]
           ,[LabContactNo]
           ,[LabEmail]
           ,[LabUserName]
           ,[Details]
           ,[DetailsData]
           ,[PID]
           ,[ReportDate]
           ,[AddedOn]
           ,[ModifiedOn]
           ,[IsActive])
      SELECT LRCId
           ,LRTId
           ,Title
           ,LabName
           ,LabAddress
           ,LabContactNo
           ,LabEmail
           ,LabUserName
           ,Details
           ,DetailsData
           ,PID
           ,ReportDate
           ,AddedOn
           ,ModifiedOn
           ,IsActive  FROM @LabReport

set @ReportID=IDENT_CURRENT('LabReport')

INSERT INTO [dbo].[LabReportImegenary]
           ([LRId]
           ,[FIleType]
           ,[FileExtention]
           ,[FileUrl]
           ,[AddedOn]
           ,[ModifiedOn]
           ,[IsActive]) SELECT @ReportID,FIleType,FileExtention,FileUrl,AddedOn,ModifiedOn,IsActive from @LabReportImegenarys


 END TRY
    BEGIN CATCH
        IF @@TRANCOUNT > 0
        BEGIN
            ROLLBACK TRANSACTION MySavePoint; -- rollback to MySavePoint
        END
    END CATCH
    COMMIT TRANSACTION
END;



        [ResponseType(typeof(Response<PatientLabReportViewModel>))]
        public IHttpActionResult PostPatientLabReport(PatientLabReportViewModel patientLabReportViewModel)
        {

            var file = HttpContext.Current.Request.Files.Count > 0 ? HttpContext.Current.Request.Files : null;
            string PatientPicture = Utils.ConfigKey("PatientLabReportImages");
            List<LabReportImagneriesModal> labReportImagneriesModal = new List<LabReportImagneriesModal>();
            string PictureName = "";
            var path = "";
            string oldpath = null;
            int count = -1;
            if (!ModelState.IsValid)
            {
                if (HttpContext.Current.Request.Form != null)
                {
                    patientLabReportViewModel = new PatientLabReportViewModel();
                    patientLabReportViewModel.labReport.Id = HttpContext.Current.Request.Form["Id"].ToSafeInt();
                    patientLabReportViewModel.labReport.PID = HttpContext.Current.Request.Form["PID"].ToSafeInt();
                    patientLabReportViewModel.labReport.Details = HttpContext.Current.Request.Form["Details"].ToSafeString();
                    patientLabReportViewModel.labReport.DetailsData = HttpContext.Current.Request.Form["DetailsData"].ToSafeString();
                    patientLabReportViewModel.labReport.LabAddress = HttpContext.Current.Request.Form["LabAddress"].ToSafeString();
                    patientLabReportViewModel.labReport.LabContactNo = HttpContext.Current.Request.Form["LabContactNo"].ToSafeString();
                    patientLabReportViewModel.labReport.LabEmail = HttpContext.Current.Request.Form["LabEmail"].ToSafeString();
                    patientLabReportViewModel.labReport.LabName = HttpContext.Current.Request.Form["LabName"].ToSafeString();
                    patientLabReportViewModel.labReport.LRCId = HttpContext.Current.Request.Form["LRCId"].ToSafeInt();
                    patientLabReportViewModel.labReport.AddedOn = DateTime.Now;
                    patientLabReportViewModel.labReport.ModifiedOn = DateTime.Now;
                    patientLabReportViewModel.labReport.IsActive = true;
                    patientLabReportViewModel.labReport.LRTId = HttpContext.Current.Request.Form["LRTId"].ToSafeInt();
                    patientLabReportViewModel.labReport.ReportDate = Convert.ToDateTime(HttpContext.Current.Request.Form["ReportDate"]);
                    patientLabReportViewModel.labReport.Title = HttpContext.Current.Request.Form["Title"].ToSafeString();

                }
                else
                {
                    return Ok(new Response<PatientLabReportViewModel>(404, "Patient Report Not Valid", false, new PatientLabReportViewModel()));
                }
            }
            else
            {
                if (patientLabReportViewModel != null)
                {

                    patientLabReportViewModel.labReport.AddedOn = DateTime.Now;
                    patientLabReportViewModel.labReport.ModifiedOn = DateTime.Now;
                    patientLabReportViewModel.labReport.IsActive = true;

                }
                else
                {
                    return Ok(new Response<PatientLabReportViewModel>(404, "Patient Emergancy Contact Not Valid", false, new PatientLabReportViewModel()));
                }
            }



            if (patientLabReportViewModel.labReport.Id == 0)
            {
                foreach (HttpPostedFile file_item in file)
                {
                    if (file_item != null && file_item.ContentLength > 0)
                    {
                        var uniqid = Guid.NewGuid();
                        FileInfo f1 = new FileInfo(file_item.FileName);
                        string ext = !(string.IsNullOrEmpty(f1.Extension)) ? f1.Extension : ".png";
                        PictureName = uniqid.ToSafeString() + "_" + JavaScriptDateConverter.Convert(DateTime.Now) + "_" + patientLabReportViewModel.labReport.PID + ext;
                        path = System.IO.Path.Combine(
                            HttpContext.Current.Server.MapPath(PatientPicture),
                            PictureName
                        );
                        labReportImagneriesModal.Add(new LabReportImagneriesModal { Id = 0, LRId = 0,file=file_item,FileExtention= f1.Extension, PictureName=PictureName,FIleType= MimeMapping.GetMimeMapping(file_item.FileName), FileUrl= path, AddedOn = DateTime.Now, ModifiedOn = DateTime.Now, IsActive = true });
                     
                    }
                }

            }
            DataTable dt = new DataTable();
            DataTable dt1 = new DataTable();
            dt.Columns.AddRange(new DataColumn[17]
            {
                    new DataColumn("Id", typeof(int)),
                    new DataColumn("PID", typeof(int)),
                    new DataColumn("Details",typeof(string)),
                     new DataColumn("LRCId", typeof(int)),
                    new DataColumn("LRTId", typeof(int)),
                    new DataColumn("Title",typeof(string)),
                     new DataColumn("LabName", typeof(string)),
                    new DataColumn("LabAddress", typeof(string)),
                    new DataColumn("LabContactNo",typeof(string)),
                      new DataColumn("LabEmail", typeof(string)),
                    new DataColumn("LabUserName", typeof(string)),
                    new DataColumn("Details",typeof(string)),
                     new DataColumn("DetailsData", typeof(string)),
                    new DataColumn("ReportDate",typeof(DateTime)),
                     new DataColumn("AddedOn", typeof(DateTime)),
                      new DataColumn("ModifiedOn",typeof(bool)),
                     new DataColumn("IsActive", typeof(bool)),
           });
   
            dt1.Columns.AddRange(new DataColumn[7]
            {
                    new DataColumn("LRId", typeof(int)),
                    new DataColumn("FIleType", typeof(int)),
                    new DataColumn("FileExtention",typeof(string)),
                     new DataColumn("FileUrl", typeof(int)),
                    new DataColumn("AddedOn", typeof(int)),
                    new DataColumn("ModifiedOn",typeof(string)),
                     new DataColumn("IsActive", typeof(string))
               
            });

            dt.Rows.Add(patientLabReportViewModel.labReport.Id,patientLabReportViewModel.labReport.PID,patientLabReportViewModel.labReport.Details,patientLabReportViewModel.labReport.LRCId,patientLabReportViewModel.labReport.LRTId,patientLabReportViewModel.labReport.Title,patientLabReportViewModel.labReport.LabName,patientLabReportViewModel.labReport.LabAddress,patientLabReportViewModel.labReport.LabContactNo,patientLabReportViewModel.labReport.LabEmail,patientLabReportViewModel.labReport.LabUserName,patientLabReportViewModel.labReport.Details,patientLabReportViewModel.labReport.DetailsData,patientLabReportViewModel.labReport.ReportDate,patientLabReportViewModel.labReport.AddedOn,patientLabReportViewModel.labReport.ModifiedOn,patientLabReportViewModel.labReport.IsActive);

            foreach (var i in labReportImagneriesModal)
            {
                dt1.Rows.Add(i.LRId, i.FIleType, i.FileExtention, i.FileUrl, i.AddedOn, i.ModifiedOn, i.IsActive);
            }

            if (dt.Rows.Count > 0)
            {
                string consString = ConfigurationManager.ConnectionStrings["sqlConString"].ConnectionString;
                using (SqlConnection con = new SqlConnection(consString))
                {
                    using (SqlCommand cmd = new SqlCommand("sp_InsertLabReports"))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Connection = con;
                        cmd.Parameters.AddWithValue("@LabReport", dt);
                        cmd.Parameters.AddWithValue("@LabReportImegenarys", dt1);
                        con.Open();
                        count=cmd.ExecuteNonQuery();
                        con.Close();
                    }
                }
            }

            if(count>0)
            {
                foreach (var f in labReportImagneriesModal)
                {
                    if (!string.IsNullOrEmpty(f.FileUrl))
                    {
                        //file.SaveAs(path);
                        Utils.SaveFile(f.file, HttpContext.Current.Server.MapPath(PatientPicture), f.PictureName);
                    }
                }
                return Ok(new Response<PatientLabReportViewModel>(200, "Patient Emergancy Contact Sucessfull Register", true, patientLabReportViewModel));
            }
            else
            return Ok(new Response<PatientLabReportViewModel>(404, "Patient Report Not Valid", false, new PatientLabReportViewModel()));




        }


 public class PatientLabReportViewModel
    {
     public LabReport labReport { set; get; }
     public List< LabReportImegenary> labReportImegenaries{ set; get; }
    }

 public class LabReportImagneriesModal
    {
        public HttpPostedFile file { set; get; }
        public string PictureName{ set; get; }
        public int Id { get; set; }
        public Nullable<int> LRId { get; set; }
        public string FIleType { get; set; }
        public string FileExtention { get; set; }
        public string FileUrl { get; set; }
        public Nullable<System.DateTime> AddedOn { get; set; }
        public Nullable<System.DateTime> ModifiedOn { get; set; }
        public Nullable<bool> IsActive { get; set; }
    }

Featured Post

Sql dynamic query With Join And search using like query with multiple column

Sql dynamic query With Join And search using like query with multiple column declare @keyword varchar(100) DECLARE @sqlCommand va...

Popular Posts