public void SaveUnreadNotification(Notification notification) { foreach (object val in notification.ToData()) { dbConnection.CheckInput(val.ToString()); } dbConnection.InsertTable("Notifications", "NotificationID,Receiver,Message,Status", new[] { "@id", "@receiver", "@msg", "@status" }, notification.ToData()); }
public void RemovePolicy(PurchasePolicy policy) { string subjectString = "NULL"; if (!policy.Subject.IsNullOrEmpty()) { subjectString = policy.Subject; } dbConnection.CheckInput(subjectString); dbConnection.CheckInput(PurchasePolicy.PrintEnum(policy.Type)); dbConnection.DeleteFromTable("ComplexPolicies", "PolicyType = '" + PurchasePolicy.PrintEnum(policy.Type) + "' AND Subject = '" + subjectString + "'"); dbConnection.DeleteFromTable("SimplePolicies", "PolicyType = '" + PurchasePolicy.PrintEnum(policy.Type) + "' AND Subject = '" + subjectString + "'"); }
public void CheckInput(string input) { realMarketDB.CheckInput(input); }
public OrderItem FindOrderItemInOrder(int orderId, string store, string name) { dbConnection.CheckInput(store); dbConnection.CheckInput(name); using (var dbReader = dbConnection.SelectFromTableWithCondition("OrderItem", "*", "OrderID = " + orderId + " AND " + "Store = '" + store + "' AND " + "Name = '" + name + "'")) { while (dbReader.Read()) { if (dbReader.GetValue(0) != null) { return(new OrderItem(dbReader.GetString(1), null, dbReader.GetString(2), dbReader.GetDouble(3), dbReader.GetInt32(4))); } } } return(null); }
public bool IsUserNameExist(string name) { dbConnection.CheckInput(name); using (var dbReader = dbConnection.SelectFromTableWithCondition("Users", "*", "Name = '" + name + "'")) { return(dbReader.Read()); } }
public void AddProductToCategory(string categoryid, string productid) { dbConnection.CheckInput(categoryid); dbConnection.CheckInput(productid); string[] paramsNames = { "@categoryParam", "@productParam" }; object[] values = { categoryid, productid }; dbConnection.InsertTable("CategoryProductConnection", "CategoryID, ProductID", paramsNames, values); }
public void CloseStore(string store) { dbConnection.CheckInput(store); dbConnection.UpdateTable("Store", "Name = '" + store + "'", new[] { "Status" }, new[] { "@stat" }, new object[] { "Inactive" }); }