public bool updateToDatabase(SalesLead existingSalesLead) { string sqlUpdateCustomer = "UPDATE `salesleads`.`customerproduct` SET `CustomerID` = '" + existingSalesLead.Customer.CustomerID + "',`ProductID` = '" + existingSalesLead.Product.ProductID + "', `IssueDate` = " + Rules.toSQLDate(existingSalesLead.getSalesActivity(ActivityType.SalesIssue).ActivityDate) + ", `RevenueType` = '" + existingSalesLead.RevenueType + "', `MonthlyRevenue` = '" + existingSalesLead.MonthlyRevenue + "', `HadTest` = '" + Rules.boolToYesNo(existingSalesLead.HadTest) + "', `ProjectRevenue` = '" + existingSalesLead.ProjectRevenue + "', `ProjectPaid` = '" + existingSalesLead.ProjectPaid + "', `CustomerConfirmDate` = " + Rules.toSQLDate(existingSalesLead.getSalesActivity(ActivityType.CustomerConfirm).ActivityDate) + ",`PurchaseOrderLocation`=?FileData, `AgreementSignDate` = " + Rules.toSQLDate(existingSalesLead.getSalesActivity(ActivityType.AgreementSign).ActivityDate) + ", `DSP` = " + Rules.toSQLDate(existingSalesLead.getSalesActivity(ActivityType.DSP).ActivityDate) + ", `FirstBillIssued` = '" + existingSalesLead.getSalesActivity(ActivityType.BillIssue).ActivityDetails + "', `BillIssueDate` = " + Rules.toSQLDate(existingSalesLead.getSalesActivity(ActivityType.BillIssue).ActivityDate) + ", `SuccessfullClose` = '" + existingSalesLead.getSalesActivity(ActivityType.SalesClose).ActivityDetails + "', `ClosedDate` = " + Rules.toSQLDate(existingSalesLead.getSalesActivity(ActivityType.SalesClose).ActivityDate) + ", `DisconnectedDate` = " + Rules.toSQLDate(existingSalesLead.getSalesActivity(ActivityType.Disconect).ActivityDate) + ", `DisconnectReason` = '" + existingSalesLead.getSalesActivity(ActivityType.Disconect).ActivityDetails + "', `CoustomerFeedBack` = '" + existingSalesLead.CustomerFeedBack + "', `Discount` = '" + existingSalesLead.Discount + "', `Notes` = '" + existingSalesLead.Notes + "' WHERE `customerproduct`.`SalesLeadsID` = " + existingSalesLead.SalesID + ";"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlUpdateCustomer, "?FileData", existingSalesLead.PurchaseOrderData); DBLink.closeConnection(); return(result); }
public bool addToDatabase(Comment newComment) { string sqlAddComment = "INSERT INTO `salesleads`.`comment` (`Content`, `UserName`, `SalesLeadsID`, `PostDate`, `RealName`) VALUES ('" + newComment.Content + "', '" + newComment.UserName + "', " + newComment.SalesleadsID + ", " + Rules.toSQLDate(newComment.PostDate) + ", '" + newComment.RealName + "');"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlAddComment); DBLink.closeConnection(); return(result); }
public bool addToDatabase(SalesLead newSalesLead) { string sqlAddCustomer = "INSERT INTO `salesleads`.`customerproduct` (`SalesLeadsID`,`CustomerID`, `ProductID`, `IssueDate`, `RevenueType`, `MonthlyRevenue`, `HadTest`, `ProjectRevenue`,`ProjectPaid`, `CustomerConfirmDate`, `PurchaseOrderLocation`, `AgreementSignDate`,`DSP`,`FirstBillIssued`,`BillIssueDate`,`SuccessfullClose`,`ClosedDate`,`DisconnectedDate`,`DisconnectReason`,`CoustomerFeedBack`,`Discount`,`Notes`) VALUES (NULL, '" + newSalesLead.Customer.CustomerID + "', '" + newSalesLead.Product.ProductID + "', " + Rules.toSQLDate(newSalesLead.getSalesActivity(ActivityType.SalesIssue).ActivityDate) + ", '" + newSalesLead.RevenueType + "', '" + newSalesLead.MonthlyRevenue + "', '" + Rules.boolToYesNo(newSalesLead.HadTest) + "', '" + newSalesLead.ProjectRevenue + "', '" + newSalesLead.ProjectPaid + "', " + Rules.toSQLDate(newSalesLead.getSalesActivity(ActivityType.CustomerConfirm).ActivityDate) + ", ?FileData, " + Rules.toSQLDate(newSalesLead.getSalesActivity(ActivityType.AgreementSign).ActivityDate) + ", " + Rules.toSQLDate(newSalesLead.getSalesActivity(ActivityType.DSP).ActivityDate) + ", '" + newSalesLead.getSalesActivity(ActivityType.BillIssue).ActivityDetails + "', " + Rules.toSQLDate(newSalesLead.getSalesActivity(ActivityType.BillIssue).ActivityDate) + ", '" + newSalesLead.getSalesActivity(ActivityType.SalesClose).ActivityDetails + "', " + Rules.toSQLDate(newSalesLead.getSalesActivity(ActivityType.SalesClose).ActivityDate) + ", " + Rules.toSQLDate(newSalesLead.getSalesActivity(ActivityType.Disconect).ActivityDate) + ", '" + newSalesLead.getSalesActivity(ActivityType.Disconect).ActivityDetails + "', '" + newSalesLead.CustomerFeedBack + "', '" + newSalesLead.Discount + "', '" + newSalesLead.Notes + "');"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlAddCustomer, "?FileData", newSalesLead.PurchaseOrderData); DBLink.closeConnection(); return(result); }
public bool addToDatabase(Product newProduct) { string sqlAddCustomer = "INSERT INTO `salesleads`.`product` (`ProductID`, `ProductName`, `Category`, `InitialPrice`, `ProductDetails`) VALUES (NULL, '" + newProduct.ProductName + "', '" + newProduct.ProductCategory + "', '" + newProduct.InitialPrice + "', '" + newProduct.ProductDetails + "');"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlAddCustomer); DBLink.closeConnection(); return(result); }
public bool updateToDatabase(Product existingProduct) { string sqlUpdateCustomer = "UPDATE `salesleads`.`product` SET `ProductName` = '" + existingProduct.ProductName + "', `Category` = '" + existingProduct.ProductCategory + "', `InitialPrice` = '" + existingProduct.InitialPrice + "', `ProductDetails` = '" + existingProduct.ProductDetails + "' WHERE `product`.`ProductID` = " + existingProduct.ProductID + ";"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlUpdateCustomer); DBLink.closeConnection(); return(result); }
public bool updateToDatabase(User existingUser) { string sqlUpdateUser = "******" + existingUser.Name + "', `Permissions` = '" + existingUser.Permissions + "', `UserRating` = '" + existingUser.UserRating + "', `SalingsPerMonth` = '" + existingUser.MonthlyRevnue + "', `Predecessor` = '" + existingUser.Predecessor + "', `Notes` = '" + existingUser.Notes + "' WHERE `user`.`UserName` = '" + existingUser.UserName + "';"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlUpdateUser); DBLink.closeConnection(); return(result); }
public bool updateToDatabaseQuotationData(Quotation existingQuotation) { string sqlUpdateQuotation = "UPDATE `salesleads`.`quatation` SET `QuotationLocation` = ?FileData WHERE `quatation`.`QuatationID` = " + existingQuotation.QuotationID + ";"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlUpdateQuotation, "?FileData", existingQuotation.QuotationData); DBLink.closeConnection(); return(result); }
public bool addToDatabase(User newUser) { string sqlAddUser = "******" + newUser.UserName + "', '" + newUser.Name + "', '" + newUser.Permissions + "', '" + newUser.UserRating + "', '" + newUser.MonthlyRevnue + "','" + newUser.Predecessor + "', '" + newUser.Notes + "');"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlAddUser); DBLink.closeConnection(); return(result); }
public bool addToDatabase(Quotation newQuotation) { string sqlAddQuotation = "INSERT INTO `salesleads`.`quatation` (`SalesLeadsID`, `QuatationDate`, `QuotationStatus`, `QuotationLocation`) VALUES ('" + newQuotation.SalesleadID + "', " + Rules.toSQLDate(newQuotation.QuotationDate) + ", '" + newQuotation.QuotationStatus + "', ?FileData);"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlAddQuotation, "?FileData", newQuotation.QuotationData); DBLink.closeConnection(); return(result); }
public bool updateToDatabase(Quotation existingQuotation) { string sqlUpdateQuotation = "UPDATE `salesleads`.`quatation` SET `SalesLeadsID` = '" + existingQuotation.SalesleadID + "', `QuatationDate` = '" + existingQuotation.QuotationDate + "', `QuotationStatus` = '" + existingQuotation.QuotationStatus + "' WHERE `quatation`.`QuatationID` = " + existingQuotation.QuotationID + ";"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlUpdateQuotation); DBLink.closeConnection(); return(result); }
public bool updateToDatabase(Customer existingCustomer) { string sqlUpdateCustomer = "UPDATE `salesleads`.`customer` SET `Name` = '" + existingCustomer.Name + "', `ShortName` = '" + existingCustomer.ShortName + "', `Address` = '" + existingCustomer.Address + "', `Email` = '" + existingCustomer.Email + "', `PhoneNo` = '" + existingCustomer.PhoneNo + "', `AccManager` = '" + existingCustomer.AccountManager + "' WHERE `customer`.`CustomerID` = " + existingCustomer.CustomerID + ";"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlUpdateCustomer); DBLink.closeConnection(); return(result); }
public bool addToDatabase(Customer newCustomer) { string sqlAddCustomer = "INSERT INTO `salesleads`.`customer` (`CustomerID`, `Name`, `ShortName`, `Address`, `Email`, `PhoneNo`, `AccManager`) VALUES (NULL, '" + newCustomer.Name + "', '" + newCustomer.ShortName + "', '" + newCustomer.Address + "', '" + newCustomer.Email + "', '" + newCustomer.PhoneNo + "', '" + newCustomer.AccountManager + "');"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlAddCustomer); DBLink.closeConnection(); return(result); }
public System.Data.DataView readFromDatabase(int salesleadsID) { DBLink.openConnection(); string sqlcomments = "SELECT * FROM `salesleads`.`comment` WHERE `SalesLeadsID`='" + salesleadsID + "';"; DBLink.closeConnection(); return(DBLink.executeTableQuarry(sqlcomments)); }
public bool updateToDatabase(Secure existingSecureData) // Update to database existingSecureData { string sqlUpdateSecureUser = "******" + existingSecureData.Password + "', `SecurityQuestion` = '" + existingSecureData.Question + "', `Answer` = '" + existingSecureData.Answer + "' WHERE `secure`.`UserName` = '" + existingSecureData.Username + "';"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlUpdateSecureUser); DBLink.closeConnection(); return(result); }
public bool addToDatabase(Secure newSecureData) // Add to database newSecureDAta { string sqlAddSecureUser = "******" + newSecureData.Username + "', '" + newSecureData.Password + "', '" + newSecureData.Question + "', '" + newSecureData.Answer + "');"; DBLink.openConnection(); bool result = DBLink.executeWriteQuarry(sqlAddSecureUser); DBLink.closeConnection(); return(result); }
//Chamil public List <String> getPredecessorList(int permission) { DBLink.openConnection(); string query = "SELECT * FROM `salesleads`.`user` WHERE `Permissions`>'" + permission + "';"; System.Data.DataTable predecessorTable = DBLink.executeTableQuarry(query).Table; List <String> predecessorList = new List <String>(); for (int i = 0; i < predecessorTable.Rows.Count; i++) { predecessorList.Add((String)predecessorTable.Rows[i].ItemArray[0]); } DBLink.closeConnection(); return(predecessorList); }