Ejemplo n.º 1
0
        public string LoadInformation(TeethInformation _tf)
        {
            string result = string.Empty;

            try
            {
                using (IController <TeethInformation> sql = new Controller <TeethInformation>())
                {
                    foreach (TeethInformation tf in sql.GetAll())
                    {
                        if (tf.ClientId == _tf.ClientId && tf.Teeth_number == _tf.Teeth_number)
                        {
                            result = tf.Info;
                            break;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ошибка" + ex.Message);
            }

            return(result.TrimEnd());
        }
Ejemplo n.º 2
0
        public void SaveTeethInfo(TeethInformation _tf)
        {
            try
            {
                using (IController <TeethInformation> sql = new Controller <TeethInformation>())
                {
                    bool priznak = false;

                    foreach (TeethInformation tf in sql.GetAll())
                    {
                        if (tf.ClientId == _tf.ClientId && tf.Teeth_number == _tf.Teeth_number)
                        {
                            tf.Info = _tf.Info;
                            sql.Update(tf);
                            priznak = true;
                            break;
                        }
                    }

                    if (!priznak)
                    {
                        sql.Create(_tf);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ошибка" + ex.Message);
            }
        }