| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676 |
-
- using CallCenter.Utility;
- using CallCenterApi.Common;
- using CallCenterApi.Interface.Controllers.Base;
- using CallCenterApi.Interface.Models.Common;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlTypes;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Web;
- using System.Web.Caching;
- using System.Web.Mvc;
- namespace CallCenterApi.Interface.Controllers
- {
- public class HomeController : BaseController
- {
- // GET: Home
- public ActionResult Index()
- {
- return Success("成功");
- }
- [Authorize]
- public JsonResult json1()
- {
- var person = new
- {
- Name = "张三",
- Age = 22,
- Sex = "男"
- };
- return Json(person, JsonRequestBehavior.AllowGet);
- }
- public string json2()
- {
- var person = new
- {
- Name = "张三",
- Age = 22,
- Sex = "男",
- Date = DateTime.Now
- };
- return person.ToJson();
- }
- public string json2_()
- {
- var tt = new
- {
- exp = 20,
- money = 12
- };
- var person = new
- {
- Name = "张三",
- Age = 22,
- Sex = "男",
- other = tt,
- Date = DateTime.Now
- };
- return person.ToJson();
- }
- /// <summary>
- /// 演示 查询出来datatable的数据进行展示
- /// </summary>
- /// <returns></returns>
- public string json3()
- {
- DataTable tblDatas = new DataTable("Datas");
- DataColumn dc = null;
- dc = tblDatas.Columns.Add("Product", Type.GetType("System.String"));
- dc = tblDatas.Columns.Add("Version", Type.GetType("System.String"));
- dc = tblDatas.Columns.Add("Description", Type.GetType("System.String"));
- DataRow newRow;
- newRow = tblDatas.NewRow();
- newRow["Product"] = "大话西游";
- newRow["Version"] = "2.0";
- newRow["Description"] = "我很喜欢";
- tblDatas.Rows.Add(newRow);
- newRow = tblDatas.NewRow();
- newRow["Product"] = "梦幻西游";
- newRow["Version"] = "3.0";
- newRow["Description"] = "比大话更幼稚";
- tblDatas.Rows.Add(newRow);
- return tblDatas.ToJson();
- }
- public ActionResult json3_()
- {
- DataTable tblDatas = new DataTable("Datas");
- DataColumn dc = null;
- dc = tblDatas.Columns.Add("Product", Type.GetType("System.String"));
- dc = tblDatas.Columns.Add("Version", Type.GetType("System.String"));
- dc = tblDatas.Columns.Add("Description", Type.GetType("System.String"));
- DataRow newRow;
- newRow = tblDatas.NewRow();
- newRow["Product"] = "大话西游";
- newRow["Version"] = "2.0";
- newRow["Description"] = "我很喜欢";
- tblDatas.Rows.Add(newRow);
- newRow = tblDatas.NewRow();
- newRow["Product"] = "梦幻西游";
- newRow["Version"] = "3.0";
- newRow["Description"] = "比大话更幼稚";
- tblDatas.Rows.Add(newRow);
- return Success("成功", tblDatas);
- }
- public ActionResult excel()
- {
- DataTable tblDatas = new DataTable("Datas");
- DataColumn dc = null;
- dc = tblDatas.Columns.Add("Product", Type.GetType("System.String"));
- dc = tblDatas.Columns.Add("Version", Type.GetType("System.String"));
- dc = tblDatas.Columns.Add("Description", Type.GetType("System.String"));
- DataRow newRow;
- newRow = tblDatas.NewRow();
- newRow["Product"] = "大话西游";
- newRow["Version"] = "2.0";
- newRow["Description"] = "我很喜欢";
- tblDatas.Rows.Add(newRow);
- newRow = tblDatas.NewRow();
- newRow["Product"] = "梦幻西游";
- newRow["Version"] = "3.0";
- newRow["Description"] = "比大话更幼稚";
- tblDatas.Rows.Add(newRow);
- NPOIHelper npoi = new NPOIHelper();
- string[] s = { "列1", "列2", "列3" };
- if (npoi.ToExcel(tblDatas, "test", null, "D:/2.xlsx", s))
- {
- return Success("成功", tblDatas);
- }
- else
- {
- return Error("导出失败");
- }
- }
- public ActionResult excel1()
- {
- DataTable tblDatas = new DataTable("Datas");
- DataColumn dc = null;
- dc = tblDatas.Columns.Add("Product", Type.GetType("System.String"));
- dc = tblDatas.Columns.Add("Version", Type.GetType("System.String"));
- dc = tblDatas.Columns.Add("Description", Type.GetType("System.String"));
- DataRow newRow;
- newRow = tblDatas.NewRow();
- newRow["Product"] = "大话西游";
- newRow["Version"] = "2.0";
- newRow["Description"] = "我很喜欢";
- tblDatas.Rows.Add(newRow);
- newRow = tblDatas.NewRow();
- newRow["Product"] = "梦幻西游";
- newRow["Version"] = "3.0";
- newRow["Description"] = "比大话更幼稚";
- tblDatas.Rows.Add(newRow);
- NPOIHelper npoi = new NPOIHelper();
- if (npoi.ExportToExcel("test", tblDatas) == "")
- {
- return Success("成功", tblDatas);
- }
- else
- {
- return Error("导出失败");
- }
- }
- public ActionResult error()
- {
- return Error("不具备权限");
- }
- public string ss()
- {
- return "ss";
- }
- public string tt(string name, string pass)
- {
- return "sss " + name + pass;
- }
- /// <summary>
- /// 抛出HTTP 500
- /// </summary>
- /// <returns></returns>
- public ActionResult ThrowHttp500()
- {
- throw new HttpException(500, "服务器错误");
- }
- /// <summary>
- /// 抛出HTTP 404
- /// </summary>
- /// <returns></returns>
- public ActionResult ThrowHttp404()
- {
- throw new HttpException(404, "页面未找到");
- }
- /// <summary>
- /// 抛出未引用对象异常
- /// ,此处单独使用HandleError特性
- /// ,并指定异常类型及响应视图
- /// </summary>
- /// <returns></returns>
- [HandleError(ExceptionType = typeof(NullReferenceException), View = "CustomError")]
- public ActionResult ThrowNullReferenceException()
- {
- throw new NullReferenceException();
- }
- /// <summary>
- /// 引发输入字符串的格式不正确异常
- /// ,此处指定了响应的错误页面
- /// ,由于是不同的控制器所以要完整的相对路径
- /// </summary>
- /// <returns></returns>
- [HandleError(View = "~/Views/Error/CustomHttpError.cshtml")]
- public ActionResult ThrowFormatException()
- {
- string str = "";
- int count = Convert.ToInt32(str);
- return View("Index");
- }
- public ActionResult GetRedisValue(string key)
- {
- return Success("成功", RedisHelper.StringGet(key));
- }
- public ActionResult GetRedis(string key)
- {
- List<object> caches = new List<object>();
- var keys = RedisHelper.GetKeyList(string.IsNullOrEmpty(key) ? "" : key);
- foreach (var k in keys)
- {
- caches.Add(new
- {
- key = k,
- value = RedisHelper.StringGet(k),
- outtime=RedisHelper.GetKeyOutTime(k)
- });
- }
- return Success("成功", caches);
- }
- public ActionResult UpdateRedis(string key, string value, int second = 10)
- {
- List<object> caches = new List<object>();
- var keys = RedisHelper.GetKeyList(string.IsNullOrEmpty(key) ? "" : key);
- foreach (var k in keys)
- {
- RedisHelper.StringSet(k, value, new TimeSpan(0, 0, second));
- }
- return Success("成功");
- }
- public ActionResult DeleteRedis(string key)
- {
- List<object> caches = new List<object>();
- var keys = RedisHelper.GetKeyList(string.IsNullOrEmpty(key) ? "" : key);
- long n = RedisHelper.KeysDelete(keys);
- return Success("成功", n);
- }
- public ActionResult GetAllCache()
- {
- System.Web.Caching.Cache cache = HttpRuntime.Cache;
- IDictionaryEnumerator cacheEnum = cache.GetEnumerator();
- List<cacheobj> caches = new List<cacheobj>();
- StringBuilder sb = new StringBuilder();
- while (cacheEnum.MoveNext())
- {
- Dictionary<string, string> dic = null;
- try
- {
- dic = (Dictionary<string, string>)cacheEnum.Value;
- }
- catch
- {
- continue;
- }
- sb.Append($"F_UserID={dic["F_UserID"]}, ");
- sb.Append($"F_UserCode={dic["F_UserCode"]}, ");
- sb.Append($"F_UserName={dic["F_UserName"]} ");
- caches.Add(new cacheobj
- {
- key = cacheEnum.Key.ToString().Substring(0, 20),
- value = sb.ToString()
- });
- sb.Clear();
- }
- return Success("", new
- {
- count = caches.Count(),
- });
- }
- //public ActionResult MakeCache()
- //{
- // while (true)
- // {
- // Dictionary<string, string> Dic = new Dictionary<string, string>();
- // Dic.Add("F_UserID", "1411");
- // Dic.Add("F_UserCode", "8000");
- // Dic.Add("F_DeptId", "1");
- // Dic.Add("F_UserName", "系统管理员");
- // Dic.Add("F_Telephone", "15537150907");
- // Dic.Add("F_RoleID", "1");
- // Dic.Add("F_SeatFlag", "1");
- // new CallCenterApi.BLL.T_Sys_LoginLogs().Add(new Model.T_Sys_LoginLogs()
- // {
- // F_LoginName = "8000",
- // F_LoginId = 1411,
- // F_Result = "登录成功",
- // F_LoginIP = Common.DTRequest.GetIP(),
- // F_Hostname = Common.DTRequest.GetIP(),
- // F_LoginDate = DateTime.Now,
- // F_Remark = "",
- // F_State = 0
- // });
- // var token = FormsPrincipal<Dictionary<string, string>>.GetCookieValue(Dic["F_UserCode"], Dic);
- // //放入缓存
- // CacheHelper.Insert(token, Dic, 2880, System.Web.Caching.CacheItemPriority.NotRemovable);
- // Response.Write(token.Substring(0, 20) + "</n>");
- // }
- //}
- public ActionResult TestCache()
- {
- int n = 0;
- while (n<100)
- {
- Dictionary<string, string> Dic = new Dictionary<string, string>();
- Dic.Add("F_UserID", (1000 + n).ToString());
- Dic.Add("F_UserCode", (8000+n).ToString());
- Dic.Add("F_DeptId", "1");
- Dic.Add("F_UserName", "系统管理员" + n);
- Dic.Add("F_Telephone", "15537150907");
- Dic.Add("F_RoleID", "1");
- Dic.Add("F_SeatFlag", "1");
- var token = FormsPrincipal<Dictionary<string, string>>.GetCookieValue(Dic["F_UserCode"], Dic);
- CacheItemRemovedCallback cacheItemRemovedCallback = new CacheItemRemovedCallback(onRemove);
- //放入缓存
- CacheHelper.Insert(token, Dic, 1, System.Web.Caching.CacheItemPriority.NotRemovable, cacheItemRemovedCallback);
- n++;
- }
- return Success(n.ToString());
- }
- /// <summary>
- /// 移除缓存后调用
- /// </summary>
- /// <param name="key"></param>
- /// <param name="val"></param>
- /// <param name="reason"></param>
- public void onRemove(string key, object val, CacheItemRemovedReason reason)
- {
- var obj = new
- {
- key = key,
- val = val,
- reason = reason
- };
- Error(obj.ToJson());
- }
- /// <summary>
- /// 测试日志
- /// </summary>
- /// <param name="message"></param>
- /// <returns></returns>
- public ActionResult LogTest(string message)
- {
- var log = LogFactory.GetLogger(this.GetType().ToString());
- log.Debug(message);
- log.Info(message);
- log.Warn(message);
- log.Error(message);
- return Success("");
- }
- /// <summary>
- /// 测试日志
- /// </summary>
- /// <param name="message"></param>
- /// <returns></returns>
- public ActionResult GetConfig(string key)
- {
- return Success(Configs.GetValue(key));
- }
- /// <summary>
- /// 导出
- /// </summary>
- /// <returns></returns>
- public ActionResult Export()
- {
- var aw = new AsposeWord();
- aw.OpenWithTemplate(Server.MapPath("/Upload/Word/热线工单模版.doc"));
- var bt = aw.ExportAs();
- Response.AppendHeader("Access-Control-Expose-Headers", "Content-Disposition");
- return File(bt, "application/msword", DateTime.Now.Ticks.ToString() + ".doc");
- }
- /// <summary>
- /// 导出
- /// </summary>
- /// <returns></returns>
- public ActionResult ExportWord(int id)
- {
- var aw = new AsposeWord();
- aw.OpenWithTemplate(Server.MapPath("/Upload/Word/政策专家库模板.doc"));
- var dt = DB.DbHelperSQL.Query("select * from T_Wiki_Professor where F_Id=" + id).Tables[0];
- aw.Builder();
- aw.CreateProfessorWord(dt);
- var bt = aw.ExportAs();
- Response.AppendHeader("Access-Control-Expose-Headers", "Content-Disposition");
- return File(bt, "application/msword", DateTime.Now.Ticks.ToString() + ".doc");
- }
- /// <summary>
- /// 发送短信
- /// </summary>
- /// <returns></returns>
- public ActionResult Send(string phones, string templateCode, string templateParam)
- {
- //string result=SmsHelper.Send("15838094023", "614915038222241792");
- string result = SmsHelper.Send(phones, templateCode, templateParam);
- return Success(result);
- }
- /// <summary>
- /// 发送短信
- /// </summary>
- /// <returns></returns>
- public ActionResult SendNew(string phones, string content)
- {
- string result = SmsNewHelper.Send(phones, content);
- return Success(result);
- }
- /// <summary>
- /// 办事指南
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult ExportGuideWord(int id)
- {
- var aw = new AsposeWord();
- aw.OpenWithTemplate(Server.MapPath("/Upload/Word/办事指南模板.doc"));
- var dt = DB.DbHelperSQL.Query("select * from T_Wiki_LawGuide a where F_Id=" + id).Tables[0];
- dt.Columns.Add("fileurl");
- DataTable dtfile = new DataTable();
- string fileurl = "";
- string file = dt.Rows[0]["F_File"].ToString();
- if (!string.IsNullOrEmpty(file) )
- {
- dtfile = DB.DbHelperSQL.Query("select * from T_Sys_Accessories WITH(NOLOCK) where F_FileId in (" + file + ")").Tables[0];
- foreach (DataRow dr in dtfile.Rows)
- {
- fileurl+= dr["F_FileName"].ToString() +",";
-
- }
- }
- if (!string.IsNullOrEmpty(fileurl))
- {
- fileurl= fileurl.Substring(0, fileurl.Length - 1);
- }
- dt.Rows[0]["fileurl"] = fileurl;
- string F_key = dt.Rows[0]["F_key"].ToString();
- var dt2 = DB.DbHelperSQL.Query("SELECT * FROM View_KeysSplit WHERE id="+ F_key).Tables[0];
- aw.Builder();
- aw.CreateGuideWord(dt,dt2);
- var bt = aw.ExportAs();
- Response.AppendHeader("Access-Control-Expose-Headers", "Content-Disposition");
- return File(bt, "application/msword", DateTime.Now.Ticks.ToString() + ".doc");
- }
- /// <summary>
- /// 部门职能
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- public ActionResult ExportDepartmentFunctionsWord(int id)
- {
- var aw = new AsposeWord();
- aw.OpenWithTemplate(Server.MapPath("/Upload/Word/部门职能模板.doc"));
- var dt = DB.DbHelperSQL.Query("select top 1 F_Id,F_FaBuDanWei,F_FaBuRen,F_HangYe,F_DiQu,F_ShengXiaoShiJian,F_ShiXiaoShiJian,F_FaBuShiJian,F_Key,F_FaWenWenHao,F_FaWenDanWei,F_BiaoShiBianMa,F_ZhiNengBuMen,F_File,F_WenJianMingCheng,F_WenJianNeiRong,F_DianJiLiang,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime from T_Wiki_Functions a with(nolock) where F_Id=" + id).Tables[0];
- dt.Columns.Add("fileurl");
- DataTable dtfile = new DataTable();
- string fileurl = "";
- string file = dt.Rows[0]["F_File"].ToString();
- if (!string.IsNullOrEmpty(file))
- {
- dtfile = DB.DbHelperSQL.Query("select * from T_Sys_Accessories WITH(NOLOCK) where F_FileId in (" + file + ")").Tables[0];
- foreach (DataRow dr in dtfile.Rows)
- {
- fileurl += dr["F_FileName"].ToString() + ",";
- }
- }
- if (!string.IsNullOrEmpty(fileurl))
- {
- fileurl = fileurl.Substring(0, fileurl.Length - 1);
- }
- dt.Rows[0]["fileurl"] = fileurl;
- string F_key = dt.Rows[0]["F_key"].ToString();
- var dt2 = DB.DbHelperSQL.Query("SELECT * FROM View_KeysSplit WHERE id=" + F_key).Tables[0];
- aw.Builder();
- aw.CreateDepartmentFunctionsWord(dt,dt2);
- var bt = aw.ExportAs();
- Response.AppendHeader("Access-Control-Expose-Headers", "Content-Disposition");
- return File(bt, "application/msword", DateTime.Now.Ticks.ToString() + ".doc");
- }
- //政策法规
- public ActionResult ExportPolicyWord(int id)
- {
- var aw = new AsposeWord();
- aw.OpenWithTemplate(Server.MapPath("/Upload/Word/政策法规模板.doc"));
- var dt = DB.DbHelperSQL.Query("select top 1 F_Id,F_FaBuDanWei,F_FaBuRen,F_HangYe,F_DiQu,F_ShengXiaoShiJian,F_ShiXiaoShiJian,F_FaBuShiJian,F_Key,F_FaWenWenHao,F_FaWenDanWei,F_BiaoShiBianMa,F_ZhiNengBuMen,F_File,F_WenJianMingCheng,F_WenJianNeiRong,F_DianJiLiang,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime from T_Wiki_Policy a with(nolock) where F_Id=" + id).Tables[0];
- dt.Columns.Add("fileurl");
- DataTable dtfile = new DataTable();
- string fileurl = "";
- string file = dt.Rows[0]["F_File"].ToString();
- if (!string.IsNullOrEmpty(file))
- {
- dtfile = DB.DbHelperSQL.Query("select * from T_Sys_Accessories WITH(NOLOCK) where F_FileId in (" + file + ")").Tables[0];
- foreach (DataRow dr in dtfile.Rows)
- {
- fileurl += dr["F_FileName"].ToString() + ",";
- }
- }
- if (!string.IsNullOrEmpty(fileurl))
- {
- fileurl = fileurl.Substring(0, fileurl.Length - 1);
- }
- dt.Rows[0]["fileurl"] = fileurl;
- aw.Builder();
- string F_key = dt.Rows[0]["F_key"].ToString();
- var dt2 = DB.DbHelperSQL.Query("SELECT * FROM View_KeysSplit WHERE id=" + F_key).Tables[0];
- aw.CreateDepartmentFunctionsWord(dt,dt2);
- var bt = aw.ExportAs();
- Response.AppendHeader("Access-Control-Expose-Headers", "Content-Disposition");
- return File(bt, "application/msword", DateTime.Now.Ticks.ToString() + ".doc");
- }
- //热点问da
- public ActionResult ExportHotSpotWord(int id)
- {
- var aw = new AsposeWord();
- aw.OpenWithTemplate(Server.MapPath("/Upload/Word/热点问答模板.doc"));
- var dt = DB.DbHelperSQL.Query("select top 1 F_Id,F_FaBuDanWei,F_FaBuRen,F_HangYe,F_DiQu,F_ShengXiaoShiJian,F_ShiXiaoShiJian,F_FaBuShiJian,F_Key,F_FaWenWenHao,F_FaWenDanWei,F_BiaoShiBianMa,F_JieDaDanWei,F_ZhengCeMingCi,F_File,F_ReDianWenTi,F_WenTiJieDa,F_DianJiLiang,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime from T_Wiki_HotspotGlossary a with(nolock) where F_Id=" + id).Tables[0];
- dt.Columns.Add("fileurl");
- DataTable dtfile = new DataTable();
- string fileurl = "";
- string file = dt.Rows[0]["F_File"].ToString();
- if (!string.IsNullOrEmpty(file))
- {
- dtfile = DB.DbHelperSQL.Query("select * from T_Sys_Accessories WITH(NOLOCK) where F_FileId in (" + file + ")").Tables[0];
- foreach (DataRow dr in dtfile.Rows)
- {
- fileurl += dr["F_FileName"].ToString() + ",";
- }
- }
- if (!string.IsNullOrEmpty(fileurl))
- {
- fileurl = fileurl.Substring(0, fileurl.Length - 1);
- }
- dt.Rows[0]["fileurl"] = fileurl;
- string F_key = dt.Rows[0]["F_key"].ToString();
- var dt2 = DB.DbHelperSQL.Query("SELECT * FROM View_KeysSplit WHERE id=" + F_key).Tables[0];
- aw.Builder();
- aw.CreateHotSpotWord(dt,dt2);
- var bt = aw.ExportAs();
- Response.AppendHeader("Access-Control-Expose-Headers", "Content-Disposition");
- return File(bt, "application/msword", DateTime.Now.Ticks.ToString() + ".doc");
- }
- //名词解释 T_Wiki_NounInterpretation
- public ActionResult ExportNounInterpretationWord(int id)
- {
- var aw = new AsposeWord();
- aw.OpenWithTemplate(Server.MapPath("/Upload/Word/名词解释模板.doc"));
- var dt = DB.DbHelperSQL.Query("select top 1 F_Id,F_FaBuDanWei,F_FaBuRen,F_HangYe,F_DiQu,F_ShengXiaoShiJian,F_ShiXiaoShiJian,F_FaBuShiJian,F_Key,F_FaWenWenHao,F_FaWenDanWei,F_BiaoShiBianMa,F_JieDaDanWei,F_ZhengCeMingCi,F_File,F_ReDianWenTi,F_WenTiJieDa,F_DianJiLiang,F_CreateUser,F_CreateTime,F_IsDelete,F_DeleteUser,F_DeleteTime from T_Wiki_NounInterpretation a with(nolock) where F_Id=" + id).Tables[0];
- dt.Columns.Add("fileurl");
- DataTable dtfile = new DataTable();
- string fileurl = "";
- string file = dt.Rows[0]["F_File"].ToString();
- if (!string.IsNullOrEmpty(file))
- {
- dtfile = DB.DbHelperSQL.Query("select * from T_Sys_Accessories WITH(NOLOCK) where F_FileId in (" + file + ")").Tables[0];
- foreach (DataRow dr in dtfile.Rows)
- {
- fileurl += dr["F_FileName"].ToString() + ",";
- }
- }
- if (!string.IsNullOrEmpty(fileurl))
- {
- fileurl = fileurl.Substring(0, fileurl.Length - 1);
- }
- dt.Rows[0]["fileurl"] = fileurl;
- string F_key = dt.Rows[0]["F_key"].ToString();
- var dt2 = DB.DbHelperSQL.Query("SELECT * FROM View_KeysSplit WHERE id=" + F_key).Tables[0];
- aw.Builder();
- aw.CreateHotSpotWord(dt,dt2);
- var bt = aw.ExportAs();
- Response.AppendHeader("Access-Control-Expose-Headers", "Content-Disposition");
- return File(bt, "application/msword", DateTime.Now.Ticks.ToString() + ".doc");
- }
- }
- public class cacheobj
- {
- public string key { get; set; }
- public string value { get; set; }
- }
- }
|