public ActionResult TPA() { List <TPA> CategoryList = new List <TPA>(); Property p = new Property(); DataSet ds = new DataSet(); p.OnTable = "FetchTPA"; ds = dl.FetchTPA_sp(p); try { foreach (DataRow item in ds.Tables[0].Rows) { TPA m = new TPA(); m.TPAId = item["TPAId"].ToString(); m.TPAName = item["TPAName"].ToString(); m.AddedBy = item["AddedBy"].ToString(); m.IsActive = item["IsActive"].ToString(); CategoryList.Add(m); } ViewBag.CategoryList = CategoryList; } catch (Exception e) { } return(View()); }
/// <summary> /// Performs loading into AssemblyLoadContext.Default using LoadFromAssemblyName for TPA assemblies and LoadFromAssemblyPath for other dependecies. /// <para> /// Based on https://github.com/natemcmaster/DotNetCorePlugins/blob/8f5c28fa70f0869a1af2e2904536268f184e71de/src/Plugins/Loader/ManagedLoadContext.cs Load method, /// but avoided FileNotFoundException from LoadFromAssemblyName trying only load TPA assemblies that way. /// </para> /// </summary> /// <param name="managedLibrary">ManagedLibrary object containing assembly name and paths.</param> /// <param name="loadContext">ManagedAssemblyLoadContext object.</param> /// <returns>Returns loaded assembly.</returns> private Assembly LoadAssemblyInternal(ManagedLibrary managedLibrary, ManagedAssemblyLoadContext loadContext) { // To avoid FileNotFoundException for assemblies that are included in TPA - we load them using AssemblyLoadContext.Default.LoadFromAssemblyName. var assemblyFileName = Path.GetFileName(managedLibrary.AppLocalPath); if (TPA.ContainsAssembly(assemblyFileName)) { var defaultAssembly = AssemblyLoadContext.Default.LoadFromAssemblyName(managedLibrary.Name); if (defaultAssembly != null) { return(defaultAssembly); } } if (SearchForLibrary(managedLibrary, loadContext, out var path)) { return(AssemblyLoadContext.Default.LoadFromAssemblyPath(path)); } return(null); }
public ActionResult TPA(TPA c) { HttpCookie rxgoAdminCookie = Request.Cookies["rxgoAdmin"]; string AddedBy = rxgoAdminCookie.Values["Hid"]; c.AddedBy = AddedBy; try { if (dl.InsertTPA_Sp(c) > 0) { TempData["MSG"] = "Data Saved Successfully"; } } catch (Exception ex) { TempData["MSG"] = "Something went wrong."; return(Redirect("/Operation/TPA")); } TempData["MSG"] = "Data Saved Successfully."; return(Redirect("/Operation/TPA")); }
static void Main(string[] args) { decimal VDPA, TPA; TimeSpan DiasTans; DateTime FechaI, FechaD; Console.WriteLine("Ingrese la fecha de inicio:"); FechaI = Convert.ToDateTime(Console.ReadLine()); Console.WriteLine("Ingrese la fecha de devolución:"); FechaD = Convert.ToDateTime(Console.ReadLine()); Console.WriteLine("Ingrese el valor a pagar por dia:"); Console.Write("$"); VDPA = Convert.ToDecimal(Console.ReadLine()); DiasTans = FechaD - FechaI; string Dias = DiasTans.Days.ToString(); decimal TDias = Convert.ToDecimal(Dias); TPA = TDias * VDPA; Console.WriteLine("Los dias transcurrridos son :" + Dias); Console.WriteLine("El total a cancelar por su alquiler es: {0}", TPA.ToString("C2")); Console.ReadKey(); }
/// <summary> /// Initializes a new instance of the <see cref="PlayerBoxScore" /> class. /// </summary> /// <param name="dict">The dictionary containing the player box score.</param> /// <param name="playerID">The player ID.</param> /// <param name="teamID">The team.</param> /// <param name="playerName">The player's name.</param> public PlayerBoxScore(Dictionary <string, string> dict, int playerID, int teamID, string playerName = "") { PlayerID = playerID; Name = playerName; TeamID = teamID; IsStarter = IsStarter.TrySetValue(dict, "Starter", typeof(bool)); PlayedInjured = PlayedInjured.TrySetValue(dict, "Injured", typeof(bool)); IsOut = IsOut.TrySetValue(dict, "DNP", typeof(bool)); MINS = MINS.TrySetValue(dict, "MINS", typeof(UInt16)); PTS = PTS.TrySetValue(dict, "PTS", typeof(UInt16)); REB = REB.TrySetValue(dict, "REB", typeof(UInt16)); AST = AST.TrySetValue(dict, "AST", typeof(UInt16)); STL = STL.TrySetValue(dict, "STL", typeof(UInt16)); BLK = BLK.TrySetValue(dict, "BLK", typeof(UInt16)); TOS = TOS.TrySetValue(dict, "TO", typeof(UInt16)); FGM = FGM.TrySetValue(dict, "FGM", typeof(UInt16)); FGA = FGA.TrySetValue(dict, "FGA", typeof(UInt16)); TPM = TPM.TrySetValue(dict, "3PM", typeof(UInt16)); TPA = TPA.TrySetValue(dict, "3PA", typeof(UInt16)); FTM = FTM.TrySetValue(dict, "FTM", typeof(UInt16)); FTA = FTA.TrySetValue(dict, "FTA", typeof(UInt16)); OREB = OREB.TrySetValue(dict, "OREB", typeof(UInt16)); FOUL = FOUL.TrySetValue(dict, "FOUL", typeof(UInt16)); }
private void CopyAssemblies(string sourceParentPath, string targetDirectoryPath) { if (sourceParentPath != null) { var sourceDirectoryPath = Path.Combine(sourceParentPath, "bin"); if (Directory.Exists(sourceDirectoryPath)) { foreach (var sourceFilePath in Directory.EnumerateFiles(sourceDirectoryPath, "*.*", SearchOption.AllDirectories)) { // Copy all assembly related files except assemblies that are inlcuded in TPA list if (IsAssemblyRelatedFile(sourceFilePath) && !(IsAssemblyFile(sourceFilePath) && TPA.ContainsAssembly(Path.GetFileName(sourceFilePath)))) { // Copy localization resource files to related subfolders var targetFilePath = Path.Combine( IsLocalizationFile(sourceFilePath) ? Path.Combine(targetDirectoryPath, Path.GetFileName(Path.GetDirectoryName(sourceFilePath))) : targetDirectoryPath, Path.GetFileName(sourceFilePath)); CopyFile(sourceFilePath, targetFilePath); } } } } }