Line 1: using System;
Line 2: using System.Collections.Generic;
Line 3: using System.Data;
Line 4: using System.Data.SqlClient;
Line 5: using System.Web;
Line 6: using iek.core;
Line 7: using System.Text;
Line 8: using System.Xml;
Line 9: using System.Web.UI;
Line 10: using System.Web.UI.WebControls;
Line 11: using System.Globalization;
Line 12: using System.Linq;
Line 13: using Aspose.Foundation.UriResolver.RequestResponses;
Line 14:
Line 15:
Line 16: ///
Line 17: /// DbApplyDAO 的摘要描述
Line 18: ///
Line 19: public class DbApplyDAO
Line 20: {
Line 21: public DbApplyDAO() { }
Line 22:
Line 23: #region 新增資料申請E化服務訊息
Line 24: public static bool AddDbApplyInfo(string apply_id, string apply_name, string apply_type, string apply_ispersonnal, string apply_date, string apply_Purpose, string apply_mbrid, string apply_email,string apply_subtype,string apply_writepoint,string apply_isfree,string apply_startym,string apply_endym,string apply_compidno,string worktype)
Line 25: {
Line 26: bool exec = false;
Line 27: if (apply_compidno != "" && apply_type == "") { apply_type = "會員"; }
Line 28:
Line 29: try
Line 30: {
Line 31: using (SqlConnection conn = DataSourceName.GetSqlConnIEK())
Line 32: {
Line 33: //sql command
Line 34: SqlCommand sqlCmd = new SqlCommand();
Line 35: sqlCmd.Connection = conn;
Line 36: sqlCmd.CommandType = CommandType.Text;
Line 37:
Line 38: string sql = @"
Line 39: begin transaction
Line 40: INSERT INTO Db_INQUIRY1(apply_id,apply_name,apply_type,apply_ispersonnal,apply_date,apply_isagree,apply_Purpose,apply_mbrid,apply_email,apply_createdate,apply_suggestion,apply_subtype,apply_writepoint,apply_isfree,apply_startym,apply_endym,apply_compidno)
Line 41: VALUES (@apply_id,@apply_name,@apply_type,@apply_ispersonnal, @apply_date,@apply_isagree, @apply_Purpose,@apply_mbrid,@apply_email,getdate(),@workType,@apply_subtype,@apply_writepoint,@apply_isfree,@apply_startym,@apply_endym,@apply_compidno)
Line 42:
Line 43: commit transaction
Line 44: ";
Line 45:
Line 46: sqlCmd.CommandText = sql;
Line 47: sqlCmd.Parameters.Add("@apply_id", SqlDbType.VarChar).Value = apply_id;
Line 48: sqlCmd.Parameters.Add("@apply_name", SqlDbType.VarChar).Value = apply_name;
Line 49: sqlCmd.Parameters.Add("@apply_type", SqlDbType.VarChar).Value = apply_type;
Line 50: sqlCmd.Parameters.Add("@apply_subtype", SqlDbType.VarChar).Value = apply_subtype; //新增出版次選項
Line 51: sqlCmd.Parameters.Add("@apply_writepoint", SqlDbType.VarChar).Value = apply_writepoint; //新增資訊類別
Line 52: sqlCmd.Parameters.Add("@apply_isfree", SqlDbType.VarChar).Value = apply_isfree; //新增是否免費
Line 53: sqlCmd.Parameters.Add("@apply_startym", SqlDbType.VarChar).Value = apply_startym; //新增起始年月
Line 54: sqlCmd.Parameters.Add("@apply_endym", SqlDbType.VarChar).Value = apply_endym; //新增結束年月
Line 55: sqlCmd.Parameters.Add("@apply_compidno", SqlDbType.VarChar).Value = apply_compidno; //新增團體代碼
Line 56:
Line 57: sqlCmd.Parameters.Add("@apply_ispersonnal", SqlDbType.VarChar).Value = apply_ispersonnal;
Line 58: sqlCmd.Parameters.Add("@apply_date", SqlDbType.NVarChar).Value = apply_date;
Line 59: sqlCmd.Parameters.Add("@workType", SqlDbType.VarChar).Value = worktype; //新增工作類別
Line 60:
Line 61: sqlCmd.Parameters.Add("@apply_isagree", SqlDbType.NVarChar).Value = "-1"; // -1表新申請;0表不同意;1表同意
Line 62: sqlCmd.Parameters.Add("@apply_Purpose", SqlDbType.NVarChar).Value = apply_Purpose;
Line 63: sqlCmd.Parameters.Add("@apply_mbrid", SqlDbType.VarChar).Value = apply_mbrid;
Line 64: sqlCmd.Parameters.Add("@apply_email", SqlDbType.VarChar).Value = apply_email;
Line 65:
Line 66: //open connection
Line 67: conn.Open();
Line 68: //execute
Line 69: if (sqlCmd.ExecuteNonQuery() > 0)
Line 70: {
Line 71:
Line 72: exec = true;
Line 73:
Line 74: }
Line 75:
Line 76: //close onnection
Line 77: conn.Close();
Line 78: }
Line 79:
Line 80: }
Line 81: catch (Exception ex)
Line 82: {
Line 83: throw new Exception("SQL Exception in [AddDbApplyInfo]" + ex.Message);
Line 84: }
Line 85: return exec;
Line 86: }
Line 87: #endregion
Line 88:
Line 89: public static void SetDbApplyInfo(string apply_id, string apply_isagree)
Line 90: {
Line 91: // HttpContext.Current.Response.Write(apply_suggestion);
Line 92: try
Line 93: {
Line 94: using (SqlConnection conn = DataSourceName.GetSqlConnIEK())
Line 95: {
Line 96: //sql command
Line 97: SqlCommand sqlCmd = new SqlCommand();
Line 98: sqlCmd.Connection = conn;
Line 99: sqlCmd.CommandType = CommandType.Text;
Line 100:
Line 101: string sql = @"
Line 102: UPDATE Db_INQUIRY1 SET apply_isagree = @apply_isagree,
Line 103: apply_modifydate = getdate()
Line 104: WHERE apply_id = @apply_id";
Line 105:
Line 106: sqlCmd.CommandText = sql;
Line 107: sqlCmd.Parameters.Add("@apply_id", SqlDbType.VarChar).Value = apply_id;
Line 108: sqlCmd.Parameters.Add("@apply_isagree", SqlDbType.VarChar).Value = apply_isagree;
Line 109: // sqlCmd.Parameters.Add("@apply_suggestion", SqlDbType.VarChar).Value = apply_suggestion;
Line 110:
Line 111: //open connection
Line 112: conn.Open();
Line 113: sqlCmd.ExecuteNonQuery();
Line 114: //close onnection
Line 115: conn.Close();
Line 116: }
Line 117: }
Line 118: catch (Exception ex)
Line 119: {
Line 120: throw new Exception("SQL Exception in [SetDbApplyInfo]" + ex.Message);
Line 121: }
Line 122: }
Line 123: public static void Updatestatus(string apply_id, string apply_status)
Line 124: {
Line 125: // HttpContext.Current.Response.Write(apply_suggestion);
Line 126: try
Line 127: {
Line 128: using (SqlConnection conn = DataSourceName.GetSqlConnIEK())
Line 129: {
Line 130: //sql command
Line 131: SqlCommand sqlCmd = new SqlCommand();
Line 132: sqlCmd.Connection = conn;
Line 133: sqlCmd.CommandType = CommandType.Text;
Line 134:
Line 135: string sql = @"
Line 136: UPDATE Db_INQUIRY1 SET apply_status = @apply_status
Line 137: WHERE apply_id = @apply_id";
Line 138:
Line 139: sqlCmd.CommandText = sql;
Line 140: sqlCmd.Parameters.Add("@apply_id", SqlDbType.VarChar).Value = apply_id;
Line 141: sqlCmd.Parameters.Add("@apply_status", SqlDbType.VarChar).Value = apply_status;
Line 142: // sqlCmd.Parameters.Add("@apply_suggestion", SqlDbType.VarChar).Value = apply_suggestion;
Line 143:
Line 144: //open connection
Line 145: conn.Open();
Line 146: sqlCmd.ExecuteNonQuery();
Line 147: //close onnection
Line 148: conn.Close();
Line 149: }
Line 150: }
Line 151: catch (Exception ex)
Line 152: {
Line 153: throw new Exception("SQL Exception in [Updatestatus]" + ex.Message);
Line 154: }
Line 155: }
Line 156:
Line 157: public static DataTable GetDbApplyInfoById(string apply_id)
Line 158: {
Line 159: using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["DSN_IEK"]))
Line 160: {
Line 161: string sql = "SELECT * FROM Db_INQUIRY1 WHERE apply_id = @apply_id";
Line 162: using (SqlCommand cmd = new SqlCommand(sql, conn))
Line 163: {
Line 164: cmd.Parameters.AddWithValue("@apply_id", apply_id);
Line 165: using (SqlDataAdapter da = new SqlDataAdapter(cmd))
Line 166: {
Line 167: DataTable dt = new DataTable("applyInfo");
Line 168: da.Fill(dt);
Line 169: return dt;
Line 170: }
Line 171: }
Line 172: }
Line 173: }
Line 174:
Line 175:
Line 176: public static bool UpdateDbApplyInfo(
Line 177: string apply_id,
Line 178: string apply_name,
Line 179: string dataType,
Line 180: string isPersonnal,
Line 181: string apply_date,
Line 182: string suggestion,
Line 183: string mbr_username,
Line 184: string mbr_email,
Line 185: string subdataType,
Line 186: string writepoint,
Line 187: string isfree,
Line 188: string startym,
Line 189: string endym,
Line 190: string compidno
Line 191: )
Line 192: {
Line 193: try
Line 194: {
Line 195: using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["DSN_IEK"]))
Line 196: {
Line 197: string sql = @"
Line 198: UPDATE Db_INQUIRY1 SET
Line 199: apply_name = @apply_name,
Line 200: apply_type = @dataType,
Line 201: apply_ispersonnal = @isPersonnal,
Line 202: apply_date = @apply_date,
Line 203: apply_Purpose = @suggestion,
Line 204: apply_mbrid = @mbr_username,
Line 205: apply_email = @mbr_email,
Line 206: apply_subtype = @subdataType,
Line 207: apply_writepoint = @writepoint,
Line 208: apply_isfree = @isfree,
Line 209: apply_startym = @startym,
Line 210: apply_endym = @endym,
Line 211: apply_compidno = @compidno,
Line 212: apply_modifydate = GETDATE()
Line 213: WHERE apply_id = @apply_id
Line 214: ";
Line 215:
Line 216: using (SqlCommand cmd = new SqlCommand(sql, conn))
Line 217: {
Line 218: cmd.Parameters.AddWithValue("@apply_id", apply_id);
Line 219: cmd.Parameters.AddWithValue("@apply_name", apply_name ?? (object)DBNull.Value);
Line 220: cmd.Parameters.AddWithValue("@dataType", dataType ?? (object)DBNull.Value);
Line 221: cmd.Parameters.AddWithValue("@isPersonnal", isPersonnal ?? (object)DBNull.Value);
Line 222: cmd.Parameters.AddWithValue("@apply_date", string.IsNullOrEmpty(apply_date) ? (object)DBNull.Value : (object)DateTime.Parse(apply_date));
Line 223: cmd.Parameters.AddWithValue("@suggestion", suggestion ?? (object)DBNull.Value);
Line 224: cmd.Parameters.AddWithValue("@mbr_username", mbr_username ?? (object)DBNull.Value);
Line 225: cmd.Parameters.AddWithValue("@mbr_email", mbr_email ?? (object)DBNull.Value);
Line 226: cmd.Parameters.AddWithValue("@subdataType", subdataType ?? (object)DBNull.Value);
Line 227: cmd.Parameters.AddWithValue("@writepoint", writepoint ?? (object)DBNull.Value);
Line 228: cmd.Parameters.AddWithValue("@isfree", isfree ?? (object)DBNull.Value);
Line 229: cmd.Parameters.AddWithValue("@startym", startym ?? (object)DBNull.Value);
Line 230: cmd.Parameters.AddWithValue("@endym", endym ?? (object)DBNull.Value);
Line 231: cmd.Parameters.AddWithValue("@compidno", compidno ?? (object)DBNull.Value);
Line 232:
Line 233: conn.Open();
Line 234: int rows = cmd.ExecuteNonQuery();
Line 235: return rows > 0;
Line 236: }
Line 237: }
Line 238: }
Line 239: catch
Line 240: {
Line 241: return false;
Line 242: }
Line 243: }
Line 244:
Line 245:
Line 246: public static bool AddDbApplyMessage(string inquiryid, string sugType, string suggestion, string apply_date, string mbr_username, string mbr_email, string mbr_jobcomp, string mbr_phone)
Line 247: {
Line 248: return AddDbApplyMessage(inquiryid, sugType, suggestion, apply_date, mbr_username, mbr_email, mbr_jobcomp, mbr_phone, "", "");
Line 249: }
Line 250:
Line 251: public static bool AddDbApplyMessage(string inquiryid, string sugType, string suggestion, string apply_date, string mbr_username, string mbr_email, string mbr_jobcomp, string mbr_phone, string username)
Line 252: {
Line 253: return AddDbApplyMessage(inquiryid, sugType, suggestion, apply_date, mbr_username, mbr_email, mbr_jobcomp, mbr_phone, "", "");
Line 254: }
Line 255: public static bool AddDbApplyMessage(string inquiryid, string sugType, string suggestion, string apply_date, string mbr_username, string mbr_email, string mbr_jobcomp, string mbr_phone, string username, string deviceType)
Line 256: {
Line 257: DateTime dt;
Line 258: DateTimeFormatInfo dtFormat = new System.Globalization.DateTimeFormatInfo();
Line 259: dtFormat.ShortDatePattern = "yyyy/MM/dd";
Line 260: dt = Convert.ToDateTime(apply_date, dtFormat);
Line 261: HttpContext.Current.Response.Write(dt);
Line 262:
Line 263: //HttpContext.Current.Response.End();
Line 264: bool exec = false;
Line 265: deviceType = !String.IsNullOrEmpty(deviceType) ? String.Format("【IEK Consulting APP - {0}】", deviceType) : deviceType;
Line 266: try
Line 267: {
Line 268: using (SqlConnection conn = DataSourceName.GetSqlConnIEK())
Line 269: {
Line 270: //sql command
Line 271: SqlCommand sqlCmd = new SqlCommand();
Line 272: sqlCmd.Connection = conn;
Line 273: sqlCmd.CommandType = CommandType.Text;
Line 274:
Line 275: string sql = @"
Line 276: begin transaction
Line 277: INSERT INTO Db_INQUIRY(INQUIRYID,SOURCE,INQSTATUS,INQSUBJECT,SUBMITDATE,INQCONTENT,CUSNAME,CUSEMAIL,SUGTYPE,CUSCOMPNAME,CUSCOMPPHONE,USERNAME)
Line 278: values
Line 279: (
Line 280: @INQUIRYID,@SOURCE,@INQSTATUS,@INQSUBJECT,getdate(),@INQCONTENT,@CUSNAME,@CUSEMAIL,@SUGTYPE,@CUSCOMPNAME,@CUSCOMPPHONE,@USERNAME
Line 281: )
Line 282: commit transaction
Line 283: ";
Line 284:
Line 285: sqlCmd.CommandText = sql;
Line 286: sqlCmd.Parameters.Add("@INQUIRYID", SqlDbType.VarChar).Value = inquiryid;
Line 287: sqlCmd.Parameters.Add("@SOURCE", SqlDbType.VarChar).Value = 1;
Line 288: sqlCmd.Parameters.Add("@INQSTATUS", SqlDbType.VarChar).Value = 1;
Line 289: sqlCmd.Parameters.Add("@INQSUBJECT", SqlDbType.VarChar).Value = String.Format("{0}來自[{1}] 對「{2}」的問題", deviceType, mbr_email, sugType);
Line 290: sqlCmd.Parameters.Add("@INQCONTENT", SqlDbType.NVarChar).Value = suggestion;
Line 291: //sqlCmd.Parameters.Add("@APPLYDATE", SqlDbType.VarChar).Value = dt.ToString();
Line 292: sqlCmd.Parameters.Add("@CUSNAME", SqlDbType.NVarChar).Value = mbr_username;
Line 293: sqlCmd.Parameters.Add("@CUSEMAIL", SqlDbType.VarChar).Value = mbr_email;
Line 294: sqlCmd.Parameters.Add("@SUGTYPE", SqlDbType.VarChar).Value = "000000000000000000000000000000";
Line 295: sqlCmd.Parameters.Add("@CUSCOMPNAME", SqlDbType.NVarChar).Value = mbr_jobcomp;
Line 296: sqlCmd.Parameters.Add("@CUSCOMPPHONE", SqlDbType.VarChar).Value = mbr_phone;
Line 297: sqlCmd.Parameters.Add("@USERNAME", SqlDbType.NVarChar).Value = username;
Line 298:
Line 299: //open connection
Line 300: conn.Open();
Line 301: //execute
Line 302: if (sqlCmd.ExecuteNonQuery() > 0)
Line 303: {
Line 304:
Line 305: exec = true;
Line 306:
Line 307: }
Line 308:
Line 309: //close onnection
Line 310: conn.Close();
Line 311: }
Line 312:
Line 313: }
Line 314: catch (Exception ex)
Line 315: {
Line 316: throw new Exception("SQL Exception in [AddDbApplyMessage]" + ex.Message);
Line 317: }
Line 318: return exec;
Line 319: }
Line 320:
Line 321: #region 取得DbApply List XDoc
Line 322: //取得DbApply List (分頁)
Line 323: public static XmlDocument GetDbApplyList(int recStart, int recSize, string forum_id, string sub_id, string mbr_id, string sortstr,
Line 324: string startdate, string enddate, string extstatus, string srh_comp, string searchname)
Line 325: {
Line 326: XmlDocument xDoc = null;
Line 327: StringBuilder sqlSB = new StringBuilder();
Line 328: try
Line 329: {
Line 330: SqlConnection oConn = DataSourceName.GetSqlConnIEK();
Line 331: SqlCommand oCmd = new SqlCommand();
Line 332: oCmd.Connection = oConn;
Line 333: //加入mbr_relation,用來篩選團體名稱
Line 334: sqlSB.Append(@"
Line 335: select r.apply_id,r.apply_name,r.apply_type,convert(varchar(50),r.apply_date,111) as apply_date,
Line 336: convert(varchar(50),r.apply_createdate,111) as apply_createdate,r.apply_isagree,r.apply_Purpose,r.apply_mbrid,
Line 337: r.apply_email,m.mbr_username
Line 338: from Db_ApplyInfo r
Line 339: left join itis.dbo.mbr_member m on apply_mbrid collate Chinese_Taiwan_Stroke_CI_AI= mbr_id collate Chinese_Taiwan_Stroke_CI_AI
Line 340:
Line 341: ");
Line 342:
Line 343: //搜尋日期區間
Line 344: //oCmd.Parameters.Add("@startdate", SqlDbType.NVarChar).Value = startdate;
Line 345: //oCmd.Parameters.Add("@enddate", SqlDbType.NVarChar).Value = enddate;
Line 346: //搜尋關鍵字
Line 347: //if (searchname != "")
Line 348: //{
Line 349: // sqlSB.Append(@" And (BB_Post.post_title LIKE @Keyword OR BB_Post.post_text LIKE @Keyword
Line 350: // OR BB_Post.poster_id IN (SELECT mbr_id FROM mbr_member WITH (nolock) WHERE mbr_username LIKE @Keyword)
Line 351: // OR BB_Post.poster_id IN (SELECT mbr_id FROM ITISInteraction.dbo.BB_Users WITH (nolock) WHERE user_name LIKE @Keyword)
Line 352: // OR BB_Post.poster_id IN ( SELECT rel_mbrid FROM mbr_relation WITH (nolock) WHERE rel_compidno IN ( SELECT comp_idno FROM mbr_comp WITH (nolock) WHERE comp_name LIKE @Keyword))
Line 353: // )");
Line 354: // oCmd.Parameters.AddWithValue("@Keyword", "%" + searchname + "%");
Line 355: //}
Line 356: ////搜尋處理狀態
Line 357: //if (extstatus != "99" && extstatus != "")
Line 358: //{
Line 359: // sqlSB.Append(@" And BB_Topic.topic_extstatus = @extstatus ");
Line 360: // oCmd.Parameters.AddWithValue("@extstatus", extstatus);
Line 361: //}
Line 362: ////搜尋團體名稱
Line 363: //if (srh_comp != "")
Line 364: //{
Line 365: // sqlSB.Append(@" And rel.rel_compidno = @srh_comp ");
Line 366: // oCmd.Parameters.AddWithValue("@srh_comp", srh_comp);
Line 367: //}
Line 368: sqlSB.Append(@" order by apply_createdate desc ");
Line 369: oCmd.CommandText = sqlSB.ToString();
Line 370: Db2Xml db2xml = new Db2Xml();
Line 371: db2xml.CountTotal = true;
Line 372: db2xml.ShowSeriesNo = true;
Line 373: xDoc = db2xml.GetXmlDocument(oCmd, recStart, recSize);
Line 374: }
Line 375: catch (Exception err)
Line 376: {
Line 377: throw new Exception("(GetApplyListByTime)" + err.Message);
Line 378: }
Line 379: return xDoc;
Line 380: }
Line 381: #endregion
Line 382:
Line 383: #region 取得DbApply List DataSet
Line 384: //取得DbApply List (分頁)
Line 385: public static DataSet GetDbApplyList(int recStart, int recSize, string mbr_id, string startdate, string enddate, string isagree, string searchname)
Line 386: {
Line 387: /*
Line 388: conn.ConnectionString = "data source=ieksql1.iek.org.tw,5433;initial catalog=itis;User ID = pubitisuser; Password = gympk95FGLFM2025";
Line 389: */
Line 390:
Line 391: DataSet ds = new DataSet();
Line 392: try
Line 393: {
Line 394: //HttpContext.Current.Response.Write("xxxxxx ");
Line 395: //HttpContext.Current.Response.End();
Line 396: //HttpContext.Current.Response.Write(DataSourceName.GetSqlConnIEK().ConnectionString+" "); //抓不到connectionString
Line 397:
Line 398: //using (SqlConnection conn = DataSourceName.GetSqlConnIEK())
Line 399: using (SqlConnection conn = new SqlConnection())
Line 400: {
Line 401: //UINTERDB.ITRI.ORG.TW,8787; Initial Catalog = itis; User ID = pubitisuser; Password = d9PGwCGf!d34rWpR" />
Line 402: conn.ConnectionString = "data source=UINTERDB.ITRI.ORG.TW,8787;initial catalog=itis;User ID = pubitisuser; Password =d9PGwCGf!d34rWpR";
Line 403: //HttpContext.Current.Response.Write("uuuuuuuuuuuuuuuuu ");
Line 404:
Line 405: string sql = string.Format(@"
Line 406: select r.apply_id,r.apply_name,r.apply_type,convert(varchar(50),r.apply_date,111) as apply_date,
Line 407: convert(varchar(50),r.apply_createdate,111) as apply_createdate,r.apply_isagree,r.apply_Purpose,r.apply_mbrid,
Line 408: r.apply_email,m.mbr_username,convert(varchar(50),r.apply_modifydate,111) as modifydate,r.apply_status
Line 409: from Db_INQUIRY1 r
Line 410: left join itis.dbo.mbr_member m on apply_mbrid collate Chinese_Taiwan_Stroke_CI_AI= mbr_id collate Chinese_Taiwan_Stroke_CI_AI
Line 411: order by apply_date desc
Line 412: ");
Line 413: //HttpContext.Current.Response.Write("hhhhhhhhhhhhhhhhhhhhhhhhhhh ");
Line 414:
Line 415: conn.Open();
Line 416: using (SqlCommand sqlCmd = new SqlCommand(sql, conn))
Line 417: {
Line 418: sqlCmd.CommandType = CommandType.Text;
Line 419: sqlCmd.Parameters.Add("@mbr_id", SqlDbType.VarChar).Value = mbr_id;
Line 420: SqlDataAdapter oDataAdapter = new SqlDataAdapter(sqlCmd);
Line 421: oDataAdapter.Fill(ds, "DbApplyList");
Line 422: //HttpContext.Current.Response.Write("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ");
Line 423: //HttpContext.Current.Response.End();
Line 424: //sqlCmd.Dispose();
Line 425: //oDataAdapter.Dispose();
Line 426: }
Line 427: conn.Close();
Line 428: }
Line 429: }
Line 430: catch (Exception ex)
Line 431: {
Line 432: throw new Exception("SQL Exception in [getDbApplyList]" + ex.Message);
Line 433: }
Line 434: return ds;
Line 435: }
Line 436: #endregion
Line 437:
Line 438: //#region 取得資料申請的詳細資料(管理端)
Line 439: //public static DataTable getDbApplyDetail(string Id)
Line 440: //{
Line 441: // DataTable dt = new DataTable("dt");
Line 442: // try
Line 443: // {
Line 444: // using (SqlConnection conn = DataSourceName.GetSqlConnIEK())
Line 445: // {
Line 446: // string sql = string.Format(@"
Line 447: // select * from Db_INQUIRY1
Line 448: // where apply_id = @Id --2837722
Line 449: // ");
Line 450:
Line 451: // conn.Open();
Line 452: // using (SqlCommand sqlCmd = new SqlCommand(sql, conn))
Line 453: // {
Line 454: // sqlCmd.CommandType = CommandType.Text;
Line 455: // sqlCmd.Parameters.Add("@Id", SqlDbType.VarChar).Value = Id;
Line 456: // //sqlCmd.Parameters.Add("@iekIP", SqlDbType.VarChar).Value = AppConfig.iekIP;
Line 457: // SqlDataAdapter oDataAdapter = new SqlDataAdapter(sqlCmd);
Line 458: // oDataAdapter.Fill(dt);
Line 459:
Line 460: // //sqlCmd.Dispose();
Line 461: // //oDataAdapter.Dispose();
Line 462: // }
Line 463: // conn.Close();
Line 464: // }
Line 465: // }
Line 466: // catch (Exception ex)
Line 467: // {
Line 468: // throw new Exception("SQL Exception in [getDbApplyDetail]" + ex.Message);
Line 469: // }
Line 470:
Line 471: // return dt;
Line 472: //}
Line 473: //#endregion
Line 474: }
|