musical theater, cabaret, folk, roots, jazz, gospel, Latin, new age and more. It is
important .... make copies (in sheet music or recorded form) of a copyrighted work
.
Feb 23, 2017 - Keywords: sound processing, formants, Mel frequency cepstral coefficients, pro- ..... To do the calculation of the MFCC, the Python implemen-.
Ernie and Pinata trailers and teeth teurist and agrieulterai ... enema alienated hr each member at the green, ... areas in Shetland and Spain is green in Table. 3.
Oct 8, 2015 - Caucasian, five as Hispanic/Latino, and three Caucasian/Hispanic .... which included a team of three psychiatrists trained .... link between localized cortical dysfunctions and ... the full round of sessions or completing the final ....
GIS-based monitoring and information system is ... database management system (PostgreSQL / .... enables PostgreSQL to deal with geographical data in vector ...
Jan 4, 2011 - Setting: A provincial laboratory registry in Alberta, Canada, and a representative sample ... In 2002, the National Kidney Foundation Kidney Dis-.
Researchers analyzed teacher candidates' rationales for incorporating ICT into .... ways, which included enabling graphical representations, allowing concepts to be ...... Candidates use Vernier probeware, digital microscopes, Kidspiration, or.
compute the solution with great accuracy in a few minutes on a computer at home
, and to readily ... Data analysis, exploration, and visualization. • Scientific and ...
signal processing, control systems, neural networks, fuzzy logic, wavelets,
sim
Take. Charge! of the new future. Using CARWINGS'". Contents. Enroll a Nissan
LEAF customer in CARWINGS . . . . . .. 2 Update charging station information .
Customizing the Dreamweaver CS5 workspace . ... Chapter 3: Working with
Dreamweaver sites .... Cloaking files and folders in your Dreamweaver site .
Not every thesis has a literature review, but every thesis writer has to write about
literature, showing how his or her work relates to others'. (Murray, R. (2002) ...
Adding editorial notes in InDesign . .... Chapter 10: Long document features.
Creating book files ..... Preparing PDFs for service providers.
MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are
registered trademarks ... January 1998 Revised for Simulink 2.2 (online version).
2004 by Perseus Books; A Million Little Pieces ... James Frey, and the Question
of Truth” from Three Degrees of Separation, Network #1by Rev. Mark D. Roberts
...
About ZWCAD and other CAD software .......................................................... ...
Comparing ZWCAD drawing with manual drafting. ... Using advanced CAD
features .
Using Keynotes. Architectural Drafting. Using AutoCAD. Copyright by Goodheart-
Willcox Co., Inc. Using Keynotes. S u p p l e m e n t a l m a t e r I a l. A keynote ...
diameter (Armstrong-James & Millar, 1979) to form a ME with a carbon conductor. These manufacturing techniques produce electrodes with impedances of 200 ...
AbstractâWe study the feasibility of achieving 0.8-b/s/Hz spectral efficiency at 160 Gb/s. We generate phase-correlated return-to-zero (RZ) signals by utilizing ...
We would like to submit the manuscript âUsing picosatellites for 4-D imaging of volcanic clouds: proof of ... bUniversity of Hamburg, Center for Earth System Research and Sustainability, Bundesstr. ...... doi:10.1109/TGRS.2006.873339. 649.
For example, students all over the world used terminal emulation programs to
connect to their schools' computers. They typically used VT100 terminal
emulation, ...
Using ODBC. • The main ideas are presented via a sequence of four annotated C
programs. • These slides provide only supporting information. Context:.
Congratulations on your purchase of the Transformer. Enhanced Vision products
are designed to give you the highest quality and convenience available.
Second, a formal model must contain things that are typ- ... A data object with global scope can be referred to by all processes. .... A message field of type chan, can be used to pass a channel identifier through a channel from one process.
âThis excellent team of content experts address not only a range of technologies and their uses, but also the legal and ethical considerations to which ...
Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Text. ...... Convert.ToString("data:image/png;base64. ,") + base64String;. } catch. { return null;. } ..... var thumbnailImg = new Bitmap(newWidth,. newHeight);.
Using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Text.RegularExpressions; /// /// Summary description for database /// public class database { public database() { } SqlConnection vCon = new SqlConnection(@"Data Source=DELL-3000;Initial Catalog=VMCDB;Integrated Security=True"); public bool isValidEmail(string inputEmail) { string strRegex = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" + @"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" + @".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"; Regex re = new Regex(strRegex); if (re.IsMatch(inputEmail)) return (true); else return (false); } public string ValidateContact(string ContactNo) { string userInput = ContactNo; Regex regexPhoneNumber = new Regex(@"^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$"); if (regexPhoneNumber.IsMatch(userInput)) { return regexPhoneNumber.Replace(userInput, "($1) $2-$3"); } else { return "0"; } } //-----------Function [dbo].[spChangeUserPwd] Starts ---------public String spChangeUserPwd(Decimal UserId, String Pwd, String NewPwd) { System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("[dbo].[spChangeUserPwd]", vCon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@UserId", UserId); cmd.Parameters.AddWithValue("@Pwd", Pwd); cmd.Parameters.AddWithValue("@NewPwd", NewPwd); vCon.Open(); Object t = cmd.ExecuteScalar(); vCon.Close(); return Convert.ToString(t); }//-----------Function [dbo].[spChangeUserPwd] Ends ---------//-----------Function [dbo].[spFetchContenderImage] Starts ---------public DataTable spFetchContenderImage(Decimal ID) {
public void loadNav(int i ) { switch(i) { case 1: navItem1 = "active"; break; case 2: navItem2 = "active"; break; case 3: navItem3 = "active"; break; case 4: navItem4 = "active"; break; case 5: navItem5 = "active"; break; } } protected void LinkButton1_Click(object sender, EventArgs e) { Session.Clear(); Session.Abandon(); Response.Redirect("LogIn.aspx"); } }
1.2.1. ABOUT PAGE The about Page contains a message about the voting system, the motif behind its creation, aims and objectives and slogan.
US
ABOUT
VMC is an advanced multipurpose online voting platform which allows its prestigious users and clients to create their voting desires and by allowing their fans, users, friends and families to vote from the different categories available at their disposal.
VMC indeed gives users the autonomy to create different voting categories which comprises of Sports awards, Films or Movies awards, general elections, fashions awards, Oscar awards, Bollywood awards School elections, Union elections and so on and so forth.
VMC is user-friendly as it has a very simple interface with high definition backgrounds that catches the eyes and attention of its users, it is designed using the best design algorithms which makes it fasters and well optimized.
Our major goal is to make our users cheerful while voting their heart desires and to ensure that their votes and choices are safe-guarded and secured from modification or alteration by hackers or even from our end.
OUR TARGET AUDIENCE
VMC does not segregate any one or any gender. Our platform belongs to everyone and for all the people, people from different background different ethnicity different nations. We welcome you all.
OUR SLOGAN
Vote My Choice, Vote My Desires, Vote My favorites…
GOALS
1.2.2. CATEGORIES PAGE The categories page is the page which contains the lists of all created categories in which the contenders’ lists is situated in. See the code. The Design Code
The Code Behind file using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class Categories : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Master.loadNav(1); loadVoteListCategory(); }
database db = new database(); void loadVoteListCategory() { DataTable vDtCategory = db.spFetchCategoriesAndListCount();
1.2.3. CHANGE PASSWORD PAGE The change password page is the page that handles all the request for changing password in case the user feels like changing the password. Here is the code. The Design Code table { width:100%; } tr , td { margin-bottom:10px; padding-bottom:10px; vertical-align:top; }
Change password of your account
Cuurent Password
New Password
Re-enter New Password
Change Password
The Code Behind file using using using using using using
public partial class ChangePwd : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Master.loadNav(5); } database db = new database(); protected void btnChangePwd_Click(object sender, EventArgs e) { if (txtOldPwd.Text.Trim().Equals(string.Em pty)) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Please Enter Old Password...');", true); txtOldPwd.Focus(); } else if (txtNewPwd.Text.Trim().Equals(string.Em pty)) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Please Enter New Password...');", true); txtNewPwd.Focus(); } else if (txtNewPwd.Text.Trim().Length < 4) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Password Should Be Greater Than Or Equal To 4 Characters Long In Length...');", true);
txtNewPwd.Focus(); } else if (txtNewConfirmPwd.Text.Trim().Equals(st ring.Empty)) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Please Enter New Confirm Password...');", true); txtNewConfirmPwd.Focus(); } else if (!txtNewConfirmPwd.Text.Trim().Equals(t xtNewPwd.Text.Trim())) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Password Does Not Match...');", true); txtNewConfirmPwd.Focus(); } else { string str = db.spChangeUserPwd(Convert.ToDecimal(Se ssion["UserId"]), txtOldPwd.Text, txtNewPwd.Text); if (str.Equals("0")) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Invalid Password ...');", true); } else { Response.Redirect("LogIn.aspx"); } } } }
1.2.6. DEFAULT PAGE The default page is considered to be the main user page, as it contains all the options which allow the users to navigate through the various pages of the system. Here is the code.
1.2.7. LOGIN PAGE The login page serves as the entry door of the system, as it provides the users with an interface which allows them to supply their login credential in order to have full access to the system. The Design Code
1.2.8. RESULT PAGE The result page is that page which displays all the election results which were collated after the election is over. It displays both the name, picture, number of votes and the category in which the contender(s) falls. Here is the code. The Design code
Name
Image
Number Of Votes
The code behind file using using using using using using using
5.2.10. SIGN UP PAGE The signup page is composed of a number of Web controls and validation controls, which are used to take values from the user in preparation for allowing access to the platform. It has textboxes like Name, email, password, address and a submit button. The Source Code
drpVotingList.SelectedIndex = 0; } void LoadContender() { vDt.Columns.Add("Name"); vDt.Columns.Add("Description"); vDt.Columns.Add("Image"); DataTable dt = db.spFetchContenderList(0, Convert.ToDecimal(drpVotingList.Selecte dItem.Value)); for (int i = 0; i < dt.Rows.Count; i++) { vDt.Rows.Add(dt.Rows[i]["Name"].ToStrin g(), dt.Rows[i]["Description"].ToString(),By teToImage((byte[]) dt.Rows[i]["Img"])); } RepeaterContender.DataSource = vDt; RepeaterContender.DataBind(); } public byte[] imageToByteArray(System.Drawing.Image imageIn) { MemoryStream ms = new MemoryStream(); imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif) ; return ms.ToArray(); } public string ByteToImage(byte[] image) { try { Stream fs = new MemoryStream(image); System.IO.BinaryReader br = new System.IO.BinaryReader(fs); Byte[] bytes = br.ReadBytes(Convert.ToInt32(fs.Length) ); string base64String = Convert.ToBase64String(bytes, 0, bytes.Length); return Convert.ToString("data:image/png;base64 ,") + base64String; } catch { return null; } } public void GenerateThumbnails(double scaleFactor, Stream sourcePath, string targetPath) { using (var image = System.Drawing.Image.FromStream(sourceP ath)) {
var newWidth = (int)(image.Width * scaleFactor); var newHeight = (int)(image.Height * scaleFactor); var thumbnailImg = new Bitmap(newWidth, newHeight); var thumbGraph = Graphics.FromImage(thumbnailImg); thumbGraph.CompositingQuality = CompositingQuality.HighQuality; thumbGraph.SmoothingMode = SmoothingMode.HighQuality; thumbGraph.InterpolationMode = InterpolationMode.HighQualityBicubic; var imageRectangle = new Rectangle(0, 0, newWidth, newHeight); thumbGraph.DrawImage(image, imageRectangle); thumbnailImg.Save(targetPath, image.RawFormat); } } byte[] GenerateByte(FileUpload FileUpload1) { byte[] img; string filename = Path.GetFileName(FileUpload1.PostedFile .FileName); Random r = new Random(); string targetPath = "~/images/" + r.Next(100).ToString() + filename; Stream strm = FileUpload1.PostedFile.InputStream; var targetFile = Server.MapPath(targetPath); //Based on scalefactor image size will vary GenerateThumbnails(0.5, strm, targetFile); FileStream fs = new FileStream(Server.MapPath(targetPath), FileMode.Open); //Setting up the variable which can hold bytes from the image img = new byte[fs.Length]; //Read all the bytes from the stream and put into the variable called //img fs.Read(img, 0, Convert.ToInt32(fs.Length)); fs.Close(); File.Delete(Server.MapPath(targetPath)) ; return img; } database db = new database(); protected void btnAddContender_Click(object sender, EventArgs e) { if (drpVotingList.SelectedIndex > 0)
The code behind file using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.IO; public partial class VotingPage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (Session["UserId"] == null) { Response.Redirect("Login.aspx"); } if (Request["VotingListId"] == null) { Response.Redirect("Categories.aspx");
} if (!IsPostBack) { Master.loadNav(1); loadVotingListDetails(); loadContenderOption(); } } public string ByteToImage(byte[] image) { try { Stream fs = new MemoryStream(image); System.IO.BinaryReader br = new System.IO.BinaryReader(fs); Byte[] bytes = br.ReadBytes(Convert.ToInt32(fs.Length) );
"]), ContenderId, txtAnswer.Text.Trim()); if(str.Equals("1")) { ScriptManager.RegisterStartupScript(thi s, this.GetType(), "", "alert('Thanks for your voting.');", true); txtAnswer.Text = string.Empty; } else { ScriptManager.RegisterStartupScript(thi s, this.GetType(), "", "alert('You are not eligible for this vote as you have already voted.');", true); txtAnswer.Text = string.Empty; } } } }
5.2.14. VOTING RESULTS After votes has been cast, the area in which we can view the result is the voting result page. It gives a summary of the contenders and finally the winner. The source code
Following the your voting result, Please click on view Result for more details.
The code behind file using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class VotingHistory : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Master.loadNav(4);
loadVoteListGrids(); } void loadVoteListGrids() { RepeaterVotingListGrid.DataSource = new database().spFetchVoteListForResult(); RepeaterVotingListGrid.DataBind();
} }
5.2.15. STYLE SHEET The Style sheet folder contains the page’s design which includes font style, sizes, header and footer alignment, body contents, logo position, border customization, menu bar, banner settings, icons display, and so on. In addition, the CSS folder contains the bootstrap.css file, and this file is a file which is designed to enable some special features in the web page so that the page can be compatible with any kind of devices.
It does that by shrinking or reducing the pixels of the screen in order to adopt to the new environment.
The server side just as the client side is designed using the same technology and tools. Although, we had to isolate the Admin panel from the other modules. That helps a lot in maintaining accuracy and efficiency. The following are the modules created for the server management panel: 1.3.2. DEFAULT.ASPX This is the main admin panel where all the options are displayed. It contains the dashboard, voting list category, manage voting list, manage users, and settings. The source code
1.3.3. CATEGORY.ASPX This page contains an option beneath it which allows the admin to add/edit category. It also gives the option to activate or deactivate any category. (see fugure) The source code
IsActive
The code behind file using using using using using using
1.3.4. CHANGEPWD.ASPX This page allows the admin to frequently change the password in order to enhance security. It contains three textboxes, enter current password, new password and reenter new password for confirmation and verification. (See figure) The source Code
Change password of your account
Cuurent Password
New Password
Re-enter New Password
Change Password
The code behind file using using using using using using
public partial class ChangePwd : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } database db = new database(); protected void btnChangePwd_Click(object sender, EventArgs e) { if (txtOldPwd.Text.Trim().Equals(string.Em pty)) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Please Enter Old Password...');", true); txtOldPwd.Focus(); } else if (txtNewPwd.Text.Trim().Equals(string.Em pty)) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Please Enter New Password...');", true); txtNewPwd.Focus(); } else if (txtNewPwd.Text.Trim().Length < 4) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Password Should Be Greater Than Or Equal To 4 Characters Long In Length...');", true);
txtNewPwd.Focus(); } else if (txtNewConfirmPwd.Text.Trim().Equals(st ring.Empty)) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Please Enter New Confirm Password...');", true); txtNewConfirmPwd.Focus(); } else if (!txtNewConfirmPwd.Text.Trim().Equals(t xtNewPwd.Text.Trim())) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Password Does Not Match...');", true); txtNewConfirmPwd.Focus(); } else { string str = db.spChangeUserPwd(Convert.ToDecimal(Se ssion["AdminId"]), txtOldPwd.Text, txtNewPwd.Text); if (str.Equals("0")) { ScriptManager.RegisterStartupScript(thi s.Page, this.GetType(), "script", "alert('Invalid Password ...');", true); } else { Response.Redirect("LogIn.aspx"); } } } }
5.3.6. LOGIN.ASPX This login aspx allows the admin to have an entry into the Admin panel by the use of Admin username and password. The source code VMC - Vote My Choice addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); }
5.3.7. MANAGEUSER.ASPX This page allows the Admin to manage all the existing users. It also allows the admin to activate or deactivate any account within the list. The source code
S.No.
Name
Email
Contact
Address
Inactivate
Inactivate
S.No.
Name
Email
Contact
Address
Activate
Activate
The code behind file using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class admin_ManageUsers : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { LoadUserData(); } database db = new database(); void LoadUserData() { RepeaterActiveList.DataSource = db.spFetchUser(true); RepeaterActiveList.DataBind(); RepeaterInactiveList.DataSource = db.spFetchUser(false); RepeaterInactiveList.DataBind(); } protected void LinkButton1_Click(object sender, EventArgs e)
5.3.8. VOTINGREQUEST.ASPX Voting Request page allows the admin to approve or disapprove any voting request sent by the vendor(s). This includes the lists of contenders and their categories for voting. The source code
User ID
User Name
Title
Detail
Start Date
Approve
Approve
The code behind file using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; public partial class admin_ManageUsers : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { Loaddata(); } } database db = new database(); void Loaddata()
Databases are bedrock of every system whether small, medium or big. The name of our database is VMCDB. The back end which is considerered the database or repository is also composed of query structures which defined the various tables, procedures and functions. A collection of all these queries are put together under one single file that is generated from SQL server 2014. The codes are as follows: USE [VMCDB] GO /****** Object: Table [dbo].[CategoryMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[CategoryMaster]( [id] [numeric](18, 0) IDENTITY(1,1) NOT NULL, [CategoryName] [varchar](1000) NULL, [IsActive] [bit] NULL CONSTRAINT [DF_CategoryMaster_IsActive] DEFAULT ((1)), CONSTRAINT [PK_CategoryMaster] 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 SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[ContenderMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[ContenderMaster]( [id] [numeric](18, 0) IDENTITY(1,1) NOT NULL,
[VoteListId] [numeric](18, 0) NULL, [Name] [varchar](100) NULL, [Description] [varchar](1000) NULL, [Img] [image] NULL, [EntryDate] [datetime] NULL CONSTRAINT [DF_ContenderMaster_EntryDate] DEFAULT (getdate()), CONSTRAINT [PK_ContenderMaster] 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 SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[ResultMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[ResultMaster]( [id] [numeric](18, 0) IDENTITY(1,1) NOT NULL, [UserId] [numeric](18, 0) NULL, [VotingId] [numeric](18, 0) NULL, [ContenderId] [numeric](18, 0) NULL, [Answer] [varchar](5000) NULL, [EntryDate] [datetime] NULL, CONSTRAINT [PK_ResultMaster] 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 SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[UserMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[UserMaster]( [id] [numeric](18, 0) IDENTITY(1,1) NOT NULL, [Name] [varchar](100) NULL, [Email] [varchar](100) NULL, [Contact] [varchar](10) NULL, [Pwd] [varchar](100) NULL, [Address] [varchar](1000) NULL, [IsActive] [bit] NULL CONSTRAINT [DF_UserMaster_IsActive] DEFAULT ((1)), [EntryDate] [datetime] NULL CONSTRAINT [DF_UserMaster_EntryDate] DEFAULT (getdate()), CONSTRAINT [PK_UserMaster] 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 SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[VotingListMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO
CREATE TABLE [dbo].[VotingListMaster]( [id] [numeric](18, 0) IDENTITY(1,1) NOT NULL, [UserId] [numeric](18, 0) NULL, [CatId] [numeric](18, 0) NULL, [Title] [varchar](1000) NULL, [Detail] [varchar](4000) NULL, [EntryDate] [datetime] NULL CONSTRAINT [DF_VotingListMaster_EntryDate] DEFAULT (getdate()), [EndDate] [date] NULL, [StartDate] [date] NULL, [IsActive] [bit] NULL CONSTRAINT [DF_VotingListMaster_IsActive] DEFAULT ((1)), [Status] [bit] NULL CONSTRAINT [DF_VotingListMaster_Status] DEFAULT ((0)), CONSTRAINT [PK_VotingListMaster] 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 SET ANSI_PADDING OFF GO ALTER TABLE [dbo].[ResultMaster] ADD CONSTRAINT [DF_ResultMaster_EntryDate] DEFAULT (getdate()) FOR [EntryDate] GO /****** Object: StoredProcedure [dbo].[spApproveVotingRequest] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create Procedure [dbo].[spApproveVotingRequest] ( @id numeric(18,0) ,@Status bit ) As Begin Update [dbo].[VotingListMaster] Set [Status] = @Status Where [id] = @id End
GO /****** Object: StoredProcedure [dbo].[spChangeUserPwd] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create proc [dbo].[spChangeUserPwd] ( @UserId numeric(18,0), @Pwd varchar(1000), @NewPwd varchar(1000) ) as if exists(select id from UserMaster where id=@UserId and pwd=@Pwd and IsActive=1) begin update UserMaster set Pwd=@NewPwd where id=@UserId select '1' end else select '0'
GO SET QUOTED_IDENTIFIER ON GO
GO /****** Object: StoredProcedure [dbo].[spFetchCategoriesAndListCount] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE proc [dbo].[spFetchCategoriesAndListCount] as select cm.id,cm.CategoryName, (select count(id) from VotingListMaster where StartDate>=cast(getdate() as date)and IsActive=1 and Status=0 and CatId=cm.id)as 'upComingList', (select count(id) from VotingListMaster where StartDate>=cast(getdate() as date)and IsActive=1 and Status=1 and CatId=cm.id)as 'activeList' from CategoryMaster cm where cm.IsActive=1
GO /****** Object: StoredProcedure [dbo].[spFetchContender] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO create proc [dbo].[spFetchContender] ( @VoteListId numeric(18,0) ) as select *from ContenderMaster where VoteListId=@VoteListId GO /****** Object: StoredProcedure [dbo].[spFetchContenderImage] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO
GO /****** Object: StoredProcedure [dbo].[spFetchCategory] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON
create proc [dbo].[spFetchCategory] as select *from CategoryMaster GO /****** Object: StoredProcedure [dbo].[spFetchCategoryById] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO create proc [dbo].[spFetchCategoryById] ( @CatID numeric(18,0) ) as select *from CategoryMaster where id=@CatID
create proc [dbo].[spFetchContenderImage]( @ID numeric(18,0) ) as
select img from ContenderMaster where id=@ID GO /****** Object: StoredProcedure [dbo].[spFetchContenderList] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create proc [dbo].[spFetchContenderList] ( @id numeric(18,0), @VoteListId numeric(18,0) ) as if(@id=0) begin select *From ContenderMaster where VoteListId=@VoteListId end else begin select *From ContenderMaster where id=@id and VoteListId=@VoteListId end GO /****** Object: StoredProcedure [dbo].[spFetchUpcomingVoteListForAdmin] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE proc [dbo].[spFetchUpcomingVoteListForAdmin] as select um.id,um.Name,vm.Title,vm.Detail,Convert(v archar(10),vm.StartDate,101) as StartDate,vm.EndDate,vm.id as voteId from VotingListMaster vm,UserMaster um where vm.UserId=um.id and vm.StartDate>=cast(getdate() as date) and vm.Status=0 GO /****** Object: StoredProcedure [dbo].[spFetchUser] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO
SET QUOTED_IDENTIFIER ON GO CREATE proc [dbo].[spFetchUser] ( @IsActive bit ) as if(@IsActive=0) begin select ROW_NUMBER()over (order by id ) as 'rowNumber',id,Name,Email,Contact,Address, IsActive from UserMaster where IsActive=0 end else begin select ROW_NUMBER()over (order by id ) as 'rowNumber',id,Name,Email,Contact,Address, IsActive from UserMaster where IsActive=1 end GO /****** Object: StoredProcedure [dbo].[spFetchVoteListForResult] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO create proc [dbo].[spFetchVoteListForResult] as select id,Title,Detail from VotingListMaster where StartDate=cast(getdate() as date) and Status=@Status and UserId=@UserID end else begin select *From VotingListMaster where id=@id and StartDate>=cast(getdate() as date)and Status=@Status and UserId=@UserID end GO /****** Object: StoredProcedure [dbo].[spFetchVotingListMasterById] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE proc [dbo].[spFetchVotingListMasterById] ( @id numeric(18,0) ) as select id,Title,Detail,Convert(varchar(10),StartDate,1 01)StartDate,Convert(varchar(10),EndDate,10 1)EndDate From VotingListMaster where id=@id and StartDate>=cast(getdate() as date)and Status=1 and IsActive=1 and id=@id
GO /****** Object: StoredProcedure [dbo].[spFetchVotingListMasterForVote] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE proc [dbo].[spFetchVotingListMasterForVote] ( @CatId numeric(18,0), @Mode char(1) ) as if(@Mode='1') begin select *From VotingListMaster where StartDate>=cast(getdate() as date) and Status=1 and IsActive=1 and CatId=@CatId end else begin select cm.id,cm.CategoryName, (select count(id) from VotingListMaster where StartDate>=cast(getdate() as date)and IsActive=1 and Status=0 and CatId=cm.id)as 'upComingList', (select count(id) from VotingListMaster where StartDate>=cast(getdate() as date)and IsActive=1 and Status=1 and CatId=cm.id)as 'activeList' from CategoryMaster cm where cm.IsActive=1 and cm.id=@CatId end GO /****** Object: StoredProcedure [dbo].[spFtechResultByVoteID] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE proc [dbo].[spFtechResultByVoteID] ( @VoteId numeric(18,0) )as select cm.Name,count(rm.ContenderId) TotalVote,cm.id from VotingListMaster vm,ResultMaster rm,ContenderMaster cm
where vm.id=rm.VotingId and cm.id=rm.ContenderId and vm.id=@VoteId group by cm.Name,cm.id,rm.ContenderId GO /****** Object: StoredProcedure [dbo].[spInsertCategoryMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE Procedure [dbo].[spInsertCategoryMaster] ( @CategoryName varchar(1000) ) As Begin if not exists (select id from CategoryMaster where CategoryName=@CategoryName) begin INSERT INTO [dbo].[CategoryMaster] ( [CategoryName] ) VALUES ( @CategoryName ) select '1' End else select '0' End GO /****** Object: StoredProcedure [dbo].[spInsertContenderMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create Procedure [dbo].[spInsertContenderMaster] ( @VoteListId numeric(18,0) ,@Name varchar(100) ,@Description varchar(1000) ,@Img image )
As Begin INSERT INTO [dbo].[ContenderMaster] ( [VoteListId] ,[Name] ,[Description] ,[Img] ) VALUES ( @VoteListId ,@Name ,@Description ,@Img ) End GO /****** Object: StoredProcedure [dbo].[spInsertResultMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE Procedure [dbo].[spInsertResultMaster] ( @UserId numeric(18,0) ,@VotingId numeric(18,0) ,@ContenderId numeric(18,0) ,@Answer varchar(5000) ) As Begin if not exists(select id from ResultMaster where UserId=@UserId and VotingId=@VotingId) begin INSERT INTO [dbo].[ResultMaster] ( [UserId] ,[VotingId] ,[ContenderId] ,[Answer] ) VALUES ( @UserId ,@VotingId ,@ContenderId ,@Answer
) select '1' End else select '0' end GO /****** Object: StoredProcedure [dbo].[spInsertUserMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE Procedure [dbo].[spInsertUserMaster] ( @Name varchar(100) ,@Email varchar(100) ,@Contact varchar(10) ,@Pwd varchar(100) ,@Address varchar(1000) ) As Begin if not exists (select id from UserMaster where Email=@Email) begin INSERT INTO [dbo].[UserMaster] ( [Name] ,[Email] ,[Contact] ,[Pwd] ,[Address] ) VALUES ( @Name ,@Email ,@Contact ,@Pwd ,@Address ) select '1' End else select '0' End GO /****** Object: StoredProcedure [dbo].[spInsertVotingListMaster] Script Date: 4/13/2016 7:04:47 PM ******/
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create Procedure [dbo].[spInsertVotingListMaster] ( @UserId numeric(18,0) ,@CatId numeric(18,0) ,@Title varchar(1000) ,@Detail varchar(4000) ,@EndDate date ,@StartDate date ) As Begin INSERT INTO [dbo].[VotingListMaster] ( [UserId] ,[CatId] ,[Title] ,[Detail] ,[EndDate] ,[StartDate] ) VALUES ( @UserId ,@CatId ,@Title ,@Detail ,@EndDate ,@StartDate ) End GO /****** Object: StoredProcedure [dbo].[spUpdateCategoryMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE Procedure [dbo].[spUpdateCategoryMaster] ( @id numeric(18,0) ,@CategoryName varchar(1000) ,@IsActive bit ) As Begin
if not exists (select id from CategoryMaster where CategoryName=@CategoryName and id!=@id) begin Update [dbo].[CategoryMaster] Set [CategoryName] = @CategoryName ,[IsActive] = @IsActive Where [id] = @id select '1' End else select '0' end GO /****** Object: StoredProcedure [dbo].[spUpdateUserMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create Procedure [dbo].[spUpdateUserMaster] ( @id numeric(18,0) ,@IsActive bit ) As Begin Update [dbo].[UserMaster] Set [IsActive] = @IsActive Where [id] = @id End GO /****** Object: StoredProcedure [dbo].[spUpdateVotingListMaster] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create Procedure [dbo].[spUpdateVotingListMaster] ( @id numeric(18,0) ,@Status bit ) As Begin
Update [dbo].[VotingListMaster] Set [Status] = @Status Where [id] = @id End GO /****** Object: StoredProcedure [dbo].[spValidateUser] Script Date: 4/13/2016 7:04:47 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE proc [dbo].[spValidateUser] ( @Email varchar(1000), @Pwd varchar(1000) ) as if exists (select id from UserMaster where Email=@Email and Pwd=@Pwd and IsActive=1) begin select id,Name from UserMaster where Email=@Email and Pwd=@Pwd end else select '0' GO