public int delete(Data_Type data_Type) { db.Connection.Open(); int result = db.Connection.Execute(StoreProcedureNames.Data_Type.Delete, new { Id = data_Type.Id }, commandType: CommandType.StoredProcedure); db.Connection.Close(); return(result); }
public TypeDef(Data_Type data) { if (data != null) { Id = data.Id; Name = data.Name; } }
private void radbn_fileData_CheckedChanged(object sender, EventArgs e) { chBx_MultiSelect.Enabled = true; bn_BrousePath.Enabled = true; chkbx_CopyFile.Enabled = true; rtb_input.Text = defaultInputTxtForFile; dataTypeForEncrypt = Data_Type.FILE; }
public int update(Data_Type data_Type) { db.Connection.Open(); int result = db.Connection.Execute(StoreProcedureNames.Data_Type.Update, new { Id = data_Type.Id, Name = data_Type.Name, Description = data_Type.Description }, commandType: CommandType.StoredProcedure); db.Connection.Close(); return(result); }
private void radbn_txtData_CheckedChanged(object sender, EventArgs e) { chBx_MultiSelect.Enabled = false; bn_BrousePath.Enabled = false; chkbx_CopyFile.Enabled = false; rtb_input.Text = defaultInputTxtForTxt; dataTypeForEncrypt = Data_Type.TEXT; }
public ActionResult <object> Update(Data_Type data_Type) { AppDB db = provider.GetRequiredService <AppDB>(); Data_TypeDA data_TypeDA = new Data_TypeDA(db); var res = data_TypeDA.update(data_Type); return(new { result = res }); }
public DataBuffer(int initialSize, Data_Type dt) { if (initialSize == 0) { _buf = null; } else { _buf = new byte[initialSize]; } _numItems = 0; _datatype = dt; }
NUM Decide_NUM(Data_Type data_Type) { switch (data_Type) { case Data_Type.Byte: return(NUM.Integer); case Data_Type.Short: return(NUM.Integer); case Data_Type.Int: return(NUM.Integer); case Data_Type.Unsigned_Short: return(NUM.Integer); case Data_Type.SP_Float: return(NUM.Decimal); } return(NUM.Integer); }
private static IEnumerable <Data_Type> Load_ITDX_Data_Types_From_xsd(string itdxString) { List <Data_Type> data_Types = new List <Data_Type>(); XDocument schema = XDocument.Parse(itdxString); XNamespace xs = schema.Root.Name.Namespace; var dt = schema.Root.Descendants(xs + "simpleType").Where(s => s.FirstAttribute != null); foreach (var table in dt) { Data_Type dtype = new Data_Type(); dtype.Name = table.FirstAttribute.Value; if (table.Descendants(xs + "documentation") != null) { var docCount = table.Descendants(xs + "documentation").Count(); if (docCount > 0) { dtype.Description = table.Descendants(xs + "documentation").FirstOrDefault().Value; } } var values = schema .Root .Descendants(xs + "simpleType") .Where(t => (string)t.Attribute("name") == table.FirstAttribute.Value) .Descendants(xs + "enumeration"); dtype.Data_Type_Record_List = new List <Data_Type_Records>(); foreach (var i in values) { var rec = new Data_Type_Records { Code = i.FirstAttribute.Value, Description = i.Value }; dtype.Data_Type_Record_List.Add(rec); } data_Types.Add(dtype); } return(data_Types); }
public string GetFieldAttribute() { if (IsPrimaryKey()) { return("[PrimaryKey(\"" + Column_Name + "\", Access = PropertyAccess.NosetterLowercaseUnderscore)]"); } else if (IsForeignKey()) { return("[BelongsTo(\"" + Column_Name + "\", Type = typeof(" + GetPropertyName() + "), Access = PropertyAccess.NosetterCamelcaseUnderscore)]"); } else { //FUTURE: if column name is reserved, add a back-tick, like "`User`" string prop = "[Property(\"" + Column_Name + "\", Access = PropertyAccess.NosetterCamelcaseUnderscore"; if (!Is_Nullable) { prop = prop + ", NotNull = true"; } if ( (Data_Type.Equals("text")) || (Data_Type.Equals("ntext")) ) { prop += ", ColumnType = \"StringClob\")]"; } else if (GetNetType().Equals("string") && Character_Maximum_Length > 1) { prop += ", Length = " + Character_Maximum_Length.ToString() + ")"; if (EnableValidationAttributes) { prop += ", ValidateLength(1, " + Character_Maximum_Length.ToString() + ")]"; } else { prop += "]"; } } else { prop += ")]"; } return(prop); } }
public void Print(string s) { if (datas == null || b_datas == null || f_datas == null) { Debug.Log("datas == null || b_datas == null || f_datas == null"); return; } string d_string = ""; Data_Type[] data_Types = new Data_Type[0]; if (C2M_command != C2M_Command.Unsigned) { data_Types = Get_C2M_Packet_Slices_Sizes(); } if (M2C_command != M2C_Command.Unsigned) { data_Types = Get_M2C_Packet_Slices_Sizes(); } int d_pointer = 0; int f_d_pointer = 0; foreach (Data_Type data_Type in data_Types) { if (d_pointer + f_d_pointer > 0) { d_string += ","; } if (Decide_NUM(data_Type) == NUM.Integer) { d_string += datas [d_pointer++].ToString(); } else { d_string += f_datas [f_d_pointer++].ToString(); } } string b_d_string = ""; foreach (byte b_d in b_datas) { b_d_string += String.Format("{0:X2}", b_d) + " "; } Debug.Log(s + "\nversion: " + version.ToString() + "\nC2M: " + C2M_command + "\nM2C: " + M2C_command + "\ndatas: " + d_string + "\nb_datas: " + b_d_string); }
public string GetSqlType() { if ((Data_Type.Equals("bigint")) || (Data_Type.Equals("int")) || (Data_Type.Equals("smallint")) || (Data_Type.Equals("tinyint")) || (Data_Type.Equals("bit")) || (Data_Type.Equals("datetime")) || (Data_Type.Equals("smalldatetime")) || (Data_Type.Equals("money")) || (Data_Type.Equals("smallmoney")) || (Data_Type.Equals("float")) || (Data_Type.Equals("real")) || (Data_Type.Equals("ntext")) || (Data_Type.Equals("text")) || (Data_Type.Equals("image")) || (Data_Type.Equals("uniqueidentifier")) ) { return(Data_Type); } if ((Data_Type.Equals("char")) || (Data_Type.Equals("varchar")) || (Data_Type.Equals("nchar")) || (Data_Type.Equals("nvarchar")) || (Data_Type.Equals("binary")) || (Data_Type.Equals("varbinary")) ) { return(String.Format("{0}({1})", Data_Type, Character_Maximum_Length)); } if ((Data_Type.Equals("decimal")) || (Data_Type.Equals("numeric")) ) { return(String.Format("{0}({1},{2})", Data_Type, Numeric_Scale, Numeric_Precision)); } throw new Exception("Unexpected data type: " + Data_Type); }
public bool IsValid() { return(!Parameter_Name.IsNullOrEmpty() && Ordinal_Position > 0 && !Data_Type.IsNullOrEmpty()); }