예제 #1
0
        public int SaveDataTable(DataTable dt)
        {
            int UpdateCount = 0;
            if (dt.Rows.Count > 0)
            {
                string SQL = new SQLGenerator().DataTableSQL(dt);
                SQLAccess sqla = new SQLAccess();
                UpdateCount = sqla.ExecuteSQL(SQL);
            }

            return UpdateCount;
        }
예제 #2
0
        private i9Message SaveIncident(i9Message mMessage)
        {
            i9Message response = new i9Message();
            DataSet ds = mMessage.MsgBodyDataSet;
            StringBuilder sbSQL = new StringBuilder();

            SQLGenerator SqlGen = new SQLGenerator();

            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9Event"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9LawIncident"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9CADServiceCall"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9Offense"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9Person"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9Vehicle"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9Location"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9Property"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9VehicleRecovery"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9VehicleTowed"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9Narrative"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9PersonAKA"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9PersonSMT"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9AttachmentLink"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9Attachment"]));
            sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9AttachmentData"]));

            SQLAccess sqla = new SQLAccess();
            string SQL =   SQLUtility.WrapInTransaction( sbSQL.ToString());
            sqla.ExecuteSQL(SQL);

            return response;
        }
예제 #3
0
 public int SaveDataDataset(DataSet ds)
 {
     string SQL = new SQLGenerator().DataSetSQL(ds);
     SQLAccess sqla = new SQLAccess();
     return sqla.ExecuteSQL(SQL);
 }
예제 #4
0
        private i9Message Security_SaveGroupItems(i9Message requestMessage)
        {
            i9Message ResponseMessage = new i9Message();
            try
            {
                if (requestMessage.MsgBodyDataSet != null)
                {
                    if (requestMessage.MsgBodyDataSet.Tables.Count > 0)
                    {                        
                        StringBuilder sbSQL = new StringBuilder();
                        SQLGenerator SqlGen = new SQLGenerator();
                        DataSet ds = requestMessage.MsgBodyDataSet;

                        sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9SecurityGroup"]));
                        sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9SecurityGroupModule"]));
                        sbSQL.Append(SqlGen.DataTableSQL(ds.Tables["i9SecurityGroupTask"]));
                     
                        SQLAccess sqla = new SQLAccess();
                        string SQL = SQLUtility.WrapInTransaction(sbSQL.ToString());
                        sqla.ExecuteSQL(SQL);

                        ResponseMessage.ErrorStatus.IsError = false;
                    }
                }
            }
            catch (Exception ex)
            {
                ServiceLogManager.LogThis("Error saving dataset", LogEventType.Error, ex, "", "");
                ResponseMessage.ErrorStatus.IsError = true;
                ResponseMessage.ErrorStatus.ErrorMsg = ex.Message;
            }

            return ResponseMessage;
        }