public string save_begin_log(string file_name) { DataTable dt_key = new DataTable(); dt_key = Fun.getDtBySql("select s_a30803.nextval as c from dual "); string line_no = dt_key.Rows[0][0].ToString(); log_key = line_no; string sql = "Insert into a30803(a308_id,line_no,sort_by,file_name,IF_ERROR,enter_user,enter_date,d001_id,d001_name,state)"; sql += "Select '" + import_key + "'," + line_no + "," + line_no + ",'" + file_name + "','0','Timer',sysdate,'" + d001_id + "','" + d001_name + "','0' from dual "; Fun.execSqlOnly(sql); return(line_no); }
public string doA309(string sqlxml, string key_, string a002_key__, string reason_) { string sql_ = "select s_a309.nextval as c from dual "; DataTable dt_id = new DataTable(); dt_id = Fun.getDtBySql(sql_); string a309_id = dt_id.Rows[0][0].ToString(); //判断有没有生效的变更 dt_id.Dispose(); sql_ = "insert into A309(a309_id,A309_NAME,KEY_ID,REASON,DESCRIPTION,ENTER_USER,ENTER_DATE,STATUS,A002_ID,EXEC_SQL)"; sql_ += " Values (" + a309_id + ",'" + a002_key__ + "-变更','" + key_ + "','" + reason_.Replace("'", "''") + "',null,'" + GlobeAtt.A007_KEY + "',sysdate,'0','" + a002_key__ + "','" + sqlxml.Replace("'", "''") + "')"; try { int li_db = Fun.execSqlOnly(sql_); if (li_db < 0) { return("00" + getMsg("M0017")); } } catch (Exception ex) { return("00" + ex.Message); } return("01"); }
protected void Page_Load(object sender, EventArgs e) { try { string sql_a022 = "Select t.* from a022 t where t.a022_id='FROM_EMAIL_TIMES'"; DataTable dt_a022_ = new DataTable(); db.ExcuteDataTable(dt_a022_, sql_a022, CommandType.Text); FROM_EMAIL_TIMES = dt_a022_.Rows[0]["a022_name"].ToString(); string sql_main = "Select t.* from A306_EMAIL t where STATUS='0' and email_state='0' and email is not null order by t.enter_date "; db.ExcuteDataTable(dt_main, sql_main, CommandType.Text); http.CharacterSet = "UTF-8"; string msg_ = ""; for (int i = 0; i < dt_main.Rows.Count; i++) { //登录信息 string ls_send = "-1"; string toemail = dt_main.Rows[i]["EMAIL"].ToString(); if (toemail.IndexOf("@") > 0) { string main_name = dt_main.Rows[i]["DESCRIPTION"].ToString(); string title = dt_main.Rows[i]["tittle"].ToString(); string A306_ID = dt_main.Rows[i]["A306_ID"].ToString(); string a306_name = dt_main.Rows[i]["A306_NAME"].ToString(); string showhtmlurl = GlobeAtt.HTTP_URL + "/linkHtml.aspx?a306id=" + A306_ID; string send_email = dt_main.Rows[i]["send_email"].ToString(); string SEND_A007_NAME = dt_main.Rows[i]["SEND_A007_NAME"].ToString(); string Smtp_Userid = dt_main.Rows[i]["Smtp_Userid"].ToString(); string Smtp_Password = dt_main.Rows[i]["Smtp_Password"].ToString(); string Smtp_Server = dt_main.Rows[i]["Smtp_Server"].ToString(); string Smtp_Server_Portid = dt_main.Rows[i]["Smtp_Server_Portid"].ToString(); string html_ = ""; if (a306_name.IndexOf("OUT_EMAIL") == 0) { //获取包的内容 html_ = main_name; main_name = title; } else { http.OpenRequest(showhtmlurl, showhtmlurl); html_ = http.HtmlDocument; } main_name = main_name.Replace("\r", "</BR>"); main_name = main_name.Replace("\n", "</BR>"); if (a306_name.IndexOf("A30305_ID=") == 0) { if (html_.IndexOf("<NOSENDEMAIL>1</NOSENDEMAIL>") <= 0) { //ls_send = SendSMTPEMail(Smtp_Server, Smtp_Server_Portid, // Smtp_Userid, Smtp_Password, // toemail, // title, // html_, send_email, SEND_A007_NAME); ls_send = sendMail("stmp.sina.com", 25, "*****@*****.**", "Cathorlin", "lp901129", "no tittle", "hello this is smtp service", "*****@*****.**", false); } else { ls_send = "不需要发邮件"; } } else { ls_send = sendMail("stmp.sina.com", 25, "*****@*****.**", "Cathorlin", "lp901129", "no tittle", "hello this is smtp service", "*****@*****.**", false); //ls_send = SendSMTPEMail(Smtp_Server,Smtp_Server_Portid, Smtp_Userid, Smtp_Password, toemail, title, html_, send_email, SEND_A007_NAME); } string sql = "begin pkg_msg.send_mail_end('" + A306_ID + "','" + ls_send.Replace("'", "''") + "'); end;"; fun.execSqlOnly(sql); if (send_email == "" || send_email == null) { send_email = Smtp_Userid; } msg_ += DateTime.Now.ToString() + " " + send_email + " " + A306_ID + ":" + main_name + Environment.NewLine; System.Threading.Thread.Sleep(1000); } } this.TextBox1.Text = msg_; deleteExportTempFile(); } catch (Exception ex) { Response.Write(ex.Message); } }
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("'", "\"")); } }