예제 #1
0
        public static PollingStep ConvertFromPollingStepDB(PollingStepDB item)
        {
            PollingStep toReturn = new PollingStep ();
            toReturn.Errors = item.Errors;
            toReturn.MessageID = item.MessageID;
            toReturn.PollingAnswer1 = item.PollingAnswer1;
            toReturn.PollingAnswer2 = item.PollingAnswer2;
            toReturn.PollingAnswer3 = item.PollingAnswer3;
            toReturn.PollingAnswer4 = item.PollingAnswer4;
            toReturn.PollingData1 = item.PollingData1;
            toReturn.PollingData2 = item.PollingData2;
            toReturn.PollingData3 = item.PollingData3;
            toReturn.PollingData4 = item.PollingData4;
            toReturn.PollingQuestion = item.PollingQuestion;
            toReturn.StepNumber = item.StepNumber;
            toReturn.HasResponded = item.HasResponded;

            return toReturn;
        }
예제 #2
0
        public void DeletePollingStep(PollingStepDB pollingStep)
        {
            lock (this.dbLock)
            {

                using (SQLiteConnection sqlCon = new SQLiteConnection(this.DBPath))
                {

                    sqlCon.Execute(WZConstants.DBClauseSyncOff);

                    sqlCon.BeginTransaction();

                    try
                    {

                        sqlCon.Execute("DELETE FROM PollingStepDB WHERE MessageGuid=? AND StepNumber=?", pollingStep.MessageGuid, pollingStep.StepNumber);
                        sqlCon.Commit();

                    } catch (Exception ex)
                    {

                        Console.WriteLine("Error in DeletePollingStep! {0}--{1}", ex.Message, ex.StackTrace);
                        sqlCon.Rollback();

                    }//end try catch

                }//end using sqlCon

            }//end lock
        }