예제 #1
0
        public void Save()
        {
            string sql = @"INSERT INTO RejestrCzynnosci VALUES( @RejestrCzynnosciGUID,	@NazwaAdministratoraDanych,	@WspolAdministratorzy,	@InsepktorDanychOsobowych,	@NazwaZbioruDanych,	@RodzajCzynnosci,	@TytulCzynnosci,	@CelPrzetwarzania,	@OpisKategoriiOsob,	@KategorieOdbiorcow,	@KategorieDanychOsobowych,	@InformarcjeOPrzekazaniuDoPanstwaTrzeciego,	@PlanowanyTerminUsuniecia,	@OpisTechniczny,	@Uwagi, @TypRejestruCzynnosci,	@CreatedBy,	@CreatedDateTime,	@LastModifiedBy,	@LastModifiedDateTime, @CompanyGUID )";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@RejestrCzynnosciGUID", RejestrCzynnosciGUID));
            paramList.Add(new SQLiteParameter("@NazwaAdministratoraDanych", NazwaAdministratoraDanych));
            paramList.Add(new SQLiteParameter("@WspolAdministratorzy", WspolAdministratorzy));
            paramList.Add(new SQLiteParameter("@InsepktorDanychOsobowych", InsepktorDanychOsobowych));
            paramList.Add(new SQLiteParameter("@NazwaZbioruDanych", NazwaZbioruDanych));
            paramList.Add(new SQLiteParameter("@RodzajCzynnosci", RodzajCzynnosci));
            paramList.Add(new SQLiteParameter("@TytulCzynnosci", TytulCzynnosci));
            paramList.Add(new SQLiteParameter("@CelPrzetwarzania", CelPrzetwarzania));
            paramList.Add(new SQLiteParameter("@OpisKategoriiOsob", OpisKategoriiOsob));
            paramList.Add(new SQLiteParameter("@KategorieOdbiorcow", KategorieOdbiorcow));
            paramList.Add(new SQLiteParameter("@KategorieDanychOsobowych", KategorieDanychOsobowych));
            paramList.Add(new SQLiteParameter("@InformarcjeOPrzekazaniuDoPanstwaTrzeciego", InformarcjeOPrzekazaniuDoPanstwaTrzeciego));
            paramList.Add(new SQLiteParameter("@PlanowanyTerminUsuniecia", PlanowanyTerminUsuniecia));
            paramList.Add(new SQLiteParameter("@OpisTechniczny", OpisTechniczny));
            paramList.Add(new SQLiteParameter("@TypRejestruCzynnosci", TypRejestruCzynnosci));
            paramList.Add(new SQLiteParameter("@Uwagi", Uwagi));
            paramList.Add(new SQLiteParameter("@CreatedBy", CreatedBy));
            paramList.Add(new SQLiteParameter("@CreatedDateTime", CreatedDateTime));
            paramList.Add(new SQLiteParameter("@LastModifiedBy", LastModifiedBy));
            paramList.Add(new SQLiteParameter("@LastModifiedDateTime", LastModifiedDateTime));
            paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            connector = null;
        }
예제 #2
0
        public List <Company> GetUserCompany()
        {
            List <Company> companyList = new List <Company>();

            string sql = @"SELECT 
                            C.CompanyGUID
                            ,C.CompanyName
                         FROM Company C INNER JOIN CompanyUser CU
                            ON C.CompanyGUID = CU.CompanyGUID
                         WHERE CU.UserGUID = @UserGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@UserGUID", UserGUID));

            NGSConnector     connector = new NGSConnector();
            SQLiteDataReader reader    = connector.execSQLWithResult(sql, paramList);

            while (reader.Read())
            {
                Company company = new Company();
                company.FillData(reader.GetString(0), reader.GetString(1));
                companyList.Add(company);
            }

            reader.Close();

            return(companyList);
        }
예제 #3
0
        public List <DocumentTemplate> GetDocumentTemplateList()
        {
            List <DocumentTemplate> documentList = new List <DocumentTemplate>();

            string sql = @"SELECT 
                DocumentTemplateGUID, DocumentName, DocumentText, DocumentHint, DocumentType, DocumentEndDate
            FROM DocumentTemplate";

            NGSConnector     connector = new NGSConnector();
            SQLiteDataReader reader    = connector.execSQLWithResult(sql);

            while (reader.Read())
            {
                DocumentTemplate u = new DocumentTemplate();
                u.FillData(reader.GetString(0)
                           , reader.GetString(1)
                           , reader.GetString(2)
                           , reader.IsDBNull(3) ? "" : reader.GetString(3)
                           , reader.IsDBNull(4) ? "D" : reader.GetString(4)
                           , reader.IsDBNull(5) ? "N" : reader.GetString(5)
                           );
                documentList.Add(u);
            }

            reader.Close();

            return(documentList);
        }
예제 #4
0
        public List <DocumentTemplateFlow> GetDocumentTemplateFlowList()
        {
            List <DocumentTemplateFlow> documentList = new List <DocumentTemplateFlow>();

            string sql = @"SELECT 
                DocumentTemplateFlowGUID, DocumentTemplateFlowName, DocumentTemplateFlowType
            FROM DocumentTemplateFlow";

            NGSConnector     connector = new NGSConnector();
            SQLiteDataReader reader    = connector.execSQLWithResult(sql);

            while (reader.Read())
            {
                DocumentTemplateFlow u = new DocumentTemplateFlow();
                u.FillData(reader.GetString(0)
                           , reader.GetString(1)
                           , reader.GetString(2)
                           );
                documentList.Add(u);
            }

            reader.Close();

            return(documentList);
        }
예제 #5
0
        public void Save()
        {
            string sql = @"INSERT INTO Document VALUES( @CompanyGUID, @DocumentGUID, @DocumentName, @DocumentText, @CreatedDateTime, @CreatedBy, @LastModifiedDateTime, @LastModifiedBy, @PrintedDateTime, @DocumentEndDateTime)";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));
            paramList.Add(new SQLiteParameter("@DocumentGUID", DocumentGUID));
            paramList.Add(new SQLiteParameter("@DocumentName", DocumentName));
            paramList.Add(new SQLiteParameter("@DocumentText", DocumentText));
            paramList.Add(new SQLiteParameter("@CreatedDateTime", CreatedDateTime));
            paramList.Add(new SQLiteParameter("@CreatedBy", CreatedBy));
            paramList.Add(new SQLiteParameter("@LastModifiedDateTime", LastModifiedDateTime));
            paramList.Add(new SQLiteParameter("@LastModifiedBy", LastModifiedBy));
            paramList.Add(new SQLiteParameter("@PrintedDateTime", PrintedDateTime));
            paramList.Add(new SQLiteParameter("@DocumentEndDateTime", DocumentEndDateTime));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            GlobalVariables.Log("Użytkownik stowrzył nowy dokument: " + DocumentName + " document id: " + DocumentGUID);

            connector = null;
        }
예제 #6
0
        public List <User> GetListOfUsers()
        {
            List <User> listOfUsers = new List <User>();

            string sql = @"SELECT 
                UserGUID, FirstName, LastName, UserName, UserPassword
            FROM User";

            NGSConnector     connector = new NGSConnector();
            SQLiteDataReader reader    = connector.execSQLWithResult(sql);

            while (reader.Read())
            {
                User u = new User();
                u.FillData(reader.GetString(0)
                           , reader.GetString(1)
                           , reader.GetString(2)
                           , reader.GetString(3)
                           , reader.IsDBNull(4) ? "" : reader.GetString(4)
                           );
                listOfUsers.Add(u);
            }

            reader.Close();

            return(listOfUsers);
        }
예제 #7
0
        public List <DocumentTemplateFlowAssignment> GetDocumentTemplateFlowAssignmentList()
        {
            List <DocumentTemplateFlowAssignment> documentList = new List <DocumentTemplateFlowAssignment>();

            string sql = @"SELECT 
                DocumentTemplateFlowAssignmentGUID, DocumentTemplateFlowGUID, DocumentTemplateGUID, DocumentPosition
            FROM DocumentTemplateFlowAssignment";

            NGSConnector     connector = new NGSConnector();
            SQLiteDataReader reader    = connector.execSQLWithResult(sql);

            while (reader.Read())
            {
                DocumentTemplateFlowAssignment u = new DocumentTemplateFlowAssignment();
                u.FillData(reader.GetString(0)
                           , reader.GetString(1)
                           , reader.GetString(2)
                           , reader.GetInt32(3)
                           );
                documentList.Add(u);
            }

            reader.Close();

            return(documentList);
        }
예제 #8
0
        public bool LoginUser(String userName, String userPassword)
        {
            bool ret = false;

            string sql = @"SELECT 
                            UserGUID  
                            ,FirstName
                            ,LastName
                            ,UserName
                            ,UserPassword
                         FROM User
                         WHERE UserName = @UserName AND UserPassword = @UserPassword";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@UserName", userName));
            paramList.Add(new SQLiteParameter("@UserPassword", GlobalVariables.GetMD5(userPassword)));

            NGSConnector     connector = new NGSConnector();
            SQLiteDataReader reader    = connector.execSQLWithResult(sql, paramList);

            if (reader.HasRows)
            {
                ret = true;
                FillData(reader);
            }

            return(ret);
        }
예제 #9
0
        public void Update()
        {
            string sql = @"UPDATE Document 
            SET DocumentName = @DocumentName
                ,DocumentText = @DocumentText
                ,CreatedDateTime = @CreatedDateTime
                ,CreatedBy = @CreatedBy
                ,LastModifiedDateTime = @LastModifiedDateTime
                ,LastModifiedBy = @LastModifiedBy
                ,PrintedDateTime = @PrintedDateTime
                ,DocumentEndDateTime = @DocumentEndDateTime
            WHERE CompanyGUID = @CompanyGUID AND DocumentGUID = @DocumentGUID
            ";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));
            paramList.Add(new SQLiteParameter("@DocumentGUID", DocumentGUID));
            paramList.Add(new SQLiteParameter("@DocumentName", DocumentName));
            paramList.Add(new SQLiteParameter("@DocumentText", DocumentText));
            paramList.Add(new SQLiteParameter("@CreatedDateTime", CreatedDateTime));
            paramList.Add(new SQLiteParameter("@CreatedBy", CreatedBy));
            paramList.Add(new SQLiteParameter("@LastModifiedDateTime", LastModifiedDateTime));
            paramList.Add(new SQLiteParameter("@LastModifiedBy", LastModifiedBy));
            paramList.Add(new SQLiteParameter("@PrintedDateTime", PrintedDateTime));
            paramList.Add(new SQLiteParameter("@DocumentEndDateTime", DocumentEndDateTime));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            GlobalVariables.Log("Użytkownik zaktualizował dokument: " + DocumentName + " document id: " + DocumentGUID);

            connector = null;
        }
예제 #10
0
        public void Update()
        {
            string sql = @"UPDATE RejestrCzynnosci SET NazwaAdministratoraDanych = @NazwaAdministratoraDanych,	WspolAdministratorzy = @WspolAdministratorzy,	InsepktorDanychOsobowych = @InsepktorDanychOsobowych,	NazwaZbioruDanych = @NazwaZbioruDanych,	RodzajCzynnosci = @RodzajCzynnosci,	TytulCzynnosci = @TytulCzynnosci,	CelPrzetwarzania = @CelPrzetwarzania,	OpisKategoriiOsob = @OpisKategoriiOsob,	KategorieOdbiorcow = @KategorieOdbiorcow,	KategorieDanychOsobowych = @KategorieDanychOsobowych,	InformarcjeOPrzekazaniuDoPanstwaTrzeciego = @InformarcjeOPrzekazaniuDoPanstwaTrzeciego,	PlanowanyTerminUsuniecia = @PlanowanyTerminUsuniecia,	OpisTechniczny = @OpisTechniczny,	TypRejestruCzynnosci = @TypRejestruCzynnosci, Uwagi = @Uwagi,	CreatedBy = @CreatedBy,	CreatedDateTime = @CreatedDateTime,	LastModifiedBy = @LastModifiedBy,	LastModifiedDateTime = @LastModifiedDateTime WHERE RejestrCzynnosciGUID = @RejestrCzynnosciGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@RejestrCzynnosciGUID", RejestrCzynnosciGUID));
            paramList.Add(new SQLiteParameter("@NazwaAdministratoraDanych", NazwaAdministratoraDanych));
            paramList.Add(new SQLiteParameter("@WspolAdministratorzy", WspolAdministratorzy));
            paramList.Add(new SQLiteParameter("@InsepktorDanychOsobowych", InsepktorDanychOsobowych));
            paramList.Add(new SQLiteParameter("@NazwaZbioruDanych", NazwaZbioruDanych));
            paramList.Add(new SQLiteParameter("@RodzajCzynnosci", RodzajCzynnosci));
            paramList.Add(new SQLiteParameter("@TytulCzynnosci", TytulCzynnosci));
            paramList.Add(new SQLiteParameter("@CelPrzetwarzania", CelPrzetwarzania));
            paramList.Add(new SQLiteParameter("@OpisKategoriiOsob", OpisKategoriiOsob));
            paramList.Add(new SQLiteParameter("@KategorieOdbiorcow", KategorieOdbiorcow));
            paramList.Add(new SQLiteParameter("@KategorieDanychOsobowych", KategorieDanychOsobowych));
            paramList.Add(new SQLiteParameter("@InformarcjeOPrzekazaniuDoPanstwaTrzeciego", InformarcjeOPrzekazaniuDoPanstwaTrzeciego));
            paramList.Add(new SQLiteParameter("@PlanowanyTerminUsuniecia", PlanowanyTerminUsuniecia));
            paramList.Add(new SQLiteParameter("@OpisTechniczny", OpisTechniczny));
            paramList.Add(new SQLiteParameter("@Uwagi", Uwagi));
            paramList.Add(new SQLiteParameter("@TypRejestruCzynnosci", TypRejestruCzynnosci));
            paramList.Add(new SQLiteParameter("@CreatedBy", CreatedBy));
            paramList.Add(new SQLiteParameter("@CreatedDateTime", CreatedDateTime));
            paramList.Add(new SQLiteParameter("@LastModifiedBy", LastModifiedBy));
            paramList.Add(new SQLiteParameter("@LastModifiedDateTime", LastModifiedDateTime));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            connector = null;
        }
예제 #11
0
        public void DeleteSettings()
        {
            string sql = @"DELETE FROM Settings WHERE CompanyGUID = @CompanyGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            connector = null;
        }
예제 #12
0
        public void RemoveAssignCompany(string companyGUID)
        {
            string sql = @"DELETE FROM CompanyUser WHERE CompanyGUID = @CompanyGUID AND UserGUID = @UserGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", companyGUID));
            paramList.Add(new SQLiteParameter("@UserGUID", UserGUID));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);
            connector = null;
        }
예제 #13
0
        public void Save()
        {
            string sql = @"INSERT INTO Magazyn VALUES(@KopertaGUID,
                            @NrKoperty,
                            @NrPlomby,
                            @DataOdbioru,
                            @GodzinaOdbioru,
                            @DataKopii,
                            @KopertaNrPro,
                            @Przekazal,
                            @Zwrocil,
                            @NazwaKlienta,
                            @NIP,
                            @AdresKlienta,
                            @KodPocztowy,
                            @Miasto,
                            @KonwojentImie,
                            @KonwojentNazwisko,
                            @DataZwrotu,
                            @CompanyGUID
                            )";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@KopertaGUID", KopertaGUID));
            paramList.Add(new SQLiteParameter("@NrKoperty", NrKoperty));
            paramList.Add(new SQLiteParameter("@NrPlomby", NrPlomby));
            paramList.Add(new SQLiteParameter("@DataOdbioru", DataOdbioru));
            paramList.Add(new SQLiteParameter("@GodzinaOdbioru", GodzinaOdbioru));
            paramList.Add(new SQLiteParameter("@DataKopii", DataKopii));
            paramList.Add(new SQLiteParameter("@KopertaNrPro", KopertaNrPro));
            paramList.Add(new SQLiteParameter("@Przekazal", Przekazal));
            paramList.Add(new SQLiteParameter("@Zwrocil", Zwrocil));
            paramList.Add(new SQLiteParameter("@NazwaKlienta", NazwaKlienta));
            paramList.Add(new SQLiteParameter("@NIP", NIP));
            paramList.Add(new SQLiteParameter("@AdresKlienta", AdresKlienta));
            paramList.Add(new SQLiteParameter("@KodPocztowy", KodPocztowy));
            paramList.Add(new SQLiteParameter("@Miasto", Miasto));
            paramList.Add(new SQLiteParameter("@KonwojentImie", KonwojentImie));
            paramList.Add(new SQLiteParameter("@KonwojentNazwisko", KonwojentNazwisko));
            paramList.Add(new SQLiteParameter("@DataZwrotu", DataZwrotu));
            paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));


            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            connector = null;
        }
예제 #14
0
        public void Delete()
        {
            string sql = @"DELETE FROM Magazyn WHERE CompanyGUID = @CompanyGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", GlobalVariables.CurrentCompany.CompanyGUID));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            connector = null;
        }
예제 #15
0
        public void Save()
        {
            string sql = @"INSERT INTO Company VALUES( @CompanyGUID, @CompanyName )";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));
            paramList.Add(new SQLiteParameter("@CompanyName", CompanyName));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            connector = null;
        }
예제 #16
0
        public void Update()
        {
            string sql = @"UPDATE Company SET CompanyName = @CompanyName WHERE CompanyGUID = @CompanyGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));
            paramList.Add(new SQLiteParameter("@CompanyName", CompanyName));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            connector = null;
        }
예제 #17
0
        public void SavePassword(string userGUID, string userPassword)
        {
            string sql = @"UPDATE User 
                            SET UserPassword = @UserPassword
                         WHERE UserGUID = @UserGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@UserGUID", userGUID));
            paramList.Add(new SQLiteParameter("@UserPassword", GlobalVariables.GetMD5(userPassword)));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);
        }
예제 #18
0
        public void SaveUser(string userGUID, string userName, string firstName, string lastName)
        {
            string sql = @"INSERT INTO User( UserGUID, UserName, FirstName, LastName ) 
                           Values( @UserGUID, @UserName, @FirstName, @LastName )";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@UserGUID", userGUID));
            paramList.Add(new SQLiteParameter("@UserName", userName));
            paramList.Add(new SQLiteParameter("@FirstName", firstName));
            paramList.Add(new SQLiteParameter("@LastName", lastName));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);
        }
예제 #19
0
        public void AssignCompany(string companyGUID)
        {
            RemoveAssignCompany(companyGUID);
            string sql = @"INSERT INTO CompanyUser VALUES( @CompanyUserGUID, @CompanyGUID, @UserGUID)";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", companyGUID));
            paramList.Add(new SQLiteParameter("@UserGUID", UserGUID));
            paramList.Add(new SQLiteParameter("@CompanyUserGUID", GlobalVariables.GetNewGUID()));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);
            connector = null;
        }
예제 #20
0
        public void Delete()
        {
            string sql = @"DELETE FROM DocumentField WHERE CompanyGUID = @CompanyGUID AND DocumentGUID = @DocumentGUID AND FieldName = @FieldName ";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));
            paramList.Add(new SQLiteParameter("@DocumentGUID", DocumentGUID));
            paramList.Add(new SQLiteParameter("@FieldName", FieldName));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            connector = null;
        }
예제 #21
0
        public void UpdateUser(string userGUID, string firstName, string lastName)
        {
            string sql = @"UPDATE User
                            SET FirstName = @FirstName,
                                LastName = @LastName
                            WHERE UserGUID = @UserGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@UserGUID", userGUID));
            paramList.Add(new SQLiteParameter("@FirstName", firstName));
            paramList.Add(new SQLiteParameter("@LastName", lastName));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);
        }
예제 #22
0
        public void Delete()
        {
            string sql = @"DELETE FROM Document WHERE CompanyGUID = @CompanyGUID AND DocumentGUID = @DocumentGUID";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));
            paramList.Add(new SQLiteParameter("@DocumentGUID", DocumentGUID));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            GlobalVariables.Log("Użytkownik usunął document id: " + DocumentGUID);

            connector = null;
        }
예제 #23
0
        public void SaveSettings()
        {
            string sql = @"INSERT INTO Settings VALUES( @CompanyGUID, @SettingName, @SettingValue)";

            NGSConnector connector = new NGSConnector();

            foreach (KeyValuePair <String, String> keyPair in SettingList)
            {
                List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();
                paramList.Add(new SQLiteParameter("@CompanyGUID", CompanyGUID));
                paramList.Add(new SQLiteParameter("@SettingName", keyPair.Key));
                paramList.Add(new SQLiteParameter("@SettingValue", keyPair.Value));

                connector.execSQL(sql, paramList);
            }
            connector = null;
        }
예제 #24
0
        public List <Document> GetDocumentListBySearchPhrase(String searchTxt)
        {
            List <Document> documentList = new List <Document>();

            string sql = @"          
            select DISTINCT D.*, 'N' as DocumentType from DocumentField DF 
            INNER JOIN Document D ON DF.CompanyGUID = D.CompanyGUID AND DF.DocumentGUID = D.DocumentGUID
            INNER JOIN User U ON U.UserGUID = D.CreatedBy
            INNER JOIN User U1 On U1.UserGUID = D.LastModifiedBy
            WHERE (DF.FieldValue Like @searchTxt
             OR U.FirstName LIKE @searchTxt OR U.LastName LIKE @searchTxt OR U.UserName LIKE @searchTxt
             OR U1.FirstName LIKE @searchTxt OR U1.LastName LIKE @searchTxt OR U1.UserName LIKE @searchTxt
             OR D.DocumentName LIKE @searchTxt OR D.PrintedDateTime LIKE @searchTxt OR D.CreatedDateTime LIKE @searchTxt OR D.LastModifiedDateTime LIKE @searchTxt
            ) AND D.CompanyGUID = @CompanyGUID
            ";

            NGSConnector connector = new NGSConnector();
            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", GlobalVariables.CurrentCompany.CompanyGUID));
            paramList.Add(new SQLiteParameter("@searchTxt", "%" + searchTxt + "%"));
            SQLiteDataReader reader = connector.execSQLWithResult(sql, paramList);

            while (reader.Read())
            {
                Document u = new Document();
                u.FillData(reader.GetString(0)
                           , reader.GetString(1)
                           , reader.GetString(2)
                           , reader.GetString(3)
                           , reader.GetDateTime(4)
                           , reader.GetString(5)
                           , reader.GetDateTime(6)
                           , reader.GetString(7)
                           , reader.GetDateTime(8)
                           , reader.IsDBNull(9) ? (DateTime?)null : reader.GetDateTime(9)
                           );

                documentList.Add(u);
            }

            reader.Close();

            return(documentList);
        }
예제 #25
0
        public void Save()
        {
            string sql = @"INSERT INTO DocumentTemplateFlow VALUES( @DocumentTemplateFlowGUID, @DocumentTemplateFlowName, @DocumentTemplateFlowType)";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@DocumentTemplateFlowGUID", DocumentTemplateFlowGUID));
            paramList.Add(new SQLiteParameter("@DocumentTemplateFlowName", DocumentTemplateFlowName));
            paramList.Add(new SQLiteParameter("@DocumentTemplateFlowType", DocumentTemplateFlowType));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            GlobalVariables.Log("Użytkownik stowrzył kategorie: " + DocumentTemplateFlowName + "  id: " + DocumentTemplateFlowGUID);

            connector = null;
        }
예제 #26
0
        public void SaveLog(string userGUID, string companyGUID, string logMessage, string logType)
        {
            string sql = @"INSERT INTO LogTable( LogGUID, LogDateTime, LogType, LogMessage, UserGUID, CompanyGUID ) 
                           Values( @LogGUID, @LogDateTime, @LogType, @LogMessage, @UserGUID, @CompanyGUID )";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@LogGUID", GlobalVariables.GetNewGUID()));
            paramList.Add(new SQLiteParameter("@LogDateTime", DateTime.Now));
            paramList.Add(new SQLiteParameter("@LogType", logType));
            paramList.Add(new SQLiteParameter("@LogMessage", logMessage));
            paramList.Add(new SQLiteParameter("@UserGUID", userGUID));
            paramList.Add(new SQLiteParameter("@CompanyGUID", companyGUID));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);
        }
예제 #27
0
        public void Save()
        {
            string sql = @"INSERT INTO DocumentTemplateFlowAssignment VALUES( @DocumentTemplateFlowAssignmentGUID, @DocumentTemplateFlowGUID, @DocumentTemplateGUID, @DocumentPosition)";

            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@DocumentTemplateFlowAssignmentGUID", DocumentTemplateFlowAssignmentGUID));
            paramList.Add(new SQLiteParameter("@DocumentTemplateFlowGUID", DocumentTemplateFlowGUID));
            paramList.Add(new SQLiteParameter("@DocumentTemplateGUID", DocumentTemplateGUID));
            paramList.Add(new SQLiteParameter("@DocumentPosition", DocumentPosition));

            NGSConnector connector = new NGSConnector();

            connector.execSQL(sql, paramList);

            //GlobalVariables.Log("Użytkownik stowrzył szablon: " + DocumentName + "  id: " + DocumentTemplateGUID);

            connector = null;
        }
예제 #28
0
        public void LoadList(string text, string logType)
        {
            logList.Clear();
            string sql = "";

            if (logType == "WSZYSTKIE")
            {
                sql = "SELECT l.LogGUID, l.LogDateTime, l.LogType, l.LogMessage, l.UserGUID, l.CompanyGUID, u.UserName FROM LogTable l INNER JOIN User u ON u.UserGUID = l.UserGUID WHERE l.LogMessage like '%" + text + "%'";
            }
            else if (logType == "UŻYTKOWNIKA")
            {
                sql = "SELECT l.LogGUID, l.LogDateTime, l.LogType, l.LogMessage, l.UserGUID, l.CompanyGUID, u.UserName FROM LogTable l INNER JOIN User u ON u.UserGUID = l.UserGUID WHERE l.LogMessage like '%" + text + "%' and lower(logType) = '" + "user" + "'";
            }
            else if (logType == "SYSTEMOWE")
            {
                sql = "SELECT l.LogGUID, l.LogDateTime, l.LogType, l.LogMessage, l.UserGUID, l.CompanyGUID, u.UserName FROM LogTable l INNER JOIN User u ON u.UserGUID = l.UserGUID WHERE l.LogMessage like '%" + text + "%' and lower(logType) = '" + "system" + "'";
            }

            NGSConnector connector = new NGSConnector();

            SQLiteDataReader reader = connector.execSQLWithResult(sql);

            while (reader.Read())
            {
                Log l = new Log();
                l.FillData(reader.GetString(0)
                           , reader.GetDateTime(1)
                           , reader.GetString(2)
                           , reader.GetString(3)
                           , reader.GetString(4)
                           , reader.GetString(5)
                           , reader.GetString(6));

                logList.Add(l);
            }

            reader.Close();
            connector = null;
        }
예제 #29
0
        public void LoadSettings(String companyGUID)
        {
            string sql = @"SELECT SettingName, SettingValue FROM Settings WHERE CompanyGUID = @CompanyGUID";

            SettingList = new Dictionary <string, string>();
            CompanyGUID = companyGUID;
            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();

            paramList.Add(new SQLiteParameter("@CompanyGUID", companyGUID));

            NGSConnector     connector = new NGSConnector();
            SQLiteDataReader reader    = connector.execSQLWithResult(sql, paramList);

            while (reader.Read())
            {
                SettingList.Add(reader.GetString(0), reader.GetString(1));
            }

            reader.Close();

            connector = null;
        }
예제 #30
0
        public void Delete()
        {
            List <System.Data.SQLite.SQLiteParameter> paramList = new List <System.Data.SQLite.SQLiteParameter>();
            NGSConnector connector = new NGSConnector();

            string sql = @"DELETE FROM DocumentTemplate WHERE DocumentTemplateGUID In (SELECT DocumentTemplateGUID FROM DocumentTemplateFlowAssignment WHERE DocumentTemplateFlowGUID= @DocumentTemplateFlowGUID)";

            paramList.Add(new SQLiteParameter("@DocumentTemplateFlowGUID", DocumentTemplateFlowGUID));
            connector.execSQL(sql, paramList);

            sql = @"DELETE FROM DocumentTemplateFlowAssignment WHERE DocumentTemplateFlowGUID = @DocumentTemplateFlowGUID";
            paramList.Add(new SQLiteParameter("@DocumentTemplateFlowGUID", DocumentTemplateFlowGUID));
            connector.execSQL(sql, paramList);

            sql = @"DELETE FROM DocumentTemplateFlow WHERE DocumentTemplateFlowGUID = @DocumentTemplateFlowGUID";
            paramList.Add(new SQLiteParameter("@DocumentTemplateFlowGUID", DocumentTemplateFlowGUID));
            connector.execSQL(sql, paramList);

            GlobalVariables.Log("Użytkownik usunął kategorie: " + DocumentTemplateFlowName + "  id: " + DocumentTemplateFlowGUID);

            connector = null;
        }