Ejemplo n.º 1
0
        public void Either_Result_3()
        {
            Facts.Clear();
            Tbool result = Fam.IsBiologicalParentOf(p1, p2);

            Assert.AreEqual("Unstated", result.Out);
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            //WorkPerformer del = new WorkPerformer(First);
            //WorkPerformer del2 = new WorkPerformer(Second);
            //del(3, "");
            //Console.WriteLine("Hello World!");

            Worker  worker  = new Worker();
            Manager manager = new Manager();
            Fam     fam     = new Fam();

            worker.WorkPerformed += new EventHandler <WorkerEventArgs>(fam.Worker_WorkPerformed);

            worker.WorkPerformed += manager.Worker_WorkPerformed;
            worker.WorkCompleted += manager.Worker_Completed;
            worker.WorkCompleted += fam.Worker_Completed;

            worker.DoWork(work: new WorkerEventArgs(5, WorkType.GOLF));
            Console.WriteLine("Called first");

            StoreWorker storeWorker = new StoreWorker();

            StoreA storeA = new StoreA();
            StoreB storeB = new StoreB();

            storeWorker.storeVisited += storeA.StoreVisitedPerformed;
            storeWorker.storeVisited += storeB.StoreVisitedPerformed;

            storeWorker.VisitStore(5);
        }
Ejemplo n.º 3
0
        public static void UpdateFam(Fam fam)
        {
            String connectionString = DataManager.OraConnString();
            string query            = " update family_dtl set rel_name= '" + fam.RelName + "',relation= '" + fam.Relation + "',birth_dt= convert(datetime,nullif('" + fam.BirthDt + "',''),103), " +
                                      " age= convert(numeric,nullif('" + fam.Age + "','')),occupation= '" + fam.Occupation + "' where sfml_student_id='" + fam.StudentId + "' and rtrim(rel_name)=rtrim('" + fam.RelName + "')";

            DataManager.ExecuteNonQuery(connectionString, query);
        }
Ejemplo n.º 4
0
        public void Fam_4()
        {
            Facts.Reset();
            Facts.Assert(p2, "Fam.FamilyRelationship", p1, "Something other than civil union...");
            bool result = Fam.InCivilUnion(p1, p2).IsTrue;

            Assert.AreEqual(false, result);
        }
Ejemplo n.º 5
0
        public void Fam_2()
        {
            Facts.Reset();
            Facts.Assert(p2, "Fam.FamilyRelationship", p1, "Partner by civil union");
            bool result = Fam.InCivilUnion(p1, p2).IsTrue;

            Assert.AreEqual(true, result);
        }
Ejemplo n.º 6
0
        public void Either_Result_2()
        {
            Facts.Clear();
            Facts.Assert(p2, "Fam.FamilyRelationship", p1, "Biological child");
            Tbool result = Fam.IsBiologicalParentOf(p1, p2);

            Assert.AreEqual(true, result.Out);
        }
Ejemplo n.º 7
0
        public static void CreateFam(Fam fam)
        {
            String connectionString = DataManager.OraConnString();
            string query            = " insert into family_dtl (sfml_student_id,rel_name,relation,birth_dt,age,occupation) values (" +
                                      "  '" + fam.StudentId + "', '" + fam.RelName + "', '" + fam.Relation + "','" + fam.BirthDt + "', " +
                                      "'" + fam.Age + "', '" + fam.Occupation + "')";

            DataManager.ExecuteNonQuery(connectionString, query);
        }
Ejemplo n.º 8
0
        public void AddChild(string name, string data)
        {
            if (ch == 0)
            {
                children[0] = new Fam();
                ch++;
                return;
            }
            Array.Resize(ref children, ch);

            children[ch - 1]      = new Fam();
            children[ch - 1].name = name;
            children[ch - 1].data = data;
            ch++;
        }
Ejemplo n.º 9
0
        public void AddFam(string name, string datee)
        {
            if (f == 0)
            {
                family[0] = new Fam();
                f++;
                return;
            }
            Array.Resize(ref family, f);

            family[f - 1]      = new Fam();
            family[f - 1].name = name;
            family[f - 1].data = datee;
            f++;
        }
Ejemplo n.º 10
0
        private void Insertbtn_Click(object sender, EventArgs e)
        {
            string connStr = "server=localhost;user=root;database=birjha_truda;";
            // создаём объект для подключения к БД
            MySqlConnection connection = new MySqlConnection(connStr);

            connection.Open();
            string sql = "INSERT INTO `soiskateli`(`id_users`, `Last_name`, `Name`, `Father_name`, `Pol`, `Age`, `Pasport`, `Info`) VALUES " +
                         "(NULL, '" + Fam.Text + "','" + Ima.Text + "','" + Otch.Text + "','" + Pol.Text
                         + "','" + Age.Text + "','" + Pasport.Text + "','" + Inf.Text + "');";
            MySqlCommand command = new MySqlCommand(sql, connection);

            command.ExecuteNonQuery();
            connection.Close();
            Ima.Clear();
            Fam.Clear();
            Otch.Clear();
            Pol.Clear();
            Pasport.Clear();
            Age.Clear();
            Inf.Clear();
        }