Exemplo n.º 1
0
        public string Update(int id, double selling, double purch, bool isManulInput)
        {
            try
            {
                if (selling <= 0)
                {
                    throw new Exception("Сумма продажи равна нулю либо меньше нуля!");
                }
                if (purch <= 0)
                {
                    throw new Exception("Сумма покупки равна нулю либо меньше нуля!");
                }
                if (purch < selling)
                {
                    throw new Exception("Сумма покупки меньше чем сумма продажи!");
                }

                return(_repository.Update(id, selling, purch, isManulInput, this.User.Claims.Where(c => c.Type == "UserFIO").FirstOrDefault().Value));
            }
            catch (Exception e)
            { return(e.Message); }
        }