User:Vivek.balloo1

using namespace std; /*class bookcontroller{*/ bookcontroller::bookcontroller {		//	cout<<"Inside the bookcontrollers constructor"; } /*bookcontroller::bookcontroller {}*/	void bookcontroller::initiateSearchProcess {			//cout<<"\nInside the initiate search process function"; //getchar; bookui obj; int choice; int loopstatus=1; while(loopstatus) {					//cout<<"\nGoin to book ui to fetch the search option"; choice=obj.getSearchDetails; switch(choice) {							case 1: {									//cout<<"\nOption 1 selected now enter the further details"; string szbookName; //cout<<"\nSearching Book By Book Name......"; //getchar;
 * 1) include
 * 2) include"bookui.h"
 * 3) include"bookcontroller.h"
 * 4) include"tarzanutility.h"
 * 5) include"bookcontroller.h"
 * 6) include"bookui.h"
 * 7) include
 * 8) include

string szmsg="Enter the name of the book to search"; szbookName=obj.getUserSearchString(szmsg); //cout<<"\nGoing to getsearch list by book name function in controllerwith the users string->"<<szbookName; vector booklist=getSearchListByBookName(szbookName);//This function would return ddetails of the cooks searched from the book table so we will write the variable and it's type that will be returned later. //cout<<"\nReached controller back from utility"; //	getchar; bookui object; object.displaySearchResult(booklist); //cout<<""; break; }							case 2: {									string szauthorname; //cout<<"\nOption 2 selected"; string szmsg="Enter the name ofthe aurthor"; szauthorname=obj.getUserSearchString(szmsg); vector booklist; tarzanutility utilityobj; booklist=utilityobj.getSearchListByAuthorName(szauthorname); //cout<<"\nReached the utility back from the dbhandler and stopping the output here"; //getchar; bookui object; object.displaySearchResult(booklist); break; }							case 3: {									//cout<<"\nOption 3 Selected"; string szsearchstring; string szmsg="Enter the category for which books are to be searched"; szsearchstring=obj.getUserSearchString(szmsg); tarzanutility utilityobj; vector booklist; booklist=utilityobj.getSearchListByCategory(szsearchstring); bookui object; object.displaySearchResult(booklist); break; }							case 4: {										loopstatus=0; break; }				}		}	}	vector bookcontroller::getSearchListByBookName(string szquery) {			//cout<<"\nInside get search list by bookname in the controlleri->with user input--->"<<szquery; //getchar; tarzanutility obj; //cout<<"\nGoing to the same function in the tarzan utility"; vector booklist=obj.getSearchListByBookName(szquery); //dbhandler obj; //obj.getSearchListByBookName(szquery); return booklist; }	vector bookcontroller::initiateSearchProcessRegistered(book &bookobject) {			bookui obj; int once=0; vector returnoptions; int choice; int loopstatus=1; while(loopstatus) {					if(once==1) {							break; }					//cout<<"\nGoin to book ui to fetch the search option"; choice=obj.getSearchDetails; switch(choice) {							case 1: {									//once=1//used to break the while loop if user selects the options for searching further....; //cout<<"\nOption 1 selected now enter the further details"; string szbookName; //cout<<"\nSearching Book By Book Name......"; //getchar; string szmsg="Enter the name of the book to search"; szbookName=obj.getUserSearchString(szmsg); //cout<<"\nGoing to getsearch list by book name function in controller"	; vector booklist=getSearchListByBookName(szbookName);//This function would return ddetails of the cooks searched from the book table so we will write the variable and it's type that will be returned later. cout<<"\nReached controller back from utility"; getchar; bookui object; object.displaySearchResult(booklist); cout<<"\nGoinf to get the extention options"; getchar; returnoptions=getCustomerSearchExtentionOptions;									cout<<"\nReturned from the extendion optrions with the topion>"<<returnoptions[0]; if(returnoptions[0]!=3) {once=1; int bookindex=returnoptions[1]-1; bookobject=booklist[bookindex]; }									break; }							case 2: {									once=1; string szauthorname; //cout<<"\nOption 2 selected"; string szmsg="Enter the name ofthe aurthor"; szauthorname=obj.getUserSearchString(szmsg); vector booklist; tarzanutility utilityobj; booklist=utilityobj.getSearchListByAuthorName(szauthorname); //cout<<"\nReached the utility back from the dbhandler and stopping the output here"; //getchar; bookui object; object.displaySearchResult(booklist); returnoptions=getCustomerSearchExtentionOptions; //int bookindex=returnoptions[1]-1; //bookobject=booklist[bookindex]; if(returnoptions[0]!=3) {	once=1; int bookindex=returnoptions[1]-1; bookobject=booklist[bookindex]; }									break; }							case 3: {									once=1; //cout<<"\nOption 3 Selected"; string szsearchstring; string szmsg="Enter the category for which books are to be searched"; szsearchstring=obj.getUserSearchString(szmsg); tarzanutility utilityobj; vector booklist; booklist=utilityobj.getSearchListByCategory(szsearchstring); bookui object; object.displaySearchResult(booklist); returnoptions=getCustomerSearchExtentionOptions; // int bookindex=returnoptions[1]-1; //bookobject=booklist[bookindex]; //if (returnoptions[0]!=3) //	once=1;

if(returnoptions[0]!=3) {      once=1; int bookindex=returnoptions[1]-1;   ; bookobject=booklist[bookindex   ]; }

break; }							case 4: {										loopstatus=0; break; }						}				}		 return returnoptions; }

vector bookcontroller::getCustomerSearchExtentionOptions {		vector returnoptions; cout<<"\nInside the customer search extention options method"		; bookui object; getchar; returnoptions=object.displayCustomerSearchConditions; getchar; cout<<"\nUser returned options"; cout<<"\nThe book serial no"<"<<returnoptions[2]; cout<<"\nReturning values to "; return returnoptions; }

//nandu intergration 23 jun starts-- void bookcontroller::initiateAddBook {	 	bookui bkui; tarzanutility util; book bk=bkui.getBookDetails; int ibokaddFlag=util.validateAddBook(bk); if(ibokaddFlag!=0) {		cout<<"\n --book saved successfully --"; }		else {				cout<<"\n --not inserted-"; getchar; }	}

//nandu intergration 23 jun ends--