Exemplo n.º 1
0
 public override bool Save()
 {
     if (m_domain.FullName == null)
     {
         return(SaveAs());
     }
     else
     {
         m_domain.DataType   = m_dataType.ToGenericType();
         m_domain.IsNullable = chbNullable.Checked;
         m_conn.AlterObject(m_oldDomain, m_domain);
         Init(m_domain, m_conn.Dialect);
         return(true);
     }
 }
Exemplo n.º 2
0
        public override bool Save()
        {
            if (m_obj == null)
            {
                return(SaveAs());
            }
            else
            {
                try
                {
                    ISpecificObjectStructure newStructure = CreateStructure(m_obj.ObjectName);
                    if (m_conn.DatabaseCaps.ExecuteSql)
                    {
                        string sql = Dialect.GenerateScript(dmp => { dmp.DropSpecificObject(m_obj); dmp.CreateSpecificObject(newStructure); });
                        if (!SqlConfirmForm.Run(sql, Dialect))
                        {
                            return(false);
                        }
                    }

                    m_conn.AlterObject(m_obj, newStructure);
                    if (m_pars != null && m_pars.SavedCallback != null)
                    {
                        m_pars.SavedCallback();
                    }

                    m_obj = m_conn.InvokeLoadSpecificObjectDetail(m_obj.ObjectType, m_obj.ObjectName);
                    FillFromStructure();
                    return(true);
                }
                catch (Exception e)
                {
                    Errors.Report(e);
                    return(false);
                }
            }
        }
Exemplo n.º 3
0
 public static void AlterObject(this IDatabaseSource conn, IAbstractObjectStructure oldObj, IAbstractObjectStructure newObj)
 {
     conn.AlterObject(oldObj, newObj, new DbDiffOptions());
 }