Exemplo n.º 1
0
        public void UpdateSaleCount(int productID, int count, int employeeCount)
        {
            if (productID > 999 || count > 999 || employeeCount > 999)
            {
                return;
            }
            if (productID < 0 || count < 0 || employeeCount < 0)
            {
                return;
            }
            char store = userStoreDic[Context.ConnectionId];
            SqlStoredProcedures sqlSP = new SqlStoredProcedures();

            sqlSP.StoreUpdateSaleCount(Char.ToUpper(store), productID, count, employeeCount);
            decimal total = sqlSP.StoreGetSaleTotal(store);

            foreach (KeyValuePair <string, char> userStorePair in userStoreDic)
            {
                if (userStorePair.Value == store)
                {
                    Clients.Client(userStorePair.Key).UpdateSaleCount(productID, count, employeeCount);
                    Clients.Client(userStorePair.Key).UpdateTotal(Convert.ToDouble(total).ToString("N2"));
                }
            }
        }