public int CreateOrUpdate(WebLinkModel model) { string msgError = ""; try { var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "WEBLINK_INSERT_OR_UPDATE", "@id", model.Id, "@link_code", model.Link_Code, "@link_name", model.Link_Name, "@description", model.Description, "@active", model.Active); if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError)) { throw new Exception(Convert.ToString(result) + msgError); } else { return(Constant.ReturnExcuteFunction.Success); } } catch (Exception ex) { throw ex; } }
public async Task <IActionResult> Delete(RequestDataModel request) { var settings = new JsonSerializerSettings(); var searchObject = new WebLinkModel { }; settings.DateFormatString = "dd/MM/yyyy"; searchObject = JsonConvert.DeserializeObject <WebLinkModel>(request.model, settings); var weblink = new WebLinkModel(); weblink = searchObject; weblink.LastModifyDate = DateTime.Now; var hostAPI = "https://localhost:44322"; var rs = await ApiProvider.PostAsync <int>(hostAPI, ApiConstant.DeleteWebLink, weblink); if (rs == Constant.ReturnExcuteFunction.Success) { return(Json(new { messege = "Thành công !" })); } else { return(Json(new { messege = "Thất bại!" })); } }
public async Task <IActionResult> GetByID(RequestDataModel request) { var settings = new JsonSerializerSettings(); var searchObject = new WebLinkModel { }; settings.DateFormatString = "dd/MM/yyyy"; searchObject = JsonConvert.DeserializeObject <WebLinkModel>(request.model, settings); var weblink = new WebLinkModel(); weblink = searchObject; weblink.LastModifyDate = DateTime.Now; var hostAPI = "https://localhost:44322"; var rs = await ApiProvider.PostAsync <WebLinkModel>(hostAPI, ApiConstant.GetWebLinkId, weblink); return(Json(rs)); }
public int Delete(WebLinkModel model) { string msgError = ""; try { var result = _dbHelper.ExecuteScalarSProcedureWithTransaction(out msgError, "sp_weblink_delete", "@id", model.Id); if ((result != null && !string.IsNullOrEmpty(result.ToString())) || !string.IsNullOrEmpty(msgError)) { throw new Exception(Convert.ToString(result) + msgError); } else { return(Constant.ReturnExcuteFunction.Success); } } catch (Exception ex) { throw ex; } }
public async Task <IActionResult> GetData(RequestDataModel request) { var webLinkModelParamater = new WebLinkModelParameter(); var settings = new JsonSerializerSettings(); var searchObject = new WebLinkModel { }; settings.DateFormatString = "dd/MM/yyyy"; searchObject = JsonConvert.DeserializeObject <WebLinkModel>(request.model, settings); var page = new PageParameter { PageIndex = request.start, PageSize = request.length }; webLinkModelParamater.Page = page; webLinkModelParamater.Data = searchObject; var hostAPI = "https://localhost:44322"; var data = await ApiProvider.PostAsync <WebLinkReturnModel>(hostAPI, ApiConstant.GetAllWebLink, webLinkModelParamater); return(Json(data)); }
public int Delete([FromBody] WebLinkModel model) { return(_bus.Delete(model)); }
public int CreateOrUpdate([FromBody] WebLinkModel model) { return(_bus.CreateOrUpdate(model)); }
public WebLinkModel GetDataID([FromBody] WebLinkModel model) { return(_bus.GetDataID(model.Id)); }
public int Delete(WebLinkModel model) { return(_res.Delete(model)); }
public int CreateOrUpdate(WebLinkModel model) { return(_res.CreateOrUpdate(model)); }
public ActionResult Index() { StringBuilder sb = new StringBuilder(); string user = (string)System.Web.HttpContext.Current.Session["userName"]; if (user != "Unknown User") { sb.AppendLine("<h4>" + user + "<small>, Welcome Back! "); if (browserIssue()) { sb.AppendLine("If you <font color='#ff6666'>experience problems</font> see the <a href='" + @Url.Action("Info", "Home") + "'>site info</a> page.</small></h4>"); } else { sb.AppendLine("</small></h4>"); } ViewBag.User = sb; } else { sb.AppendLine("<h5>To see content expand one of the categories and click a link. "); if (browserIssue()) { sb.AppendLine("If you <font color='#ff6666'>experience problems</font> see the <a href='" + @Url.Action("Info", "Home") + "'>site info</a> page.</h5>"); } else { sb.AppendLine("</h5>"); } ViewBag.User = sb; } List <webLink> web_Link = new List <webLink>(); List <topLink> top_Link = new List <topLink>(); var myLinks = from l in db.WebLinks orderby l.Name where l.VisibleFlag == true select l; foreach (var L in myLinks) { web_Link.Add(new webLink { category = L.WebCategoryID, link = L.Name, linkPath = L.WebLink }); } var myTopLinks = from T in db.Activity_spMyTopWebLinks((string)System.Web.HttpContext.Current.Session["userPin"]) select T; foreach (var T in myTopLinks) { top_Link.Add(new topLink { toplink = T.TopLink.Trim(), toplinkpath = T.TopLinkPath.Trim() }); } WebLinkModel finalItem = new WebLinkModel(); finalItem.WebLinks = web_Link; finalItem.TopLinks = top_Link; return(View(finalItem)); //TopLinkManager link = new TopLinkManager(); //List<topLink> myLinks = link.GetTopLinks((string)System.Web.HttpContext.Current.Session["userPin"]); //ViewData["myLinks"] = link.GetTopLinks((string)System.Web.HttpContext.Current.Session["userPin"]); //List<WebLinks> siaWebLinks = db.WebLinks.Where(s => s.VisibleFlag).ToList(); //return View(siaWebLinks); }