Esempio n. 1
0
        public void SelectedID(int GrupiID)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("GrupiSelectRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@GrupiID", GrupiID);

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    mGrupi.GrupiID = (int)rdr["GrupiID"];

                    if (rdr["Grupi"] != DBNull.Value)
                    {
                        mGrupi.emriGrupit = (string)rdr["Grupi"];
                    }
                    if (rdr["KategoriaID"] != DBNull.Value)
                    {
                        mGrupi.KategoriaID = (int)rdr["KategoriaID"];
                    }
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 2
0
        public void SelectedID(int ObjektiID)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("ObjektiSelectRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ObjektiID", ObjektiID);

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    mObjekti.ObjektiID = (int)rdr["ObjektiID"];

                    if (rdr["Lokacioni"] != DBNull.Value)
                    {
                        mObjekti.Lokacioni = (string)rdr["Lokacioni"];
                    }
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 3
0
        public void SelectAllObjektet()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("ObjektiSelectAll", con);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    Objekti o = new Objekti();
                    o.ObjektiID = (int)rdr["ObjektiID"];
                    if (rdr["Lokacioni"] != DBNull.Value)
                    {
                        o.Lokacioni = (string)rdr["Lokacioni"];
                    }
                    mObjektet.Add(o);
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 4
0
        public void SelectedID(int KategoriaID)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("KategoriaSelectRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@KategoriaID", KategoriaID);

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    mKategoria.KategoriaID = (int)rdr["KategoriaID"];

                    if (rdr["VleraKategoris"] != DBNull.Value)
                    {
                        mKategoria.Vlera = (int)rdr["VleraKategoris"];
                    }
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 5
0
        public void SelectAllGrupet()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("GrupiSelectAll", con);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    Grupi g = new Grupi();
                    g.GrupiID = (int)rdr["GrupiID"];
                    if (rdr["Grupi"] != DBNull.Value)
                    {
                        g.emriGrupit = (string)rdr["Grupi"];
                    }
                    if (rdr["KategoriaID"] != DBNull.Value)
                    {
                        g.KategoriaID = (int)rdr["KategoriaID"];
                    }
                    mGrupet.Add(g);
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 6
0
        public void Update()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("ProduktiUpdateRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Emri", mProdukti.Emri);
                cmd.Parameters.AddWithValue("@Pershkrimi", mProdukti.Pershkrimi);
                cmd.Parameters.AddWithValue("@Prodhuesi", mProdukti.Prodhuesi);
                cmd.Parameters.AddWithValue("@Modeli", mProdukti.Modeli);
                cmd.Parameters.AddWithValue("@Jetegjatesia", mProdukti.Jetegjatesia);
                cmd.Parameters.AddWithValue("@Lloji", mProdukti.Lloji);
                cmd.Parameters.AddWithValue("@GrupiID", mProdukti.GrupiID);
                cmd.Parameters.AddWithValue("@Statusi", mProdukti.Statusi);
                cmd.Parameters.AddWithValue("@NrSerik", mProdukti.NrSerik);
                cmd.Parameters.AddWithValue("@salvageValue", mProdukti.salvageValue);
                cmd.Parameters.AddWithValue("@Cmimi", mProdukti.Cmimi);
                cmd.Parameters.AddWithValue("@Data1", mProdukti.Data1);
                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 7
0
        public void Insert()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("KategoriaInsertRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@VleraKategorise", mKategoria.Vlera);
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 8
0
        public void Delete()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("KategoriaDeleteRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@KategoriaID", mKategoria.KategoriaID);
                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 9
0
        public void Insert()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("ObjektiInsertRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Lokacioni", mObjekti.Lokacioni);
                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 10
0
        public void Insert()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("GrupiInsertRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Grupi", mGrupi.emriGrupit);
                cmd.Parameters.AddWithValue("@KategoriaID", mGrupi.KategoriaID);
                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 11
0
        public void Login()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("UserLogin", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@username", mLogin.username);
                cmd.Parameters.AddWithValue("@password", mLogin.password);

                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 12
0
        public void Insert()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("KlientiInsertRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Emri", mKlienti.Emri);
                cmd.Parameters.AddWithValue("@Mbiemri", mKlienti.Mbiemri);
                cmd.Parameters.AddWithValue("@NumriTelefonit", mKlienti.NumriTelefonit);
                cmd.Parameters.AddWithValue("@Email", mKlienti.Email);
                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 13
0
        //public void Delete()
        //{
        //    SqlConnection con = Generals.GetNewConnection();
        //    try
        //    {
        //        SqlCommand cmd = new SqlCommand("MirembajtjaDeleteRow", con);
        //        cmd.CommandType = CommandType.StoredProcedure;
        //        cmd.Parameters.AddWithValue("@MirembajtjaID", mMirembajtja.MirembajtjaID);
        //        cmd.ExecuteNonQuery();
        //    }
        //    finally
        //    {
        //        con.Close();
        //    }
        //}

        public void Insert()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("MirembajtjaInsertRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ProduktiID", mMirembajtja.ProduktiID);
                cmd.Parameters.AddWithValue("@DataMirembajtjes", mMirembajtja.DataMirembajtjes);
                cmd.Parameters.AddWithValue("@Pershkrimi", mMirembajtja.Pershkrimi);
                cmd.Parameters.AddWithValue("@PunetoriID", mMirembajtja.PunetoriID);
                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 14
0
        public void Update() // Perditsim i te dhenave
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("PunetoriUpdateRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@PunetoriID", mPunetori.PunetoriID);
                cmd.Parameters.AddWithValue("@Emri", mPunetori.Emri);
                cmd.Parameters.AddWithValue("@Mbiemri", mPunetori.Mbiemri);
                cmd.Parameters.AddWithValue("@Gjinia", mPunetori.Gjinia);
                cmd.Parameters.AddWithValue("@RoliId", mPunetori.RoliID);
                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 15
0
        public void Update() // Perditsim i te dhenave
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("VendoriUpdateRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@VendoriID", mVendori.VendoriID);
                cmd.Parameters.AddWithValue("@Emri", mVendori.Emri);
                cmd.Parameters.AddWithValue("@Lokacioni", mVendori.Lokacioni);
                cmd.Parameters.AddWithValue("@NrKontaktues", mVendori.NrKontaktues);
                cmd.Parameters.AddWithValue("@BankAccount", mVendori.BankAccount);
                cmd.ExecuteNonQuery();
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 16
0
        public void SelectAllPunetoret()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("PunetoriSelectAll", con);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    Punetori p = new Punetori();
                    p.PunetoriID = (int)rdr["PunetoriID"];
                    if (rdr["Emri"] != DBNull.Value)
                    {
                        p.Emri = (string)rdr["Emri"];
                    }
                    if (rdr["Mbiemri"] != DBNull.Value)
                    {
                        p.Mbiemri = (string)rdr["Mbiemri"];
                    }
                    if (rdr["Gjinia"] != DBNull.Value)
                    {
                        p.Gjinia = (string)rdr["Gjinia"];
                    }
                    if (rdr["RoliID"] != DBNull.Value)
                    {
                        p.RoliID = (int)rdr["RoliID"];
                    }

                    mPunetoret.Add(p);
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 17
0
        public void SelectAllVendori()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("VendoriSelectAll", con);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    Vendori v = new Vendori();
                    v.VendoriID = (int)rdr["VendoriID"];
                    if (rdr["Emri"] != DBNull.Value)
                    {
                        v.Emri = (string)rdr["Emri"];
                    }
                    if (rdr["Lokacioni"] != DBNull.Value)
                    {
                        v.Lokacioni = (string)rdr["Lokacioni"];
                    }
                    if (rdr["NrKontaktues"] != DBNull.Value)
                    {
                        v.NrKontaktues = (int)rdr["NrKontaktues"];
                    }
                    if (rdr["BankAccount"] != DBNull.Value)
                    {
                        v.BankAccount = (int)rdr["BankAccount"];
                    }

                    mVendoret.Add(v);
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 18
0
        public void SelectedID(int VendoriID) // Opsion i select id
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("VendoriSelectRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@VendoriID", VendoriID);

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    mVendori.VendoriID = (int)rdr["VendoriID"];

                    if (rdr["Emri"] != DBNull.Value)
                    {
                        mVendori.Emri = (string)rdr["Emri"];
                    }
                    if (rdr["Lokacioni"] != DBNull.Value)
                    {
                        mVendori.Lokacioni = (string)rdr["Lokacioni"];
                    }
                    if (rdr["NrKontaktues"] != DBNull.Value)
                    {
                        mVendori.NrKontaktues = (int)rdr["NrKontaktues"];
                    }
                    if (rdr["BankAccount"] != DBNull.Value)
                    {
                        mVendori.BankAccount = (int)rdr["BankAccount"];
                    }
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 19
0
        public void SelectedID(int PunetoriID) // Opsion i select id
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("PunetoriSelectRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@PunetoriID", PunetoriID);

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    mPunetori.PunetoriID = (int)rdr["PunetoriID"];

                    if (rdr["Emri"] != DBNull.Value)
                    {
                        mPunetori.Emri = (string)rdr["Emri"];
                    }
                    if (rdr["Mbiemri"] != DBNull.Value)
                    {
                        mPunetori.Mbiemri = (string)rdr["Mbiemri"];
                    }
                    if (rdr["Gjinia"] != DBNull.Value)
                    {
                        mPunetori.Gjinia = (string)rdr["Gjinia"];
                    }
                    if (rdr["RoliID"] != DBNull.Value)
                    {
                        mPunetori.RoliID = (int)rdr["RoliID"];
                    }
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 20
0
        public void SelectAllKlients()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("KlientiSelectAll", con);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    Klienti k = new Klienti();
                    k.KlientiID = (int)rdr["KlientiID"];
                    if (rdr["Emri"] != DBNull.Value)
                    {
                        k.Emri = (string)rdr["Emri"];
                    }
                    if (rdr["Mbiemri"] != DBNull.Value)
                    {
                        k.Mbiemri = (string)rdr["Mbiemri"];
                    }
                    if (rdr["NumriTelefonit"] != DBNull.Value)
                    {
                        k.NumriTelefonit = (int)rdr["NumriTelefonit"];
                    }
                    if (rdr["Email"] != DBNull.Value)
                    {
                        k.Email = (string)rdr["Email"];
                    }
                    mKlientet.Add(k);
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 21
0
        public void SelectedID(int KlientiID)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("KlientiSelectRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@KlientiID", KlientiID);

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    mKlienti.KlientiID = (int)rdr["KlientiID"];
                    if (rdr["Emri"] != DBNull.Value)
                    {
                        mKlienti.Emri = (string)rdr["Emri"];
                    }
                    if (rdr["Mbiemri"] != DBNull.Value)
                    {
                        mKlienti.Mbiemri = (string)rdr["Mbiemri"];
                    }
                    if (rdr["NumriTelefonit"] != DBNull.Value)
                    {
                        mKlienti.NumriTelefonit = (int)rdr["NumriTelefonit"];
                    }
                    if (rdr["Email"] != DBNull.Value)
                    {
                        mKlienti.Email = (string)rdr["Email"];
                    }
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 22
0
        public void SelectAllKategorit()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("KategoriaSelectAll", con);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    Kategoria k = new Kategoria();
                    k.KategoriaID = (int)rdr["KategoriaID"];
                    if (rdr["vleraKategorise"] != DBNull.Value)
                    {
                        k.Vlera = (int)rdr["vleraKategorise"];
                    }
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 23
0
        public void SelectedID(int ProduktiID)
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("ProduktiSelectRow", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ProduktiID", ProduktiID);

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    mProdukti.ProduktiID = (int)rdr["ProduktiID"];

                    if (rdr["Emri"] != DBNull.Value)
                    {
                        mProdukti.Emri = (string)rdr["Emri"];
                    }
                    if (rdr["Pershkrimi"] != DBNull.Value)
                    {
                        mProdukti.Pershkrimi = (string)rdr["Pershkrimi"];
                    }
                    if (rdr["Prodhuesi"] != DBNull.Value)
                    {
                        mProdukti.Prodhuesi = (string)rdr["Prodhuesi"];
                    }
                    if (rdr["Modeli"] != DBNull.Value)
                    {
                        mProdukti.Modeli = (string)rdr["Modeli"];
                    }
                    if (rdr["Jetegjatesia"] != DBNull.Value)
                    {
                        mProdukti.Jetegjatesia = (int)rdr["Jetegjatesia"];
                    }
                    if (rdr["Lloji"] != DBNull.Value)
                    {
                        mProdukti.Lloji = (string)rdr["Lloji"];
                    }
                    if (rdr["GrupiID"] != DBNull.Value)
                    {
                        mProdukti.GrupiID = (int)rdr["GrupiID"];
                    }
                    if (rdr["Statusi"] != DBNull.Value)
                    {
                        mProdukti.Statusi = (bool)rdr["Statusi"];
                    }
                    if (rdr["NrSerik"] != DBNull.Value)
                    {
                        mProdukti.NrSerik = (string)rdr["NrSerik"];
                    }
                    if (rdr["salvageValue"] != DBNull.Value)
                    {
                        mProdukti.salvageValue = (decimal)rdr["salvageValue"];
                    }
                    if (rdr["Cmimi"] != DBNull.Value)
                    {
                        mProdukti.Cmimi = (decimal)rdr["Cmimi"];
                    }
                    if (rdr["Data1"] != DBNull.Value)
                    {
                        mProdukti.Data1 = (DateTime)rdr["Data1"];
                    }
                }
            }
            finally
            {
                con.Close();
            }
        }
Esempio n. 24
0
        public void SelectAllProduktet()
        {
            SqlConnection con = Generals.GetNewConnection();

            try
            {
                SqlCommand cmd = new SqlCommand("ProduktiSelectAll", con);
                cmd.CommandType = CommandType.StoredProcedure;

                SqlDataReader rdr = cmd.ExecuteReader();
                while (rdr.Read())
                {
                    Produkti p = new Produkti();
                    p.ProduktiID = (int)rdr["ProduktiID"];
                    if (rdr["Emri"] != DBNull.Value)
                    {
                        p.Emri = (string)rdr["Emri"];
                    }
                    if (rdr["Pershkrimi"] != DBNull.Value)
                    {
                        p.Pershkrimi = (string)rdr["Pershkrimi"];
                    }
                    if (rdr["Prodhuesi"] != DBNull.Value)
                    {
                        p.Prodhuesi = (string)rdr["Prodhuesi"];
                    }
                    if (rdr["Modeli"] != DBNull.Value)
                    {
                        p.Modeli = (string)rdr["Modeli"];
                    }
                    if (rdr["Jetegjatesia"] != DBNull.Value)
                    {
                        p.Jetegjatesia = (int)rdr["Jetegjatesia"];
                    }
                    if (rdr["Lloji"] != DBNull.Value)
                    {
                        p.Lloji = (string)rdr["Lloji"];
                    }
                    if (rdr["GrupiID"] != DBNull.Value)
                    {
                        p.GrupiID = (int)rdr["GrupiID"];
                    }
                    if (rdr["Statusi"] != DBNull.Value)
                    {
                        p.Statusi = (bool)rdr["Statusi"];
                    }
                    if (rdr["NrSerik"] != DBNull.Value)
                    {
                        p.NrSerik = (string)rdr["NrSerik"];
                    }
                    if (rdr["salvageValue"] != DBNull.Value)
                    {
                        p.salvageValue = (decimal)rdr["salvageValue"];
                    }
                    if (rdr["Cmimi"] != DBNull.Value)
                    {
                        p.Cmimi = (decimal)rdr["Cmimi"];
                    }
                    if (rdr["Data1"] != DBNull.Value)
                    {
                        p.Data1 = (DateTime)rdr["Data1"];
                    }
                    mProduktet.Add(p);
                }
            }
            finally
            {
                con.Close();
            }
        }