public bool updateOrderStatus(OrderProperties updateorderInfo) { bool result = false; List <KeyValuePair <string, string> > queryParameter = new List <KeyValuePair <string, string> >(); if (updateorderInfo.Description != null && updateorderInfo.Order_Status != null) { string updateQueryString = "UPDATE SALES_ORDER SET ORDER_STATUS=@ORDER_STATUS,DESCRIPTION=@DESCRIPTION,MODIFY_BY=@MODIFIED_BY,MODIFY_DATE=@MODIFIED_DATE WHERE ORDER_ID=@ORDER_ID"; queryParameter.Add(new KeyValuePair <string, string>("@ORDER_ID", updateorderInfo.Order_Id.ToString())); queryParameter.Add(new KeyValuePair <string, string>("@ORDER_STATUS", updateorderInfo.Order_Status)); queryParameter.Add(new KeyValuePair <string, string>("@DESCRIPTION", updateorderInfo.Description)); queryParameter.Add(new KeyValuePair <string, string>("@MODIFIED_BY", updateorderInfo.User_ID)); queryParameter.Add(new KeyValuePair <string, string>("@MODIFIED_DATE", utlitiy.BusinessUtlities.getCurrentDateTime.ToString())); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, queryParameter); } else if (updateorderInfo.Order_Status != null) { string updateQueryString = "UPDATE SALES_ORDER SET ORDER_STATUS=@ORDER_STATUS,MODIFIED_BY=@MODIFIED_BY,MODIFIED_DATE=@MODIFIED_DATE WHERE ORDER_ID=@ORDER_ID"; queryParameter.Add(new KeyValuePair <string, string>("@ORDER_ID", updateorderInfo.Order_Id.ToString())); queryParameter.Add(new KeyValuePair <string, string>("@ORDER_STATUS", updateorderInfo.Vendor_Id.ToString())); queryParameter.Add(new KeyValuePair <string, string>("@MODIFIED_BY", updateorderInfo.User_ID)); queryParameter.Add(new KeyValuePair <string, string>("@MODIFIED_DATE", utlitiy.BusinessUtlities.getCurrentDateTime.ToString())); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, queryParameter); } return(result); }
//Update the user profile status as deactivate to remove the user from system public bool deactivateUser(string userId) { string updateQueryString = null; bool result = false; List <KeyValuePair <string, string> > tableQueryData = new List <KeyValuePair <string, string> >(); updateQueryString = "UPDATE USER_TABLE SET STATUS='DEACTIVATED' WHERE USER_ID=@USER_ID;"; tableQueryData.Add(new KeyValuePair <string, string>("@USER_ID", userId)); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableQueryData); return(result); }
public bool cancelOrderReturn(OrderReturnProperties cancelOrderReturnInfo) { string updateQueryString = "UPDATE RETURN_ORDER SET RETURN_STATUS='CANCELLED' WHERE RETURN_ORDER_ID=@RETURN_ORDER_ID"; List <KeyValuePair <string, string> > tableQueryData = new List <KeyValuePair <string, string> >(); bool result = false; tableQueryData.Add(new KeyValuePair <string, string>("@RETURN_ORDER_ID", cancelOrderReturnInfo.Return_Order_Id)); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableQueryData); return(result); }
//add product count based on order item count when customer submitting the order public bool updateProduct(ProductProperties productInfo, string userInfo) { string updateQueryString = "UPDATE PRODUCT SET PRODUCT_CURRENT_COUNT=PRODUCT_CURRENT_COUNT+@NEW_PRODUCT_COUNT, PRICE_PER_UNIT=@PRICE_PER_UNIT WHERE PRODUCT_ID=@PRODUCTID"; List <KeyValuePair <string, string> > tableQueryData = new List <KeyValuePair <string, string> >(); bool result = false; tableQueryData.Add(new KeyValuePair <string, string>("@NEW_PRODUCT_COUNT", productInfo.Product_Current_Count.ToString())); tableQueryData.Add(new KeyValuePair <string, string>("@PRICE_PER_UNIT", productInfo.Price_Per_Unit.ToString())); tableQueryData.Add(new KeyValuePair <string, string>("@PRODUCTID", productInfo.Product_Id)); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableQueryData); return(result); }
//Method used to remove multiple users after deactivating(removing) vendor from vendor list public bool removeMultipleCustomerUsers(string vendorID) { string updateQueryString = null; bool result = false; List <KeyValuePair <string, string> > tableQueryData = new List <KeyValuePair <string, string> >(); updateQueryString = "UPDATE USER_TABLE SET STATUS='INACTIVE' WHERE VENDOR_ID=@VENDOR_ID;"; tableQueryData.Add(new KeyValuePair <string, string>("@VENDOR_ID", vendorID)); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableQueryData); return(result); }
public bool cancelOrder(OrderProperties cancelorderInfo) { string deleteQueryString = "UPDATE SALES_ORDER SET ORDER_STATUS='CANCELLED',DESCRIPTION=@DESCRIPTION,MODIFY_BY=@MODIFIED_BY,MODIFY_DATE=@MODIFIED_DATE WHERE ORDER_ID=@ORDER_ID AND VENDOR_ID=@VENDOR_ID AND ORDER_STATUS=@ORDER_STATUS;"; List <KeyValuePair <string, string> > queryParameter = new List <KeyValuePair <string, string> >(); queryParameter.Add(new KeyValuePair <string, string>("@ORDER_ID", cancelorderInfo.Order_Id.ToString())); queryParameter.Add(new KeyValuePair <string, string>("@VENDOR_ID", cancelorderInfo.Vendor_Id.ToString())); queryParameter.Add(new KeyValuePair <string, string>("@DESCRIPTION", cancelorderInfo.Description.ToString())); queryParameter.Add(new KeyValuePair <string, string>("@ORDER_STATUS", cancelorderInfo.Order_Status)); queryParameter.Add(new KeyValuePair <string, string>("@MODIFIED_BY", cancelorderInfo.User_ID)); queryParameter.Add(new KeyValuePair <string, string>("@MODIFIED_DATE", utlitiy.BusinessUtlities.getCurrentDateTime.ToString())); bool result = DatabaseConnectionHandler.executeUpdateQuery(deleteQueryString, queryParameter); return(result); }
public bool updateOrderReturn(OrderReturnProperties updateOrderStatusInfo, string userInfo) { string updateQueryString = "UPDATE RETURN_ORDER SET RETURN_STATUS=@STATUS,RETURN_DESCRITPION=@RETURN_DESCRIPTION,MODIFIED_BY=@MODIFIED_BY,MODIFIED_DATE=@MODIFIED_DATE WHERE RETURN_ORDER_ID=@RETURN_ORDER_ID"; List <KeyValuePair <string, string> > tableQueryData = new List <KeyValuePair <string, string> >(); bool result = false; tableQueryData.Add(new KeyValuePair <string, string>("@RETURN_ORDER_ID", updateOrderStatusInfo.Return_Order_Id)); tableQueryData.Add(new KeyValuePair <string, string>("@STATUS", updateOrderStatusInfo.Return_Status)); tableQueryData.Add(new KeyValuePair <string, string>("@RETURN_DESCRIPTION", updateOrderStatusInfo.Return_Description)); tableQueryData.Add(new KeyValuePair <string, string>("@MODIFIED_BY", updateOrderStatusInfo.User_Id)); tableQueryData.Add(new KeyValuePair <string, string>("@MODIFIED_DATE", com.app.utlitiy.BusinessUtlities.getCurrentDateTime)); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableQueryData); return(result); }
//reduce product count based on order item count when customer submitting the order public bool reduceProductCount(List <ProductProperties> productInfo) { string updateQueryString = "UPDATE PRODUCT SET PRODUCT_CURRENT_COUNT=PRODUCT_CURRENT_COUNT-@ORDER_COUNT WHERE PRODUCT_ID=@PRODUCTID"; bool result = false; foreach (ProductProperties props in productInfo) { List <KeyValuePair <string, string> > tableQueryData = new List <KeyValuePair <string, string> >(); string key = props.Product_Id; int value = props.Product_Current_Count; tableQueryData.Add(new KeyValuePair <string, string>("@ORDER_COUNT", value.ToString())); tableQueryData.Add(new KeyValuePair <string, string>("@PRODUCTID", key.ToString())); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableQueryData); } return(result); }
//Deactivating vendor from vendor table, with this method respective vendor users profile also deactivated public bool removeCustomerInfo(CustomerProperties oldVendorInfo, string userInfo) { string updateQueryString = null; bool result = false; if (oldVendorInfo.Vendor_Id != null) { updateQueryString = "UPDATE VENDOR SET VENDOR_STATUS='INACTIVE',MODIFIED_BY=@MODIFIED_BY,MODIFIED_DATE=@MODIFIED_DATE WHERE VENDOR_ID=@VENDOR_ID;"; List <KeyValuePair <string, string> > tableParameters = new List <KeyValuePair <string, string> >(); tableParameters.Add(new KeyValuePair <string, string>("@VENDOR_ID", oldVendorInfo.Vendor_Id)); tableParameters.Add(new KeyValuePair <string, string>("@MODIFIED_BY", userInfo)); tableParameters.Add(new KeyValuePair <string, string>("@MODIFIED_DATE", com.app.utlitiy.BusinessUtlities.getCurrentDateTime)); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableParameters); } return(result); }
//Modify the single user profile public bool updateUserInfo(UserInformationProperties userInfo) { string updateQueryString = null; bool result = false; List <KeyValuePair <string, string> > tableQueryData = new List <KeyValuePair <string, string> >(); if ((userInfo.Address != null) && (userInfo.Contact != null) && (userInfo.EMail_Id != null)) { updateQueryString = "UPDATE USER_TABLE SET ADDRESS=@ADDRESS,CONTACT=@CONTACT,EMAIL_ID=@EMAIL_ID WHERE USER_ID=@USER_ID;"; tableQueryData.Add(new KeyValuePair <string, string>("@ADDRESS", userInfo.Address)); tableQueryData.Add(new KeyValuePair <string, string>("@CONTACT", userInfo.Contact)); tableQueryData.Add(new KeyValuePair <string, string>("@EMAIL_ID", userInfo.EMail_Id)); tableQueryData.Add(new KeyValuePair <string, string>("@USER_ID", userInfo.User_Id)); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableQueryData); } return(result); }
//deactive/remove the manufacturer from database public bool deActivateManufacturer(ManufacturerProperties manufacturerProperties, string userInfo) { bool result = false; try { string updateQueryString = "UPDATE MANUFACTURER SET MANUFACTURER_STATUS=@STATUS,MODIFIED_BY=@MODIFIED_BY,MODIFIED_DATE=@MODIFIED_DATE WHERE MANUFACTURER_ID=@MANUFACTURER_ID"; List <KeyValuePair <string, string> > tableQueryData = new List <KeyValuePair <string, string> >(); tableQueryData.Add(new KeyValuePair <string, string>("@STATUS", manufacturerProperties.Manufacturer_Status)); tableQueryData.Add(new KeyValuePair <string, string>("@MANUFACTURER_ID", manufacturerProperties.Manufacturer_Id)); tableQueryData.Add(new KeyValuePair <string, string>("@MODIFIED_BY", userInfo)); tableQueryData.Add(new KeyValuePair <string, string>("@MODIFIED_DATE", com.app.utlitiy.BusinessUtlities.getCurrentDateTime)); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableQueryData); }catch (Exception ex) { Console.WriteLine(ex.StackTrace); } return(result); }
//updating information in vendor profile public bool modifyCustomerInfo(CustomerProperties existingVendorInfo, string userInfo) { string updateQueryString = null; bool result = false; List <KeyValuePair <string, string> > tableParameters = new List <KeyValuePair <string, string> >(); if ((existingVendorInfo.Vendor_Address != null) && (existingVendorInfo.Vendor_Contact != null) && (existingVendorInfo.Vendor_EMail_Id != null)) { updateQueryString = "UPDATE VENDOR SET VENDOR_ADDRESS=@VENDOR_ADDRESS,VENDOR_CONTACT=@VENDOR_CONTACT,VENDOR_EMAIL_ID=@VENDOR_EMAIL_ID,MODIFIED_BY=@MODIFIED_BY,MODIFIED_DATE=@MODIFIED_DATE,VENDOR_STATUS=@VENDOR_STATUS WHERE VENDOR_ID=@VENDOR_ID;"; tableParameters.Add(new KeyValuePair <string, string>("@VENDOR_ADDRESS", existingVendorInfo.Vendor_Address)); tableParameters.Add(new KeyValuePair <string, string>("@VENDOR_CONTACT", existingVendorInfo.Vendor_Contact)); tableParameters.Add(new KeyValuePair <string, string>("@VENDOR_EMAIL_ID", existingVendorInfo.Vendor_EMail_Id)); tableParameters.Add(new KeyValuePair <string, string>("@MODIFIED_BY", userInfo)); tableParameters.Add(new KeyValuePair <string, string>("@MODIFIED_DATE", com.app.utlitiy.BusinessUtlities.getCurrentDateTime)); tableParameters.Add(new KeyValuePair <string, string>("@VENDOR_ID", existingVendorInfo.Vendor_Id)); tableParameters.Add(new KeyValuePair <string, string>("@VENDOR_STATUS", existingVendorInfo.Vendor_Status)); result = DatabaseConnectionHandler.executeUpdateQuery(updateQueryString, tableParameters); } return(result); }