public ShipManual GetManual(string controllerName, string actionName) { ShipManual file = new ShipManual(); using (SqlConnection con = new SqlConnection(connectionString)) { using (SqlCommand cmd = new SqlCommand("GetShipManualByControllerAction", con)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ControllerName", controllerName); cmd.Parameters.AddWithValue("@ActionName", actionName); con.Open(); DataSet ds = new DataSet(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds); file.Id = Convert.ToInt32(ds.Tables[0].Rows[0]["Id"]); file.Name = Convert.ToString(ds.Tables[0].Rows[0]["Name"]); file.Content = Convert.ToString(ds.Tables[0].Rows[0]["Content"]); file.BodyHeader = Convert.ToString(ds.Tables[0].Rows[0]["BodyHeader"]); file.BodyText = Convert.ToString(ds.Tables[0].Rows[0]["BodyText"]); file.BodyHtml = Convert.ToString(ds.Tables[0].Rows[0]["BodyHtml"]); file.ActionName = Convert.ToString(ds.Tables[0].Rows[0]["ActionName"]); file.ControllerName = Convert.ToString(ds.Tables[0].Rows[0]["ControllerName"]); con.Close(); } } return(file); }
public ActionResult Pages(string actionName) { ShipManual file = new ShipManual(); file = manualBL.GetReferenceMaterialManual(controllerName, actionName); TempData[actionName] = file.BodyHtml; return(View(file)); }
public ShipManual GetManual(string controllerName, string actionName) { ShipManual file = new ShipManual(); ShipDAL shipDAL = new ShipDAL(); file = shipDAL.GetManual(controllerName, actionName); return(file); }
public ActionResult VGP() { ManualBL manualBL = new ManualBL(); ShipManual file = new ShipManual(); string xPath = Server.MapPath(xmlPath); file.BodyHtml = manualBL.GenerateShipWiseFolderBodyContentHtml(xPath, shipId, "VGP"); return(View(file)); }
public ActionResult Circulars() { ManualBL manualBL = new ManualBL(); ShipManual file = new ShipManual(); string xPath = Server.MapPath(xmlPath); file.BodyHtml = manualBL.GenerateNoticeBoardFolderBodyContentHtml(xPath, "Circulars"); return(View(file)); }
public ActionResult SEEMP2() { Session["IsSearched"] = "0"; ManualBL manualBL = new ManualBL(); ShipManual file = new ShipManual(); string xPath = Server.MapPath(xmlPath); file.BodyHtml = manualBL.GenerateShipWiseFolderBodyContentHtml(xPath, shipId, "SEEMP2"); return(View(file)); }
public ActionResult Manning() { Session["IsSearched"] = "0"; ManualBL manualBL = new ManualBL(); ShipManual file = new ShipManual(); string xPath = Server.MapPath(xmlPath); file.BodyHtml = manualBL.GenerateC2AFolderBodyContentHtml(xPath, "Manning"); return(View(file)); }
public ActionResult Index() { ManualBL manualBL = new ManualBL(); ShipManual file = new ShipManual(); //string xPath = Server.MapPath("~/xmlMenu/" + "ALLSHIPS.xml"); string xPath = Server.MapPath(xmlPath); file.BodyHtml = manualBL.GenerateBodyContentHtml(xPath, shipId); return(View(file)); }
public ActionResult PDFViewer(string fileName, string relPDFPath) { ShipManual file = new ShipManual(); //string filePath = "../ManualsPDF/Volume I/"; string filePath = "../ShipManualsPDF/" + relPDFPath + "/"; // filePath = filePath + fileName + ".pdf#toolbar=0&zoom=137";//----#zoom=85&scrollbar=0&toolbar=0&navpanes=0 filePath = filePath + fileName + ".pdf#zoom=137"; file.PdfName = fileName; file.PdfPath = filePath; return(View(file)); }
public ActionResult Pages(string actionName, string formName = "", string relformPath = "") { System.Web.HttpContext.Current.Session["ManualFileActionName"] = actionName;// this session used in Breadcrumb Navigation ShipManual file = new ShipManual(); if (formName == "") { file = shipBL.GetManual(controllerName, actionName); } else { string filePath = "../ShipManualsPDF/" + relformPath + "/"; filePath = filePath + formName + ".pdf#toolbar=0"; file.PdfName = formName; file.PdfPath = filePath; StringBuilder sb = new StringBuilder("<div><div style = 'height: 800px; overflow: scroll;' >"); sb.Append(file.BodyHtml); sb.Append("</div>"); sb.Append("<div class='col-sm-12.><div class='row'><div class='col-sm-6'><a href='/" + controllerName + "/Download?fileName="); sb.Append(formName + "&relformPath=" + relformPath + "' class='btn btn-info btn-sm' style='background-color: #e90000;' >Download</a></div></div></div>"); sb.Append("</div>"); //------------------------------------------------------------------------- StringBuilder sb2 = new StringBuilder("<div class='row'>"); sb2.Append("<div class='col-sm-12 col-xs-12 marginTP10'>"); sb2.Append("<div class='card'>"); sb2.Append("<div class='col-sm-12 col-xs-12'>"); sb2.Append("<div class='row'>"); //------ sb2.Append("<p class='marginTP10'>"); sb2.Append("<div class='col-sm-10 col-xs-12'>"); sb2.Append("<label>" + formName + "</label>"); sb2.Append("</div>"); sb2.Append("<div class='col-sm-2 col-xs-12'>"); sb2.Append("<button type='button' class='btn btn-info btn-sm' style='background-color: #e90000;' data-toggle='modal' data-target='#formPreviewModal' >Preview</button>"); //sb2.Append("</div>"); //sb2.Append("<div class='col-sm-2 col-xs-12'>"); sb2.Append("<a href='/" + controllerName + "/Download?fileName="); sb2.Append(formName + "&relformPath=" + relformPath + "' class='btn btn-info btn-sm' style='background-color: #e90000;' >Download</a>"); sb2.Append("</div>"); sb2.Append("</p>"); //------- sb2.Append("\n"); sb2.Append("</div>"); sb2.Append("\n"); sb2.Append("</div>"); sb2.Append("\n"); sb2.Append("</div>"); sb2.Append("\n"); sb2.Append("</div>"); sb2.Append("\n"); sb2.Append("</div>"); //file.ManualBodyHtml = sb.ToString(); file.BodyHtml = sb2.ToString(); } //TempData[actionName] = file.ManualBodyHtml; return(View(file)); }