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; }
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; }
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; }
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; }
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; }