Esempio n. 1
0
 public BasePage()
 {
     //
     // TODO: 在此处添加构造函数逻辑
     //
     http_url = Fun.GetIndexUrl();
 }
Esempio n. 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         table_id = Request.QueryString["table_id"] == null ? "" : Request.QueryString["table_id"].ToString();
         key_id   = Request.QueryString["key_id"] == null ? "" : Request.QueryString["key_id"].ToString();
         line_no  = Request.QueryString["line_no"] == null ? "" : Request.QueryString["line_no"].ToString();
         basekey  = Request.QueryString["basekey"] == null ? "" : Request.QueryString["basekey"].ToString();
         basekey  = basekey.Replace("-", "+");
         key_id   = key_id.Replace("-", "+");
         key_id   = key_id.Replace("'", "''");
         string sql = "Select t.* from A10001 t where t.table_id='" + table_id + "' and  line_no='" + line_no + "'";
         dt_a10001 = fun.getDtBySql(sql);
         a308_id   = dt_a10001.Rows[0]["col_mask"].ToString();
         dt_a308   = fun.getDtBySql("Select t.* from A308 t where t.a308_id='" + a308_id + "'");
         FILE_TYPE = dt_a308.Rows[0]["FILE_TYPE"].ToString().ToUpper();
         // FILE_TYPE = FILE_TYPE.Substring(0, 3);
         if (FILE_TYPE != "*")
         {
             string model_file_name_ = HttpContext.Current.Request.MapPath("../data/" + a308_id + "." + FILE_TYPE);
             if (System.IO.File.Exists(model_file_name_))
             {
                 model_file_name = fun.GetIndexUrl() + "\\data\\" + a308_id + "." + FILE_TYPE;
             }
             else
             {
                 model_file_name = "";
             }
         }
         else
         {
             model_file_name = "";
         }
         dt_a30801      = fun.getDtBySql("Select t.* from A30801 t where t.a308_id='" + a308_id + "'");
         dt_a30802      = fun.getDtBySql("Select t.* from A30802 t where t.a308_id='" + a308_id + "'");
         uploadfilepath = "..\\data\\import\\" + a308_id + "\\upload";
         sql            = "Select count(*) from a30803 t where a308_id='" + a308_id + "' and t.BASE_TABLE_ID='" + table_id + "' and BASE_COLUMN_ID='" + dt_a10001.Rows[0]["COLUMN_ID"].ToString() + "' and  BASE_KEY='" + basekey + "'";
         DataTable dt_count = new DataTable();
         dt_count = fun.getDtBySql(sql);
         if (dt_count.Rows[0][0].ToString() == "0")
         {
             DataTable dt_key = new DataTable();
             dt_key     = fun.getDtBySql("select s_a30803.nextval as c from dual ");
             a30803_key = dt_key.Rows[0][0].ToString();
             sql        = "insert into a30803(a308_id,line_no,d001_id,d001_name,BASE_TABLE_ID,BASE_COLUMN_ID,BASE_KEY,BASE_USER,BASE_DATE,state)";
             sql       += "Select '" + a308_id + "'," + a30803_key + ",'" + key_id + "','','" + table_id + "','" + dt_a10001.Rows[0]["COLUMN_ID"].ToString() + "','" + basekey + "','" + GlobeAtt.A007_KEY + "',sysdate,'-1' from dual ";
             //    Response.Write(sql);
             fun.execSqlOnly(sql);
         }
         else
         {
             DataTable dt_key = new DataTable();
             sql = "select line_no as c from a30803 t  where a308_id='" + a308_id + "' and t.BASE_TABLE_ID='" + table_id + "' and BASE_COLUMN_ID='" + dt_a10001.Rows[0]["COLUMN_ID"].ToString() + "' and  BASE_KEY='" + basekey + "'";
             // Response.Write(sql);
             dt_key     = fun.getDtBySql(sql);
             a30803_key = dt_key.Rows[0][0].ToString();
         }
     }
     catch (Exception ex)
     {
         Response.Write(ex.Message.Replace("\n", ";").Replace("'", "\""));
     }
 }