コード例 #1
0
        public ActionResult COD(COD c)
        {
            Model_clienti model1;

            id     = c.id;
            model1 = Repository_clienti.Cautare_client(id);
            return(RedirectToAction("Actualizare_client", model1));
        }
コード例 #2
0
        public void Testare_cautare_client_fail(string id)
        {
            //Arrange
            Model_clienti m1 = new Model_clienti();

            //Act
            m1 = Repository_clienti.Cautare_client(id);
            //Assert
            Assert.IsNull(m1);
        }
コード例 #3
0
        public ActionResult COD(COD c)
        {
            c.Verificare();
            if (c.fail != null)
            {
                return(View(c));
            }
            Model_clienti model1;

            id     = c.id;
            model1 = Repository_clienti.Cautare_client(id);
            return(RedirectToAction("Actualizare_client", model1));
        }
コード例 #4
0
        public void Test_cautare_client_good(string id)
        {
            //Arrange
            Model_clienti m1 = new Model_clienti();

            //Act
            m1 = Repository_clienti.Cautare_client(id);
            //Assert
            Assert.AreEqual(m1.Nume, model_client.Nume);
            Assert.AreEqual(m1.Prenume, model_client.Prenume);
            Assert.AreEqual(m1.tip_camera, model_client.tip_camera);
            Assert.AreEqual(m1.carte_de_credit, model_client.carte_de_credit);
            Assert.AreEqual(m1.CCV, model_client.CCV);
            Assert.AreEqual(m1.Data_expirarii, model_client.Data_expirarii);
            Assert.AreEqual(m1.Mentiuni, model_client.Mentiuni);
        }
コード例 #5
0
        public static bool Verificare_tip_camera_modificat(Model_clienti m)
        {
            MySqlConnection  conn  = new MySqlConnection(ConnectionString);
            string           query = "SELECT Tip_camera FROM tabel_clienti WHERE ID='" + m.ID + "';";
            MySqlCommand     cmd   = new MySqlCommand(query, conn);
            MySqlDataAdapter adapt = new MySqlDataAdapter();

            adapt.SelectCommand = cmd;
            DataTable dTable = new DataTable();

            adapt.Fill(dTable);
            List <DataRow> client = dTable.AsEnumerable().ToList();
            Model_clienti  cautat = Repository_clienti.Cautare_client(m.ID);

            foreach (DataRow stare_camere in client)
            {
                if (stare_camere.ItemArray[0].ToString() == cautat.tip_camera.ToString())
                {
                    return(false);
                }
            }
            return(true);
        }