public ActionResult SearchShowTodo() { if (SessionData.CurrentUser == null) { return(Redirect("/account/dang-xuat")); } try { SearchObject_BL _searchBL = new SearchObject_BL(); SearchObject_Header_Info _HeaderInfo = new SearchObject_Header_Info(); List <SearchObject_Detail_Info> _ListDetail = new List <SearchObject_Detail_Info>(); SearchObject_Question_Info _QuestionInfo = new SearchObject_Question_Info(); List <AppClassDetailInfo> search_Class_Infos = new List <AppClassDetailInfo>(); string _casecode = ""; if (RouteData.Values.ContainsKey("id")) { _casecode = RouteData.Values["id"].ToString(); _HeaderInfo = _searchBL.SEARCH_HEADER_GETBY_CASECODE(_casecode, ref _ListDetail, ref _QuestionInfo, ref search_Class_Infos); ViewBag.SearchHeader = _HeaderInfo; ViewBag.SearchListDetail = _ListDetail; ViewBag.QuestionInfo = _QuestionInfo; // 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; ViewBag.Currstatus = _HeaderInfo.STATUS; ViewBag.lstClassDetailInfo = search_Class_Infos; B_Todos_Info _B_Todos_Info = _B_Todos_BL.Todo_GetByCaseCode(_casecode, SessionData.CurrentUser.Username); if (_B_Todos_Info != null) { ViewBag.B_Todos_Info = _B_Todos_Info; } //action là view hay sửa decimal _operator_type = Convert.ToDecimal(Common.CommonData.CommonEnums.Operator_Type.Update); if (RouteData.Values.ContainsKey("id1")) { _operator_type = Convert.ToDecimal(RouteData.Values["id1"].ToString()); } ViewBag.Operator_Type = _operator_type; } } catch (Exception ex) { Logger.LogException(ex); } return(View(@"~\Areas\Manager\Views\SearchManage\Search_Detail.cshtml")); }
public ActionResult Index_Search() { try { if (SessionData.CurrentUser == null) { return(Redirect("/")); } SessionData.CurrentUser.chashFile.Clear(); string AppCode = ""; if (RouteData.Values.ContainsKey("id")) { AppCode = RouteData.Values["id"].ToString().ToUpper(); } ViewBag.AppCode = AppCode; if (RouteData.Values.ContainsKey("id1")) { string _SearchCode = RouteData.Values["id1"].ToString().ToUpper(); ViewBag.SearchCode = _SearchCode; SearchObject_BL _searchBL = new SearchObject_BL(); List <SearchObject_Detail_Info> _ListDetail = new List <SearchObject_Detail_Info>(); SearchObject_Question_Info _QuestionInfo = new SearchObject_Question_Info(); List <AppClassDetailInfo> search_Class_Infos = new List <AppClassDetailInfo>(); SearchObject_Header_Info _HeaderInfo = _searchBL.SEARCH_HEADER_GETBY_CASECODE(_SearchCode, ref _ListDetail, ref _QuestionInfo, ref search_Class_Infos); ViewBag.Name = _HeaderInfo.Name; } return(PartialView("~/Areas/Patent/Views/Lao_PT/_Partial_Lao_PT_Insert.cshtml")); } catch (Exception ex) { Logger.LogException(ex); return(PartialView("~/Areas/Patent/Views/Lao_PT/_Partial_Lao_PT_Insert.cshtml")); } }
public ActionResult DoAdminConfirm(string p_case_code, decimal p_status, string p_note) { try { SearchObject_BL _con = new SearchObject_BL(); decimal _ck = _con.Admin_Update(p_case_code, p_status, p_note, AppsCommon.GetCurrentLang(), SessionData.CurrentUser.Username); // nếu thành công thì gửi email cho khách hàng if (_ck != -1 && p_status == (decimal)CommonSearch.Stt_DaPhanHoi) { // lấy thông tin search SearchObject_BL _searchBL = new SearchObject_BL(); List <SearchObject_Detail_Info> _ListDetail = new List <SearchObject_Detail_Info>(); SearchObject_Question_Info _QuestionInfo = new SearchObject_Question_Info(); List <AppClassDetailInfo> search_Class_Infos = new List <AppClassDetailInfo>(); SearchObject_Header_Info _HeaderInfo = _searchBL.SEARCH_HEADER_GETBY_CASECODE(p_case_code, ref _ListDetail, ref _QuestionInfo, ref search_Class_Infos); // lấy thông tin người dùng UserBL _UserBL = new UserBL(); UserInfo userInfo = _UserBL.GetUserByUsername(_HeaderInfo.CREATED_BY.Trim()); #region Bỏ đi vì đã có trong email //string _fileTemp = System.Web.HttpContext.Current.Server.MapPath("/Content/Report/Search Report.doc"); //if (_HeaderInfo.Customer_Country != Common.Common.Country_VietNam_Id) // _fileTemp = System.Web.HttpContext.Current.Server.MapPath("/Content/Report/Search Report_En.doc"); //DocumentModel document = DocumentModel.Load(_fileTemp); //// Fill export_header //string fileName = System.Web.HttpContext.Current.Server.MapPath("/Content/Export/" + "Search_report" + p_case_code.ToString() + ".pdf"); //document.MailMerge.FieldMerging += (sender, e) => //{ // if (e.IsValueFound) // { // if (e.FieldName == "Text") // ((Run)e.Inline).Text = e.Value.ToString(); // } //}; //string _search_type = ""; //if (_ListDetail.Count > 0) //{ // _search_type = _ListDetail[0].SEARCH_TYPE_NAME; //} //document.MailMerge.Execute(new { DateNo = DateTime.Now.ToString("dd-MM-yyyy") }); //document.MailMerge.Execute(new { Case_Name = _HeaderInfo.CASE_NAME }); //document.MailMerge.Execute(new { Client_Reference = _HeaderInfo.CLIENT_REFERENCE }); //document.MailMerge.Execute(new { Case_Code = _HeaderInfo.CASE_CODE }); //document.MailMerge.Execute(new { Applicant_Name = _HeaderInfo.Customer_Name }); //document.MailMerge.Execute(new { Customer_Country_Name = _HeaderInfo.Customer_Country_Name }); //document.MailMerge.Execute(new { Object = _HeaderInfo.Object_Search_Name }); //document.MailMerge.Execute(new { Result = _QuestionInfo.RESULT }); //document.MailMerge.Execute(new { Search_Type = _search_type }); //if (userInfo != null) //{ // document.MailMerge.Execute(new { Contact_Person = userInfo.Contact_Person }); // document.MailMerge.Execute(new { Address = userInfo.Address }); // document.MailMerge.Execute(new { FullName = userInfo.FullName }); //} //else //{ // document.MailMerge.Execute(new { Contact_Person = "" }); // document.MailMerge.Execute(new { Address = "" }); // document.MailMerge.Execute(new { FullName = "" }); //} //document.Save(fileName, SaveOptions.PdfDefault); //byte[] fileContents; //var options = SaveOptions.PdfDefault; //// Save document to DOCX format in byte array. //using (var stream = new MemoryStream()) //{ // document.Save(stream, options); // fileContents = stream.ToArray(); //} //Convert.ToBase64String(fileContents); #endregion string _emailTo = userInfo.Email; string _emailCC = ""; //string _emailCC = userInfo.Copyto; List <string> _LstAttachment = new List <string>(); //20190812 bỏ đi vì đã gửi trong email rồi //_LstAttachment.Add(fileName); if (_QuestionInfo.FILE_URL != null && _QuestionInfo.FILE_URL != "") { _LstAttachment.Add(System.Web.HttpContext.Current.Server.MapPath(_QuestionInfo.FILE_URL)); } if (_QuestionInfo.FILE_URL02 != null && _QuestionInfo.FILE_URL02 != "") { _LstAttachment.Add(System.Web.HttpContext.Current.Server.MapPath(_QuestionInfo.FILE_URL02)); } if (_HeaderInfo.Billing_Id > 0) { // lấy thông tin billing Billing_BL _Billing_BL = new Billing_BL(); Billing_Header_Info _Billing_Header_Info = _Billing_BL.Billing_GetBy_Id(_HeaderInfo.Billing_Id, AppsCommon.GetCurrentLang()); if (_Billing_Header_Info.Billing_Id > 0 && _Billing_Header_Info.Status == (decimal)CommonEnums.Billing_Status.Approved) { //_LstAttachment.Add(System.Web.HttpContext.Current.Server.MapPath(_HeaderInfo.Url_Billing)); // kết xuất thông tin string _mapPath_Report = Server.MapPath("~/Report/"); string _mapPath = Server.MapPath("~/"); string _fileName = AppsCommon.Export_Billing_Crytal_View(_Billing_Header_Info.Case_Code, _mapPath_Report, _mapPath); _LstAttachment.Add(System.Web.HttpContext.Current.Server.MapPath(_fileName)); } } string _content = _QuestionInfo.RESULT.Replace("\n", "<br><br>"); _content = AppsCommon.SetContentMailTemplate(_content, yourref: _QuestionInfo.CLIENT_REFERENCE, outref: p_case_code, dearname: userInfo.Username); Email_Info _Email_Info = new Email_Info { EmailFrom = EmailHelper.EmailOriginal.EMailFrom_Business, Pass = EmailHelper.EmailOriginal.PassWord_Business, Display_Name = EmailHelper.EmailOriginal.DisplayName_Business, EmailTo = _emailTo, EmailCC = _emailCC, Subject = "Search Report", Content = _content, LstAttachment = _LstAttachment, }; CommonFunction.AppsCommon.EnqueueSendEmail(_Email_Info); } return(Json(new { success = _ck })); } catch (Exception ex) { Logger.LogException(ex); return(Json(new { success = "-1" })); } }