Oracle gets notes for tables and columns

Source: Internet
Author: User
Tags httpcontext serialization

Using System;
Using System.Collections.Generic;
Using System.Data;
Using System.Linq;
Using System.Runtime.Serialization.Json;
Using System.Text.RegularExpressions;
Using System.Web;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using Common;
Using DevExpress.Utils.Text.Internal;
Using DevExpress.Web.ASPxTabControl;
Using Framework;
Using Npoi. Ss. Formula.functions;
Using Webapp.common;
Using Contract.domain;
Using System.Collections;
Using Match = System.Text.RegularExpressions.Match;
Using System.Runtime.Serialization;

Namespace Hraweb
{
[DataContract (Namespace = "Contract.domain")]
public class Usertabcolumn
{
[DataMember]
Public virtual string ColumnName {get; set;}
[DataMember]
Public virtual string DataType {get; set;}

[DataMember]
Public virtual string Comments {get; set;}
}
public partial class Basinstdefaultvalueconfigmanage:entitydetail<basinstdefaultvalue>
{

Initial page Control
protected override void Initpage (string id)
{

Bindentitydrop (Txt_tablename_, "All_tables", false);
Base. Initpage (ID);
}
protected void Bindentitydrop ()
{

Txt_instrumenttypeid_. DataTextField = "Instrumenttypename";
Txt_instrumenttypeid_. DataValueField = "Id";
Txt_instrumenttypeid_. DataSource =
Holworth.utility.utility.listtot<basinstrumenttype> (Dao.findlist (New QueryInfo ("BasInstrumentType")))
// . ToList ();
Txt_instrumenttypeid_. DataBind ();

}

protected override Basinstdefaultvalue LoadData (string id)
{
var obj = base. LoadData (ID);
return obj;
}

protected override void Page_Load (object sender, EventArgs e)
{

if (request["_method"] = = "Table2drop")
{
String tableName = request["EntityType"]?? "";
if (!string. IsNullOrEmpty (TableName))
Table2drop (TableName);
}
else if (request["_method"] = = "GetTable")
{
GetTable ();

}
else if (request["_method"] = = "Getmodel")
{
Getmodel ();
}

Base.svc = Psvc;
Base. Page_Load (sender, E);
}

public void Getmodel ()
{
String tname = request["_tname"]?? "";
if (!string. IsNullOrEmpty (Tname))
{
QueryInfo info=new queryinfo ("Basinstdefaultvalue");
}
}

public void GetTable ()
{
String tname = request["Tname"];
QueryInfo coltypeinfo = new QueryInfo ();
Coltypeinfo.customsql = string. Format (@ "Select A.column_name column_name,a.data_type data_type,b.comments comments from User_tab_columns a INNER join User_col_comments B on A.table_name=b.table_name
and Lower (a.column_name) not in (
' sequence ',
' is_deleted ',
' py ',
' Create_uid ',
' Create_uname ',
' create_oid ',
' Create_pid ',
' Create_date ',
' Last_mod_uid ',
' Last_mod_uname ',
' last_mod_oid ',
' Last_mod_pid ',
' Last_mod_datetime ')
and A.column_name=b.column_name where A.table_name=upper (Trim (' {0} ')) ", Tname. ToUpper ());
list<usertabcolumn> columndic = Dao.excutedataset (coltypeinfo). Tables[0]. Tolist<usertabcolumn> ();
var s = Newtonsoft.Json.JsonConvert.SerializeObject (columndic);
HttpContext.Current.Response.Write (s);
HttpContext.Current.Response.End ();

}

public void Table2drop (string tableName)
{
QueryInfo tabinfo = new QueryInfo ();
tabinfo.customsql = @ "Select A.table_name table_name,b.comments COMMENTS
From User_tables a,user_tab_comments b
WHERE A.table_name=b.table_name
";
//
var keyword = request["keyword"]?? String. Empty;
if (!string. IsNullOrEmpty (keyword))
{

Tabinfo.customsql + = string. Format ("and b.{0} like '%{1}% '", "COMMENTS", keyword);

}
tabinfo.pagesize = Int. Parse (httpcontext.current.request["Rows"]);
int pageIndex = Int. Parse (httpcontext.current.request["page"]);
Tabinfo.startrecord = (pageIndex-1) * tabinfo.pagesize;
Tabinfo.totalcount = 1;
//
DataTable dt = Dao.excutedataset (tabinfo). Tables[0];
var s = Newtonsoft.Json.JsonConvert.SerializeObject (DT);
HttpContext.Current.Response.Write (s);
HttpContext.Current.Response.End ();

}

Protected Hashtable SetInfo ()
{
Hashtable AA = new Hashtable ();
Aa. Clear ();
foreach (string key in Request.Params.Keys)
{
if (Regex.IsMatch (key))
{
Match m = Regex.match (key);
String g = m.groups["TAG"]. Value;
if (string. IsNullOrEmpty (Request.params[key]))
{
Continue
}
if (string. IsNullOrEmpty (g))
{
if (!AA. Contains (m.groups["PROP"). Value))
{
Aa. ADD (m.groups["PROP"]. Value, Request.params[key]);
}
}
Else
{
if (!AA. Contains (m.groups["PROP"). Value + "_" + g))
{
Aa. ADD (m.groups["PROP"]. Value + "_" + G, request.params[key]);
}

}
}
}
return AA;
}
private static string regexctlvalobj = @ "\w{3,5}?_ (? <prop>\w*) _ (?<tag> (\w\d{1,2}) *) $";
public static System.Text.RegularExpressions.Regex regex = new Regex (regexctlvalobj, regexoptions.ignorecase);

Private Contract.IService.IRskValuationModelConfigService psvc;
<summary>
Initialization
</summary>
Contract.IService.IRskValuationModelConfigService Psvc
{
Get
{
if (psvc = = null)
{
Psvc = ctx. GetObject ("Rskvaluationmodelconfigservice") as Contract.IService.IRskValuationModelConfigService;
}
return psvc;

}
}

}
}

Oracle gets notes for tables and columns

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.