コード例 #1
0
        public void Migrate2(string start, string end)
        {
            try
            {
                if (!string.IsNullOrEmpty(start) && !string.IsNullOrEmpty(end))
                {
                    DateTime _start = DateTime.Parse(start);
                    DateTime _end   = DateTime.Parse(end);

                    MigrationHistoryBLL MigrationHistoryBLL = new MigrationHistoryBLL();
                    MigrationHistoryBLL.ListRecord(_start, _end);

                    MigrationHistoryML MigrationHistory = new MigrationHistoryML();
                    MigrationHistory.DateStart         = _start;
                    MigrationHistory.DateEnd           = _end;
                    MigrationHistory.MigrateLogs       = true;
                    MigrationHistory.MigrateAssistance = true;
                    MigrationHistoryBLL.Save(MigrationHistory);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(String.Format("{0}.Migrate2: {1}", core, ex.Message));
            }
        }
コード例 #2
0
 public int Save(MigrationHistoryML MigrationHistory)
 {
     try
     {
         if (MigrationHistory.Id == 0)
         {
             return(MigrationHistoryDAL.Save(MigrationHistory));
         }
         else
         {
             return(MigrationHistoryDAL.Update(MigrationHistory));
         }
     }
     catch (Exception ex)
     {
         throw new Exception(String.Format("{0}.Save: {1}", core, ex));
     }
 }
コード例 #3
0
 public int Update(MigrationHistoryML MigrationHistory)
 {
     try
     {
         ModelDAL      ModelDAL = new ModelDAL();
         String        Response = ModelDAL.UpdateModel(MigrationHistory, TableName, IdUserSession);
         SqlConnection Conexion = new SqlConnection()
         {
             ConnectionString = ConnectionString
         };
         Conexion.Open();
         SqlCommand cmd2 = new SqlCommand(Response.ToString(), Conexion);
         cmd2.ExecuteNonQuery();
         return(MigrationHistory.Id);
     }
     catch (Exception ex)
     {
         throw new Exception(String.Format("{0}.update: {1}", core, ex));
     }
 }
コード例 #4
0
        public int Save(MigrationHistoryML MigrationHistory)
        {
            ModelDAL      data     = new ModelDAL();
            String        Response = data.InsertModel(MigrationHistory, TableName, IdUserSession);
            SqlConnection Conexion = new SqlConnection
            {
                ConnectionString = ConnectionString
            };

            using (SqlCommand cmd2 = new SqlCommand(Response.ToString(), Conexion))
            {
                Conexion.Open();
                int newID = (Int32)cmd2.ExecuteScalar();

                if (Conexion.State == System.Data.ConnectionState.Open)
                {
                    Conexion.Close();
                }
                return(newID);
            }
        }