/// <summary> /// 生成数据集 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void ADDBISETLIST(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { int ID = Int32.Parse(P1); DBFactory db = new BI_DB_SourceB().GetDB(ID); string strTableName = P2; string strDataSetName = context.Request("DsetName") ?? "1"; BI_DB_Set DS = new BI_DB_Set(); DS.Name = strDataSetName; DS.SID = ID; DS.SName = strTableName; DS.CRDate = DateTime.Now; DS.CRUser = UserInfo.User.UserName; DS.Type = "SQL"; DS.DSQL = "SELECT * FROM " + strTableName; new BI_DB_SetB().Insert(DS); DataTable dt = db.GetDBClient().SqlQueryable <Object>(CommonHelp.Filter("SELECT * FROM " + strTableName)).ToDataTablePage(1, 1); List <BI_DB_Dim> ListDIM = new BI_DB_SetB().getCType(dt); ListDIM.ForEach(D => D.STID = DS.ID); ListDIM.ForEach(D => D.CRDate = DateTime.Now); ListDIM.ForEach(D => D.CRUser = UserInfo.User.UserName); new BI_DB_DimB().Insert(ListDIM); }
public void GETSQLDATA(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { DataTable dt = new DataTable(); string SQL = CommonHelp.Filter(P1); dt = new Yan_WF_PDB().GetDTByCommand(SQL); msg.Result = dt; }
/// <summary> /// 根据表解析数据字段 /// </summary> /// <param name="context"></param> /// <param name="msg"></param> /// <param name="P1"></param> /// <param name="P2"></param> /// <param name="UserInfo"></param> public void GETFIELDDATA(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { DBFactory db = new BI_DB_SourceB().GetDB(0); DataTable dt = db.GetDBClient().SqlQueryable <Object>(CommonHelp.Filter("SELECT * FROM " + P1)).ToDataTablePage(1, 1); List <BI_DB_Dim> ListDIM = new BI_DB_SetB().getCType(dt); msg.Result = ListDIM; }
public void GETSQLDATA(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { string SQL = CommonHelp.Filter(P1); DBFactory db = new BI_DB_SourceB().GetDB(0); //var dt = new Dictionary<string, object>(); //dt.Add("ID", "6988"); //dt.Add("Remark1", "123"); //dt.Add("Remark2", "asdasd"); //db.UpdateData(dt, "JH_Auth_ZiDian"); DataTable dt = db.GetSQL(SQL); msg.Result = dt; }
public void JXSQL(JObject context, Msg_Result msg, string P1, string P2, JH_Auth_UserB.UserInfo UserInfo) { try { int ID = int.Parse(P1); BI_DB_Set DS = new BI_DB_SetB().GetEntity(d => d.ID == ID); DBFactory db = new BI_DB_SourceB().GetDB(DS.SID.Value); DataTable dt = new DataTable(); dt = db.GetSQL(CommonHelp.Filter(P2)); List <BI_DB_Dim> ListDIM = new BI_DB_SetB().getCType(dt); ListDIM.ForEach(D => D.STID = ID); msg.Result = ListDIM.Where(D => D.Dimension == "1"); msg.Result1 = ListDIM.Where(D => D.Dimension == "2"); } catch (Exception ex) { msg.ErrorMsg = ex.Message; } }