public UserDataTypes Get(Database database) { UserDataTypes types = new UserDataTypes(database); using (SqlConnection conn = new SqlConnection(connectioString)) { using (SqlCommand command = new SqlCommand("sp_MShelptype null, 'uddt'", conn)) { conn.Open(); using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { UserDataType type = new UserDataType(database); type.AllowNull = reader["nullable"].ToString().Equals("1"); type.Size = int.Parse(reader["length"].ToString()); type.Name = reader["UserDatatypeName"].ToString(); type.Owner = reader["owner"].ToString(); if (!reader["dt_prec"].ToString().Equals("")) { type.Precision = int.Parse(reader["dt_prec"].ToString()); } if (!reader["dt_scale"].ToString().Equals("")) { type.Scale = int.Parse(reader["dt_scale"].ToString()); } type.Type = reader["basetypename"].ToString(); types.Add(type); } } } } return(types); }
public UserDataTypes GenerateDiferences(UserDataTypes CamposOrigen, UserDataTypes CamposDestino) { foreach (UserDataType node in CamposDestino) { if (!CamposOrigen.Find(node.FullName)) { node.Status = StatusEnum.ObjectStatusType.CreateStatus; CamposOrigen.Add(node); } } foreach (UserDataType node in CamposOrigen) { if (!CamposDestino.Find(node.FullName)) { node.Status = StatusEnum.ObjectStatusType.DropStatus; } } return(CamposOrigen); }
private string GetPath(UserDataTypes type) { return(directoryPath + "\\" + userId + "_" + Enum.GetName(typeof(UserDataTypes), type) + "_" + System.DateTime.Now.ToString("MM.dd.yyyy") + ".txt"); }