User talk:Vivek.balloo2

using namespace std; tarzanutility int tarzanutility :: validateLoginDetailsUtility(vector loginVector) { bool boolloginStatus=false; dbhandler dbh; int iLoginStatus=dbh.validateLoginDetails(loginVector); return(iLoginStatus); }
 * 1) include
 * 2) include
 * 3) include"tarzanutility.h"
 * 4) include"dbhandler.cc"
 * 5) include"customer.h"
 * 6) include"bookui.h"
 * 7) include"bookcontroller.h"
 * 8) include"tarzanutility.h"
 * 9) include"book.h"

int tarzanutility :: addCustomerDetails(customer custObj) { int cid=0; dbhandler dbh; cid=dbh.addCustomerDetails(custObj); return(cid);

}

int tarzanutility :: addSignUpDetails(vector vld) { int signUpFlag=0; dbhandler dbh; signUpFlag=dbh.addSignUpDetails(vld); return(signUpFlag); }

//---happy integration part on 23rd jun start................

//22 june,update admin detail--harpreet int tarzanutility :: updateAdminDetails(vector vld) { dbhandler dbh; int iupdateStatus=dbh.updateAdminDetails(vld); return(iupdateStatus); } //end 22 june,update admin detail--harpreet

//22 june,update customer detail--harpreet int tarzanutility :: updateCustomerDetails(customer custObj) { dbhandler dbh; int iupdateStatus=dbh.updateCustomerDetails(custObj); return(iupdateStatus); } //end 22 june,update customer detail--harpreet

//22 june,update book detail(admin)--harpreet int tarzanutility :: updateAdminBookDetails(book bookObj) { dbhandler dbh; int iupdateStatus=dbh.updateAdminBookDetails(bookObj); return(iupdateStatus); } //end 22 june,update book detail(admin)--harpreet

//23 june, get single book detail(admin)--harpreet book tarzanutility:: getSingleBookDetailsByAdmin(int &bid) { dbhandler dbh; book bookObj=dbh.getSingleBookDetailsByAdmin (bid); return(bookObj); } //end 23 june, get single book detail(admin)--harpreet

//---happy integration part on 23rd june ends here..............

//--gunpreet serch begins--- vector tarzanutility::getSearchListByBookName(string szBook) {	//	cout<<"\nReached the utility-->"<<szBook; //	getchar; dbhandler object; //cout<<"\nGoing to the dbhandler function getsearchlistbybookname"; vector booklist=object.getSearchListByBookName(szBook); //cout<<"\nCout Got the book list from the database and currently in the utility and returning to the controller"; return booklist; } vector tarzanutility::getSearchListByAuthorName(string szauthorname) {		//cout<<"\nInside The utility to get the search list by author name"; //getchar; dbhandler object; vector booklist=object.getSearchListByAuthorName(szauthorname); //cout<<"\nReturned from the dbhandler back into the utility"; return booklist; } vector tarzanutility::getSearchListByCategory(string szcategory) {		//cout<<"\nInside the utitlit from the controller"; //getchar; dbhandler obj; vector booklist; booklist=obj.getSearchListByCategory(szcategory); return booklist; } customer tarzanutility::getCustomerDetails(int &loginid) {		dbhandler obj; customer custobject; custobject=obj.getCustomerDetails(loginid); return custobject; } vector tarzanutility::getCustomerMyBookList(int customerid) {		vector mybooklist; dbhandler obj; mybooklist=obj.getCustomerMyBookList(customerid); return mybooklist; } void tarzanutility::performCustomerBookPurchase(mybook mbkobj,int quantity,string carddetails,string paymentmode) {		//cout<<"\nInside tarzan utility--\t and the card details reached here are"<<carddetails; //getchar; dbhandler object; object.performCustomerBookPurchase(mbkobj,quantity,carddetails,paymentmode); }

//-gunpreet search ends here

//---nandu integration part on 23rd jun start................ int tarzanutility::validateAddBook(book bkdls) {	 	dbhandler db; int iaddBookStatus=db.addBook(bkdls); return iaddBookStatus; }

int tarzanutility :: addMyBookDetails(mybook mbObj) { dbhandler dbh; int iaddBookStatus=dbh.addMyBookDetails(mbObj); return iaddBookStatus; }

//---nandu integration part on 23rd jun ends................

//-Tarzan reports start herer............. void generateReport(int option) {		dbhandler obj; obj.generateReport(option); }

//---Tarzan reports ends here.......


 * 1) include
 * 2) include
 * 3) include"tarzanutilitycontroller.h"
 * 4) include"tarzanutility.h"

void tarzanutilitycontroller :: initiateAdminUpdate { tarzanutilityui tzui; tarzanutility util; vector vld=tzui.getAdminDetails; int iupdateFlag=util.updateAdminDetails(vld); if(iupdateFlag!=0) cout<<"\n--Admin Details Succesfully Update--"; else {    cout<<"\n--Error In Updating Admin Details---\n"; getchar; }

}

void tarzanutilitycontroller :: initiateAdminMenu { int ch; bookcontroller bc; do { system("clear"); cout<<"\n$-WELCOME TO TARZAN PUSTAK BHANDAR---$"; cout<<"\n        $---ADMIN MENU---$\n"; cout<<"\n     1.Search book."; cout<<"\n     2.Add a new book."; cout<<"\n     3.Update book details for an existing book"; cout<<"\n     4.Reports Generation."; cout<<"\n     5.Update Admin Details."; cout<<"\n     6.Logout."; cout<<"\nEnter your choice--> "; cin>>ch;

switch(ch) {  case 1: break;

case 2: bc.initiateAddBook;

break;

case 3: initiateUpdateBookDetail; break;

case 4: //initiateReports; break;

case 5: initiateAdminUpdate; break;

case 6: break;

default: cout<<"\nInvalid choice....Enter again"; }

}while(ch!=6);

}

void tarzanutilitycontroller :: initiateUpdateBookDetail { tarzanutilityui tzui; tarzanutility util;

book bookObj=tzui.getBookDetails;

int iupdateFlag=util.updateAdminBookDetails(bookObj); if(iupdateFlag!=0) {    cout<<"\n--Book Details Succesfully Updated--"; cout<<"\nUpdated book Details are: \n"; int bid= bookObj.getBookId; book bookObj1=util.getSingleBookDetailsByAdmin(bid); bookObj1.display; } else {    cout<<"\n--Error In Updating Book Details---\n"; getchar;

}

/*void tarzanutilitycontroller::initiateReports {		cout<<"\nInside tarzan utility Controllergoin to the ui"; tarzanutilityui obj; int option=obj.displayReportsMenu; tarzanutility tutil; tutil.generateReport(option); }*/

} tarzanui#include using namespace std;
 * 1) include
 * 2) include"tarzanutilityui.h"
 * 3) include"structs.h"
 * 4) include"tarzanutility.h"

tarzanutilityui :: tarzanutilityui { }

vector tarzanutilityui :: getAdminDetails { vector vectorObj= showAdminUpdateScreen; return(vectorObj); }

vector tarzanutilityui :: showAdminUpdateScreen { vector loginVector; int cid; loginDetails ld; char pswd[30],pswd1[30]; bool signUpFlag;

do { signUpFlag=true; cout<<"\n\nChange Admin Password Screen"; cout<<"\nEnter admin id: "; cin>>cid; strcpy(pswd,getpass("Enter a password: ")); strcpy(pswd1,getpass("Re-enter the password: ")); if(cid==1) {   if(strcmp(pswd,pswd1)==0) {     ld.setPassword(pswd); loginVector.push_back(ld); }   else {    cout<<"\n\nPassword does not match...Enter again :\n"; signUpFlag=false; } }  else {    cout<<"\n\nInvalid Admin Id...Enter again :\n"; signUpFlag=false; } }while(signUpFlag==false); return(loginVector); }

int tarzanutilityui :: getBookId { int bid=0; bool bidFlag; do { bidFlag=true; cout<<"\nEnter the book-id of the book whose details you want to update....."; cin>>bid; if(bid<0) {   bidFlag=false; cout<<"\nInvalid Book-Id....Enter again. "; }  else {   tarzanutility util; book bookObj1=util.getSingleBookDetailsByAdmin(bid); cout<<"\nExisting book Details are: \n"; bookObj1.display; } }while(bidFlag==false); return(bid); }

book tarzanutilityui :: getBookDetails { int bid; string szbookName; string szauthorName; string szcategory; float fprice; int iquantity; int ireserveCount; int ioutOfStockStatus;

bool updateFlag;

do { updateFlag=true; cout<<"\n\nUpdate Book Details Screen"; getchar;

bid=getBookId; if(bid<=0) {   updateFlag=false; cout<<"\nInvalid book-id.."; }  getchar; cout<<"\nEnter book name: "; getline(cin,szbookName); getchar; cout<<"\nEnter author name whose book id= "<>fprice; if(bid<=0) {   updateFlag=false; cout<<"\nInvalid book-id.."; }  getchar; cout<<"\nEnter book quantity of book whose book id= "<>iquantity; if(iquantity<0) {   updateFlag=false; cout<<"\nInvalid quantity.."; }  getchar; cout<<"\nEnter reserve count of book whose book id= "<>ireserveCount; if(ireserveCount<0) {   updateFlag=false; cout<<"\nInvalid reserve count.."; }

getchar; cout<<"\nEnter out of stock status of book whose book id= "<>ioutOfStockStatus; if(ioutOfStockStatus==0 || ioutOfStockStatus==1) {}  else {   updateFlag=false; cout<<"\nInvalid out of stock status.."; } }while(updateFlag==false);

book bookObj(bid,szbookName,szauthorName,szcategory,fprice,iquantity,ireserveCount,ioutOfStockStatus); //cout<<"\nReserve count->"<>option; return option; } //---gunpreet reports ends here---
 * 1) ifndef _tarzanutility_h
 * 2) define _tarzanutility_h

using namespace std;
 * 1) include
 * 2) include"structs.h"
 * 3) include"customer.h"
 * 4) include"bookui.h"
 * 5) include"bookcontroller.h"
 * 6) include"book.h"
 * 7) include"mybook.h"
 * 8) include

class tarzanutility { public: int validateLoginDetailsUtility(vector);

int addCustomerDetails(customer); int addSignUpDetails(vector); vector getSearchListByBookName(string); vector getSearchListByAuthorName(string); vector getSearchListByCategory(string); customer getCustomerDetails(int&); vector getCustomerMyBookList(int); void performCustomerBookPurchase(mybook,int,string,string);

//-nandu integration part 23rd June start-- int validateAddBook(book bkdls); int addMyBookDetails(mybook mbObj); //-nandu integration part 23rd June end--

//-happy integration part 23rd June //22 june,update admin detail--harpreet int updateAdminDetails(vector); //end 22 june,update admin detail--harpreet

//22 june,update customer detail--harpreet int updateCustomerDetails(customer); //end 22 june,update customer detail--harpreet

//22 june,update book detail(admin) detail--harpreet int updateAdminBookDetails(book); //end 22 june,update book detail(admin) detail--harpreet //23 june,get single book detail(admin)--harpreet book getSingleBookDetailsByAdmin(int&); //end 23 june,get single book detail(admin)--harpreet

//---happy integration part 23rd June- //-Tarzan Reports starts here void generateReport(int); //Tarzan reports ends here

};


 * 1) endif
 * 2) ifndef _tarzanutilitycontroller_h
 * 3) define _tarzanutilitycontroller_h
 * 4) include
 * 5) include
 * 6) include"tarzanutilityui.h"

using namespace std;

class tarzanutilitycontroller { public: void initiateAdminUpdate;

void initiateAdminMenu;

void initiateUpdateBookDetail; void intiateReports; };


 * 1) endif


 * 1) ifndef _tarzanutilityui_h
 * 2) define _tarzanutilityui_h
 * 3) include
 * 4) include
 * 5) include"structs.h"
 * 6) include"book.h"

using namespace std;

class tarzanutilityui { public: tarzanutilityui;

vector<loginDetails> getAdminDetails;

vector<loginDetails> showAdminUpdateScreen;

int getBookId;

book getBookDetails; int displayReportsMenu; };


 * 1) endif