public ActionResult approve() { if (SessionData.CurrentUser == null) { return(Redirect("/account/dang-xuat")); } var _WikiDoc_BL = new WikiDoc_BL(); WikiDoc_Info _ObjInfo = new WikiDoc_Info(); string _casecode = ""; if (RouteData.Values.ContainsKey("id")) { _casecode = RouteData.Values["id"].ToString(); } try { _ObjInfo = _WikiDoc_BL.PortalWikiDoc_GetByCaseCode(_casecode); ViewBag.CataInfo = _ObjInfo; // lấy dữ liệu lịch sử giao dịch B_Todos_BL _B_Todos_BL = new B_Todos_BL(); List <B_Remind_Info> _ListRemind = new List <B_Remind_Info>(); List <B_Todos_Info> _Listtodo = _B_Todos_BL.NotifiGetByCasecode(_casecode, ref _ListRemind); ViewBag.ListTodo = _Listtodo; ViewBag.ListRemind = _ListRemind; } catch (Exception ex) { Logger.LogException(ex); } return(PartialView("~/Areas/Wiki/Views/WikiDoc/_PartialWikiApproOrReject.cshtml", _ObjInfo)); }
public ActionResult ViewDoc() { if (SessionData.CurrentUser == null) { return(Redirect("/account/dang-xuat")); } var _WikiDoc_BL = new WikiDoc_BL(); WikiDoc_Info _ObjInfo = new WikiDoc_Info(); decimal _docid = 0; if (RouteData.Values.ContainsKey("id")) { _docid = CommonFuc.ConvertToDecimal(RouteData.Values["id"]); } try { _ObjInfo = _WikiDoc_BL.WikiDoc_GetById(_docid); } catch (Exception ex) { Logger.LogException(ex); } int _crrstatus = 0; if (RouteData.Values.ContainsKey("id1")) { _crrstatus = CommonFuc.ConvertToInt(RouteData.Values["id1"]); } ViewBag.CurrStatus = _crrstatus; return(PartialView("~/Areas/Wiki/Views/WikiDoc/_PartialDocView.cshtml", _ObjInfo)); }
public ActionResult WikiDocListAllStatus() { if (SessionData.CurrentUser == null) { return(Redirect("/account/dang-xuat")); } List <WikiDoc_Info> lstObj = new List <WikiDoc_Info>(); int _Status = 0; if (RouteData.Values.ContainsKey("id")) { _Status = Convert.ToInt32(RouteData.Values["id"]); ViewBag.CurrStatus = _Status; } try { var _WikiCataBL = new WikiCatalogue_BL(); var ObjBL = new WikiDoc_BL(); lstObj = ObjBL.WikiDoc_Search("ALL|ALL|ALL" + "|" + SessionData.CurrentUser.Username); ViewBag.Paging = ObjBL.GetPagingHtml(); List <WikiCatalogues_Info> lstOjects = _WikiCataBL.WikiCatalogueGetAll(); ViewBag.ListCata = lstOjects; } catch (Exception ex) { Logger.LogException(ex); } return(PartialView("/Areas/Wiki/Views/WikiDoc/ListDicAllStatus.cshtml", lstObj)); }
public ActionResult DoAddDoc(WikiDoc_Info _objectInfo, List <AppDocumentInfo> pAppDocumentInfo) { string strListHashtag = ""; decimal pReturn = 0; try { var _WikiDoc_BL = new WikiDoc_BL(); _objectInfo.CREATED_BY = SessionData.CurrentUser.Username; _objectInfo.CREATED_DATE = DateTime.Now; _objectInfo.LANGUAGE_CODE = AppsCommon.GetCurrentLang(); _objectInfo.CONTENT = SetHashtagStyle(_objectInfo.CONTENT, ref strListHashtag); if (pAppDocumentInfo != null) { if (pAppDocumentInfo.Count > 0) { foreach (var info in pAppDocumentInfo) { if (SessionData.CurrentUser.chashFile.ContainsKey(info.keyFileUpload)) { string _url = (string)SessionData.CurrentUser.chashFile[info.keyFileUpload]; string[] _arr = _url.Split('/'); string _filename = WebApps.Resources.Resource.FileDinhKem; if (_arr.Length > 0) { _filename = _arr[_arr.Length - 1]; } info.Filename = _filename; info.Url_Hardcopy = _url; if (info.keyFileUpload == "WIKIADD_FILE_01") { _objectInfo.FILE_URL01 = info.Url_Hardcopy; } if (info.keyFileUpload == "WIKIADD_FILE_02") { _objectInfo.FILE_URL02 = info.Url_Hardcopy; } if (info.keyFileUpload == "WIKIADD_FILE_03") { _objectInfo.FILE_URL03 = info.Url_Hardcopy; } // lấy xong thì xóa SessionData.CurrentUser.chashFile.Remove(info.keyFileUpload); } } } } pReturn = _WikiDoc_BL.WikiDoc_Insert(_objectInfo); } catch (Exception ex) { Logger.LogException(ex); } return(Json(new { status = pReturn, HashTag = strListHashtag.Trim() })); }
public ActionResult ChildCatalogue() { try { WikiCatalogue_BL _CatalogueBL = new WikiCatalogue_BL(); WikiDoc_BL _WikiBL = new WikiDoc_BL(); decimal _Cataid = 0; if (RouteData.Values["id"] != null) { _Cataid = Convert.ToDecimal(RouteData.Values["id"]); } List <WikiCatalogues_Info> _ListCata = new List <WikiCatalogues_Info>(); _ListCata = _CatalogueBL.Portal_CataGetAll(); List <WikiDoc_Info> _ListDocSearch = new List <WikiDoc_Info>(); if (_Cataid > 0) { // lấy ds tin theo danh mục _ListDocSearch = _WikiBL.PortalWikiDoc_Search("3|" + _Cataid.ToString() + "|ALL|" + AppsCommon.GetCurrentLang()); ViewBag.Paging = _WikiBL.GetPagingHtml(); ViewBag.ListDocSearch = _ListDocSearch; WikiCatalogue_BL _Catabl = new WikiCatalogue_BL(); WikiCatalogues_Info _Catainfo = new WikiCatalogues_Info(); _Catainfo = _Catabl.WikiCatalogue_GetByID(_Cataid); ViewBag.CatalogueInfo = _Catainfo; } else { // lấy thằng đầu tiên WikiCatalogues_Info _firstCata = new WikiCatalogues_Info(); foreach (var item in _ListCata) { if (item.PARENT_ID != 0) { _firstCata = item; break; } } _ListDocSearch = _WikiBL.PortalWikiDoc_Search("3|" + _firstCata.ID.ToString() + "|ALL|" + AppsCommon.GetCurrentLang()); ViewBag.Paging = _WikiBL.GetPagingHtml(); ViewBag.ListDocSearch = _ListDocSearch; ViewBag.CatalogueInfo = _firstCata; } ViewBag.ListCatalogue = _ListCata; ViewBag.CurrCata = _Cataid; } catch (Exception ex) { Logger.LogException(ex); } return(View("~/Areas/Home/Views/Wiki/ChildCatalogue.cshtml")); }
public ActionResult DoEditHashTagDoc(decimal p_id, string p_hashtag) { decimal pReturn = 0; try { var _WikiDoc_BL = new WikiDoc_BL(); pReturn = _WikiDoc_BL.WikiDoc_Update_HashTag(p_id, p_hashtag); } catch (Exception ex) { Logger.LogException(ex); } return(Json(new { status = pReturn })); }
public ActionResult approveorreject(decimal p_id, decimal p_status, string p_note) { decimal _result = 0; var _WikiDoc_BL = new WikiDoc_BL(); try { _result = _WikiDoc_BL.WikiDoc_Update_Status(p_id, p_status, p_note, SessionData.CurrentUser.Username); } catch (Exception ex) { Logger.LogException(ex); } return(Json(new { result = _result })); }
public ActionResult FindOject(string keysSearch, string options) { var lstOjects = new List <WikiDoc_Info>(); try { var _WikiDoc_BL = new WikiDoc_BL(); lstOjects = _WikiDoc_BL.WikiDoc_Search(keysSearch + "|" + SessionData.CurrentUser.Username, options); ViewBag.Paging = _WikiDoc_BL.GetPagingHtml(); } catch (Exception ex) { Logger.LogException(ex); } return(PartialView("~/Areas/Wiki/Views/WikiDoc/_PartialDocData.cshtml", lstOjects)); }
public ActionResult WikiDocVoting(decimal p_id, decimal p_point, string p_userwikiid) { try { WikiDoc_BL _WikiBL = new WikiDoc_BL(); WikiDoc_Info _DocInfo = new WikiDoc_Info(); // lấy chi tiết tin _DocInfo = _WikiBL.WikiVoting(p_id, p_userwikiid, p_point); return(Json(new { success = 0, TotalVoted = _DocInfo.NUMBER_VOTED, WidthDiv = Math.Round((_DocInfo.RATING / (_DocInfo.NUMBER_VOTED * 5) * 100), 2), Rating = Math.Round((_DocInfo.RATING / (_DocInfo.NUMBER_VOTED * 5)), 2) })); } catch (Exception ex) { Logger.LogException(ex); return(null); } }
public ActionResult GetListdocDetail(decimal p_id) { try { WikiDoc_BL _WikiBL = new WikiDoc_BL(); WikiDoc_Info _DocInfo = new WikiDoc_Info(); // lấy chi tiết tin _DocInfo = _WikiBL.PortalWikiDoc_GetById(p_id); ViewBag.DocdetailInfo = _DocInfo; } catch (Exception ex) { Logger.LogException(ex); } return(PartialView("/Areas/Home/Views/Wiki/_PartialDocViewDetail.cshtml")); }
public ActionResult DoDeleteDoc(int p_id) { decimal _result = 0; var _WikiDoc_BL = new WikiDoc_BL(); try { var modifiedBy = SessionData.CurrentUser.Username; _result = _WikiDoc_BL.WikiDoc_Delete(p_id); } catch (Exception ex) { Logger.LogException(ex); } return(Json(new { result = _result })); }
public ActionResult ViewEdit() { if (SessionData.CurrentUser == null) { return(Redirect("/account/dang-xuat")); } var _WikiDoc_BL = new WikiDoc_BL(); WikiDoc_Info _ObjInfo = new WikiDoc_Info(); decimal _docid = 0; if (RouteData.Values.ContainsKey("id")) { _docid = CommonFuc.ConvertToDecimal(RouteData.Values["id"]); } int _crrstatus = 0; if (RouteData.Values.ContainsKey("id1")) { _crrstatus = CommonFuc.ConvertToInt(RouteData.Values["id1"]); } try { _ObjInfo = _WikiDoc_BL.WikiDoc_GetById(_docid); var _WikiCataBL = new WikiCatalogue_BL(); List <WikiCatalogues_Info> lstOjects = _WikiCataBL.WikiCatalogueGetAll(); ViewBag.ListCata = lstOjects; // bỏ hết hashtag nvshashtag đi _ObjInfo.CONTENT = _ObjInfo.CONTENT.Replace("<nvshashtag>", "").Replace("</nvshashtag>", ""); var _ObjectInfo = new WikiCatalogues_Info(); var _WikiCatalogue_BL = new WikiCatalogue_BL(); _ObjectInfo = _WikiCatalogue_BL.WikiCatalogue_GetByID(_ObjInfo.CATA_ID); ViewBag.CataInfo = _ObjectInfo; } catch (Exception ex) { Logger.LogException(ex); } ViewBag.CurrStatus = _crrstatus; return(PartialView("~/Areas/Wiki/Views/WikiDoc/_PartialDocEdit.cshtml", _ObjInfo)); }
public ActionResult GetListdocByCataid(decimal p_id) { try { WikiCatalogue_BL _CatalogueBL = new WikiCatalogue_BL(); WikiDoc_BL _WikiBL = new WikiDoc_BL(); List <WikiDoc_Info> _ListDocSearch = new List <WikiDoc_Info>(); // lấy ds tin theo danh mục _ListDocSearch = _WikiBL.WikiDoc_GetBy_CataID(p_id); ViewBag.ListDocSearch = _ListDocSearch; WikiCatalogue_BL _Catabl = new WikiCatalogue_BL(); WikiCatalogues_Info _Catainfo = new WikiCatalogues_Info(); _Catainfo = _Catabl.WikiCatalogue_GetByID(p_id); ViewBag.CatalogueInfo = _Catainfo; } catch (Exception ex) { Logger.LogException(ex); } return(PartialView("/Areas/Home/Views/Wiki/_PartialListDocByCata.cshtml")); }
public ActionResult ExportDocToFile(decimal p_id) { string _filedownload = ""; string _fileSaveName = ""; try { WikiDoc_BL _WikiBL = new WikiDoc_BL(); WikiDoc_Info _DocInfo = new WikiDoc_Info(); // lấy chi tiết tin _DocInfo = _WikiBL.PortalWikiDoc_GetById(p_id); //lưu file html trc string fullFileName = Request.MapPath("/Content/ExportDocFile/" + "1.html"); StreamWriter streamWriter = new StreamWriter(new FileStream(fullFileName, FileMode.Create, FileAccess.Write)); if (AppsCommon.GetCurrentLang() == "VI_VN") { streamWriter.Write(_DocInfo.CONTENT); } else { streamWriter.Write(_DocInfo.CONTENT_En); } streamWriter.Close(); _filedownload = "/Content/ExportDocFile/" + _DocInfo.ID + ".pdf"; DocumentModel.Load(Server.MapPath("/Content/ExportDocFile/1.html")).Save(Server.MapPath(_filedownload)); _fileSaveName = _DocInfo.ID.ToString() + ".pdf"; } catch (Exception ex) { Logger.LogException(ex); } return(Json(new { result = "1", FileDownload = _filedownload, FileSaveName = _fileSaveName })); }
public ActionResult WikiDocSearch(string keysSearch, string options) { var lstOjects = new List <WikiDoc_Info>(); try { var _WikiDoc_BL = new WikiDoc_BL(); lstOjects = _WikiDoc_BL.PortalWikiDoc_Search(keysSearch + "|" + AppsCommon.GetCurrentLang(), options); ViewBag.Paging = _WikiDoc_BL.GetPagingHtml(); if (keysSearch.Split('|').Length > 2 && keysSearch.Split('|')[1] != "ALL" && keysSearch.Split('|')[1] != "") { WikiCatalogue_BL _Catabl = new WikiCatalogue_BL(); WikiCatalogues_Info _Catainfo = new WikiCatalogues_Info(); _Catainfo = _Catabl.WikiCatalogue_GetByID(Convert.ToDecimal((keysSearch.Split('|')[1]))); ViewBag.CatalogueInfo = _Catainfo; } } catch (Exception ex) { Logger.LogException(ex); } ViewBag.ListDocSearch = lstOjects; return(PartialView("/Areas/Home/Views/Wiki/_PartialListDocByCata.cshtml")); }
public ActionResult FindOject(int searchtype, string keysSearch, string options) { int p_CurrentPage = 1; int _reconpage = 5; p_CurrentPage = Convert.ToInt32(options.Split('|')[3]); _reconpage = Convert.ToInt32(options.Split('|')[4]); decimal _total_record = 0; string p_to = ""; string p_from = CommonFuc.Get_From_To_Page(p_CurrentPage, ref p_to, _reconpage); string _sortype = "ALL"; _sortype = " ORDER BY " + options.Split('|')[0] + " " + options.Split('|')[1]; if (string.IsNullOrEmpty(_sortype) || _sortype.Trim() == "ORDER BY") { _sortype = "ALL"; } string htmlPaging = ""; try { ViewBag.SearchType = searchtype.ToString(); if (searchtype == 1) { // đơn Application_Header_BL _obj_bl = new Application_Header_BL(); List <ApplicationHeaderInfo> _lst = _obj_bl.ApplicationHeader_Search(SessionData.CurrentUser.Username, keysSearch, ref _total_record, p_from, p_to, _sortype, 1); htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <ApplicationHeaderInfo>((int)_total_record, p_CurrentPage, "Đơn", _reconpage); ViewBag.Paging = htmlPaging; ViewBag.Obj = _lst; ViewBag.SumRecord = _total_record; return(PartialView("~/Areas/Home/Views/Shared/_SearchDataAppStatus.cshtml")); } if (searchtype == 2) { // luật sư var userBL = new UserBL(); var lstUsers = new List <UserInfo>(); keysSearch = "|" + keysSearch + "|" + Convert.ToInt16(CommonEnums.UserType.Lawer) + "|"; lstUsers = userBL.HomeFindUser(ref _total_record, keysSearch, options); htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <UserInfo>((int)_total_record, p_CurrentPage, "Luật sư", _reconpage); ViewBag.Paging = htmlPaging; ViewBag.SumRecord = _total_record; return(PartialView("~/Areas/Home/Views/Shared/_SearchDataLawyer.cshtml", lstUsers)); } if (searchtype == 3) { // khách hàng var userBL = new UserBL(); var lstUsers = new List <UserInfo>(); keysSearch = "|" + keysSearch + "|" + Convert.ToInt16(CommonEnums.UserType.Customer) + "|"; lstUsers = userBL.FindCustomer(ref _total_record, keysSearch, options); htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <UserInfo>((int)_total_record, p_CurrentPage, "Khách hàng", _reconpage); ViewBag.Paging = htmlPaging; ViewBag.SumRecord = _total_record; return(PartialView("~/Areas/Home/Views/Shared/_SearchDataCustomer.cshtml", lstUsers)); } if (searchtype == 4) { //wiki var lstOjects = new List <WikiDoc_Info>(); keysSearch = CommonWiki.Stt_daduyet.ToString() + "||" + keysSearch; var _WikiDoc_BL = new WikiDoc_BL(); lstOjects = _WikiDoc_BL.WikiDoc_DashboardSearch(ref _total_record, keysSearch, options); htmlPaging = WebApps.CommonFunction.AppsCommon.Get_HtmlPaging <WikiDoc_Info>((int)_total_record, p_CurrentPage, "Bài viết", _reconpage); ViewBag.Paging = htmlPaging; ViewBag.SumRecord = _total_record; return(PartialView("~/Areas/Home/Views/Shared/_SearchDataWiki.cshtml", lstOjects)); } if (searchtype == 5) { //seach var _SearchObject_BL = new SearchObject_BL(); string _key = "ALL|ALL|ALL|ALL|ALL" + "|" + SessionData.CurrentUser.Type.ToString() + "|" + SessionData.CurrentUser.Username + "|" + keysSearch; decimal totalRecordFindResult = 0; List <SearchObject_Header_Info> lstOjects = _SearchObject_BL.SEARCH_OBJECT_SEARCH(ref totalRecordFindResult, _key, options); ViewBag.Paging = _SearchObject_BL.GetPagingHtml(); return(PartialView("~/Areas/Home/Views/Shared/_SearchDataSearch.cshtml", lstOjects)); } } catch (Exception ex) { Logger.LogException(ex); } return(null); }