public static void DeleteField(string CompanyID, string ID, string FieldName, string TableType) { DataHelper.ExecuteQuerys("ALTER TABLE " + CompanyDAL.GetTableName(CompanyID, TableType) + " Drop column " + FieldName); FieldDAL.DeleteField(ID); string where = "CompanyID='{0}' and TableType ='{1}'"; DataSet ds = FieldDAL.GetFieldList(string.Format(where, CompanyID, TableType)); HttpContext.Current.Cache[Tools.GetCashName(CompanyID, TableType)] = ds; }
public static void InsertField(string FieldName, string FName, string CompanyID, string TableType, string FieldType, string FieldLength, string Misk, string IsDispaly) { if (FieldLength.Trim() == "") { FieldLength = "300"; } FieldDAL.InsertField(FieldName, FName, CompanyID, TableType, FieldType, FieldLength, Misk, IsDispaly); string tableName = CompanyDAL.GetTableName(CompanyID, TableType); DataHelper.ExecuteQuerys("ALTER TABLE " + tableName + " ADD " + FieldName + " NVARCHAR(" + FieldLength + ") NULL"); string where = "CompanyID='{0}' and TableType ='{1}'"; DataSet ds = FieldDAL.GetFieldList(string.Format(where, CompanyID, TableType)); HttpContext.Current.Cache[Tools.GetCashName(CompanyID, TableType)] = ds; }
public static DataSet GetCacheFields(string CompanyID, string tableType) { if (HttpContext.Current.Cache[Tools.GetCashName(CompanyID, tableType)] == null) { string where = "CompanyID='{0}' and TableType ='{1}'"; DataSet ds = FieldDAL.GetFieldList(string.Format(where, CompanyID, tableType)); if (ds.Tables[0].Rows.Count == 0) { return(null); } HttpContext.Current.Cache[Tools.GetCashName(CompanyID, tableType)] = ds; return(ds); } return(HttpContext.Current.Cache[Tools.GetCashName(CompanyID, tableType)] as DataSet); }
public static string InsertByDataSet(DataSet ds, string CompanyID, string tableType) { string message = FieldDAL.InsertByDataSet(ds, CompanyID, tableType); if (message == "") { string where = "CompanyID='{0}' and TableType ='{1}'"; where = string.Format(where, CompanyID, tableType); HttpContext.Current.Cache.Insert(Tools.GetCashName(CompanyID, tableType), FieldDAL.GetFieldList(where)); } return(message); }
public static DataSet GetFieldList() { return(FieldDAL.GetFieldList()); }
public static DataSet GetFieldByID(string id) { return(FieldDAL.GetFieldList("ID=" + id)); }