Exemple #1
0
        private void KonvertoSinkronizoNeWebKerkesa()
        {
            string[] fusha  = new string[4];
            string[] llojet = new string[4];
            fusha[0] = "ID_KERKESA";
            fusha[1] = "DATA_KERKESA";
            fusha[2] = "SASIA";
            fusha[3] = "ALG";

            llojet[0] = "char(255)";
            llojet[1] = "char(255)";
            llojet[2] = "char(255)";
            llojet[3] = "char(255)";
            KlaseExcel excel     = new KlaseExcel("KERKESA.xls", fusha, llojet);
            DataSet    dsKerkesa = conObject.ExecuteQuery("SELECT * FROM KERKESA WHERE YEAR(DATA_KERKESA) = YEAR(GETDATE())");

            excel.ShkruajTabele("KERKESA.xls", fusha, llojet, dsKerkesa);
        }
Exemple #2
0
        /// <summary>
        /// kthen nje dataset me notat e nxenesve per klasat e zgjedhura
        /// ne varesi te kritereve te kerkimit
        /// </summary>
        /// <returns></returns>
        private DataSet KerkoNotat()
        {
            string strKushti = " AND NT_VITI_SHKOLLOR = '" + vitiShkollor + "' AND NT_RIPROVIM = 0 ";
            int    semestri  = semestriAktual();

            if (rbNotaMomentale.Checked)
            {
                string fillRev, mbarRev;
                fillRev    = dtpFillimi.Value.ToString("yyyy/MM/dd");
                mbarRev    = dtpMbarimi.Value.ToString("yyyy/MM/dd");
                strKushti += " AND NT_MOMENTALES" + semestri + " = 1 AND NT_SEMESTRI1= 0 AND" +
                             " NT_SEMESTRI2 = 0 AND NT_VJETORE = 0 AND NT_DATA BETWEEN '" + fillRev + "' AND '" + mbarRev + "' AND NT_MUNGESE_ME = 0 AND NT_MUNGESE_PA = 0 ";
            }
            else if (rbMungesa.Checked)
            {
                DateTime dtSot  = DateTime.Now;
                string   sotRev = dtSot.ToString("yyyy/MM/dd");
                strKushti += " AND lower(NT_VLERESIMI) = 'm' AND NT_MOMENTALES" + semestri + " = 1 AND NT_DATA = '" + sotRev + "' ";
            }
            else if (rbSemestri1.Checked)
            {
                strKushti += " AND NT_SEMESTRI1 = 1 AND NT_MUNGESE_ME = 0 AND NT_MUNGESE_PA = 0 ";
            }
            else if (rbSemestri2.Checked)
            {
                strKushti += " AND NT_SEMESTRI2 = 1 AND NT_MUNGESE_ME = 0 AND NT_MUNGESE_PA = 0 ";
            }
            else if (rbVjetore.Checked)
            {
                strKushti += " AND NT_VJETORE = 1 AND NT_MUNGESE_ME = 0 AND NT_MUNGESE_PA = 0 ";
            }
            string strKushtiKlasat = " AND (";
            int    count           = 0;

            foreach (Control c in panelExKlasat.Controls)
            {
                CheckBox cb = c as CheckBox;
                if (cb.Checked)
                {
                    if (cb.Name == "cbAll")
                    {
                        break;
                    }
                    else
                    {
                        count++;
                        if (count == 1)
                        {
                            strKushtiKlasat += "NT_KLASA = " + cb.Tag;
                        }
                        else
                        {
                            strKushtiKlasat += " OR NT_KLASA = " + cb.Tag;
                        }
                    }
                }
            }
            strKushtiKlasat += ")";
            if (count > 0)
            {
                strKushti = strKushti + strKushtiKlasat + " ORDER BY CONVERT(INT, NT_KLASA), " +
                            "NT_INDEKSI, NT_NR_AMZA, NT_CIKLI, NT_EMRI_LENDA, NT_DATA";
            }
            string strSql = "SELECT TBL_NOTA.*, AMZA_EMRI, AMZA_MBIEMRI FROM TBL_NOTA, TBL_AMZA WHERE NT_NR_AMZA = AMZA_NR_AMZA AND NT_CIKLI = AMZA_CIKLI " +
                            strKushti;

            return(conObject.ExecuteQuery(strSql));
        }