text
stringlengths
13
6.01M
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace TacticalMaddiAdminTool.Models { public class CollectionInfo : IXmlItem { public string Title { get { return ColectionKey; } } public string ColectionKey { get; set; } public string GetXml() { return String.Format( @"<Collection Key='{0}'> <Fragment Key='a1/b1/c1/d1' /> <Fragment Key='a1/b1/c1/d1' /> </Collection>", ColectionKey); } } }
using Microsoft.AspNetCore.Mvc; namespace Senai.Sistema.Carfel.ProjetoFinalDezoito.Controllers { public class MainController : Controller { [HttpGet] public IActionResult About () { // ViewBag.UsuarioNome = HttpContext.Session.GetString ("UsuarioNome"); // ViewBag.Tipo = HttpContext.Session.GetString ("Tipo"); return View (); } public IActionResult Faq () { return View (); } public IActionResult Formulario () { return View (); } public IActionResult Principal () { return View (); } } }
using ArcGIS.Core.CIM; using ArcGIS.Desktop.Framework; using ArcGIS.Desktop.Mapping; using System.ComponentModel; using System.Windows; namespace LiquidsHCAAddIn { /// <summary> /// Interaction logic for IdentityConfigWindow.xaml /// </summary> public partial class IdentityConfigWindow : ArcGIS.Desktop.Framework.Controls.ProWindow { protected static string ospointlyrname = ""; public static ProWindowConfig promdl; public IdentityConfigWindow() { InitializeComponent(); promdl = new ProWindowConfig(); var fls = MapView.Active.Map.GetLayersAsFlattenedList();// .GetLayersAsFlattenedList().First() as FeatureLayer; foreach (Layer l in fls) { if (l.GetType().Name == "FeatureLayer") { if ((l as FeatureLayer).ShapeType == esriGeometryType.esriGeometryPoint) if (l.Name.ToUpper().Contains("POINT")) cmbOSPoint.Items.Add(l.Name); else cmbNHDIntlyr.Items.Add(l.Name); else if ((l as FeatureLayer).ShapeType == esriGeometryType.esriGeometryPolyline) cmbHTPathlyr.Items.Add(l.Name); else if ((l as FeatureLayer).ShapeType == esriGeometryType.esriGeometryPolygon) cmbHTSpreadlyr.Items.Add(l.Name); } else if (l.GetType().Name == "MosaicLayer") cmbLSlyr.Items.Add(l.Name); } if (promdl is null) { promdl = new ProWindowConfig(); if (cmbOSPoint.Items.Contains("OSPOINTM")) { cmbOSPoint.SelectedItem = "OSPOINTM"; } if (cmbNHDIntlyr.Items.Contains("NHD_Intersection")) { cmbNHDIntlyr.SelectedItem = "NHD_Intersection"; } if (cmbHTPathlyr.Items.Contains("HydrographicTransportPaths")) { cmbHTPathlyr.SelectedItem = "HydrographicTransportPaths"; } if (cmbHTSpreadlyr.Items.Contains("WaterbodySpreadPolygons")) { cmbHTSpreadlyr.SelectedItem = "WaterbodySpreadPolygons"; } if (cmbLSlyr.Items.Contains("MultiDimRasterMosaic")) { cmbLSlyr.SelectedItem = "MultiDimRasterMosaic"; } } else { if (!string.IsNullOrEmpty(promdl.OSPointName)) { cmbOSPoint.SelectedItem = promdl.OSPointName; } else { cmbOSPoint.SelectedItem = "OSPOINTM"; } if (!string.IsNullOrEmpty(promdl.NHDIntName)) { cmbNHDIntlyr.SelectedItem = promdl.NHDIntName; } else { cmbNHDIntlyr.SelectedItem = "NHD_Intersection"; } if (!string.IsNullOrEmpty(promdl.HTPathName)) { cmbHTPathlyr.SelectedItem = promdl.HTPathName; } else { cmbHTPathlyr.SelectedItem = "HydrographicTransportPaths"; } if (!string.IsNullOrEmpty(promdl.HTSpreadName)) { cmbHTSpreadlyr.SelectedItem = promdl.HTSpreadName; } else { cmbHTSpreadlyr.SelectedItem = "WaterbodySpreadPolygons"; } if (!string.IsNullOrEmpty(promdl.LSName)) { cmbLSlyr.SelectedItem = promdl.LSName; } else { cmbLSlyr.SelectedItem = "MultiDimRasterMosaic"; } } } private ProWindowConfig _configDetails; public ProWindowConfig ConfigDetails { get { return _configDetails; } set { _configDetails = ConfigDetails; } } private void btnConfigure_Click(object sender, RoutedEventArgs e) { promdl.OSPointName = cmbOSPoint.Text; promdl.NHDIntName = cmbNHDIntlyr.Text; promdl.HTPathName = cmbHTPathlyr.Text; promdl.HTSpreadName = cmbHTSpreadlyr.Text; promdl.LSName = cmbLSlyr.Text; ConfigDetails = promdl; this.Close(); FrameworkApplication.SetCurrentToolAsync(null); } private void ConfigWindow_Closing(object sender, CancelEventArgs e) { FrameworkApplication.SetCurrentToolAsync(null); } } public class ProWindowConfig { public string OSPointName { get; set; } public string LSName { get; set; } public string NHDIntName { get; set; } public string HTPathName { get; set; } public string HTSpreadName { get; set; } } }
using UnityEngine; using System.Collections.Generic; public class GameOfLifeBehaviour : MonoBehaviour { [SerializeField] [Range(20, 70)] private int MapWidth = 30; [SerializeField] [Range(20, 70)] private int MapHeight = 30; [SerializeField] private GameObject TilePrefab; [SerializeField] private float GenerationDelay = 1.2f; [SerializeField] private int solitude; [SerializeField] private int overPopulation; [SerializeField] private int revive; private Tile[,] map; private float timer = 0; private bool isRunning; private List<Tile> selected = new List<Tile>(); void Start() { this.map = new Tile[MapWidth, MapHeight]; initMap(); } void Update() { if (isRunning) { timer += Time.deltaTime; if (timer >= GenerationDelay) { timer = 0; processGenerations(); } } else { selectTiles(); } } private void initMap() { setupMap(); setNeighbors(); buildMap(); } private void setupMap() { for (int x = 0; x < MapWidth; x++) { for (int y = 0; y < MapHeight; y++) { this.map[x, y] = new Tile(x, y, CellState.Dead); } } } private void setNeighbors() { for (int y = 0; y < MapHeight; y++) { for (int x = 0; x < MapWidth; x++) { Tile temp = this.map[x, y]; for (int yOffset = -1; yOffset < 2; yOffset++) { for (int xOffset = -1; xOffset < 2; xOffset++) { if (!(xOffset == 0 && yOffset == 0)) { int xPos = x + xOffset; int yPos = y + yOffset; if (xPos < 0) { xPos += MapWidth; } else { xPos %= MapWidth; } if (yPos < 0) { yPos += MapHeight; } else { yPos %= MapHeight; } if (map[xPos, yPos] != null) { temp.Neighbors.Add(map[xPos, yPos]); } } } } } } } private void buildMap() { foreach (var cell in map) { if (cell != null) { Vector3 instantiatePos = new Vector3(cell.Position.x, 0, cell.Position.y); cell.TileObject = (GameObject)Instantiate(TilePrefab, instantiatePos, Quaternion.identity); cell.TileObject.GetComponent<Transform>().SetParent(this.gameObject.GetComponent<Transform>()); } } } private void processGenerations() { foreach (var cell in map) { if (cell != null) { int aliveCells = cell.GetAliveCells(); if (cell.CurrentState == CellState.Alive) { if (aliveCells < solitude) { cell.NextState = CellState.Dead; } if (aliveCells > overPopulation) { cell.NextState = CellState.Dead; } } else { if (aliveCells == revive) { cell.NextState = CellState.Alive; } } } } foreach (var cell in map) { if (cell != null) { cell.CurrentState = cell.NextState; switch (cell.CurrentState) { case CellState.Alive: cell.TileObject.GetComponent<Renderer>().material.color = Color.black; break; case CellState.Dead: cell.TileObject.GetComponent<Renderer>().material.color = Color.white; break; default: break; } } } } private void selectTiles() { if (Input.GetMouseButton(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit rayHit; if (Physics.Raycast(ray, out rayHit)) { if (rayHit.collider.gameObject.tag == TilePrefab.tag) { Vector3 pos = rayHit.collider.gameObject.GetComponent<Transform>().position; Tile temp = map[(int)pos.x, (int)pos.z]; if (!selected.Contains(temp)) { selected.Add(temp); } } } } if (Input.GetMouseButtonUp(0)) { if (selected.Count > 0) { foreach (var cell in selected) { switch (cell.CurrentState) { case CellState.Alive: cell.CurrentState = CellState.Dead; cell.NextState = CellState.Dead; cell.TileObject.GetComponent<Renderer>().material.color = Color.white; break; case CellState.Dead: cell.CurrentState = CellState.Alive; cell.NextState = CellState.Alive; cell.TileObject.GetComponent<Renderer>().material.color = Color.black; break; default: break; } } selected.Clear(); } } } public void ToggleRunning() { isRunning = !isRunning; } }
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace MISA_Cukcuk_WebAPI.Extensions { public class ValidateExceptions:Exception { public ValidateExceptions(string msg) : base(msg) { } public ValidateExceptions(string msg, string[] arrayMsg) : base(msg, new Exception()) { } } }
namespace Hearthbuddy.Controls { using System; using System.IO; using System.Text; using System.Windows.Forms; public class FileFolderDialog : CommonDialog { private OpenFileDialog openFileDialog_0 = new OpenFileDialog(); public override void Reset() { this.openFileDialog_0.Reset(); } protected override bool RunDialog(IntPtr hwndOwner) { return true; } public DialogResult ShowDialog() { return this.ShowDialog(null); } public DialogResult ShowDialog(IWin32Window owner) { this.openFileDialog_0.ValidateNames = false; this.openFileDialog_0.CheckFileExists = false; this.openFileDialog_0.CheckPathExists = true; try { if (!string.IsNullOrEmpty(this.openFileDialog_0.FileName)) { if (Directory.Exists(this.openFileDialog_0.FileName)) { this.openFileDialog_0.InitialDirectory = this.openFileDialog_0.FileName; } else { this.openFileDialog_0.InitialDirectory = Path.GetDirectoryName(this.openFileDialog_0.FileName); } } } catch (Exception) { } this.openFileDialog_0.FileName = "Folder Selection."; if (owner == null) { return this.openFileDialog_0.ShowDialog(); } return this.openFileDialog_0.ShowDialog(owner); } public OpenFileDialog Dialog { get { return this.openFileDialog_0; } set { this.openFileDialog_0 = value; } } public string SelectedPath { get { try { if (((this.openFileDialog_0.FileName != null) && (this.openFileDialog_0.FileName.EndsWith("Folder Selection.") || !File.Exists(this.openFileDialog_0.FileName))) && !Directory.Exists(this.openFileDialog_0.FileName)) { return Path.GetDirectoryName(this.openFileDialog_0.FileName); } return this.openFileDialog_0.FileName; } catch (Exception) { return this.openFileDialog_0.FileName; } } set { if (!string.IsNullOrEmpty(value)) { this.openFileDialog_0.FileName = value; } } } public string SelectedPaths { get { if ((this.openFileDialog_0.FileNames == null) || (this.openFileDialog_0.FileNames.Length <= 1)) { return null; } StringBuilder builder = new StringBuilder(); foreach (string str in this.openFileDialog_0.FileNames) { try { if (File.Exists(str)) { builder.Append(str + ";"); } } catch { } } return builder.ToString(); } } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Windows.Forms; using System.Threading; using MySql.Data.MySqlClient; using Newtonsoft.Json; using Newtonsoft.Json.Linq; namespace HO偏差 { public partial class FormBuildTestDataSpecifiedPoint : Form { public FormBuildTestDataSpecifiedPoint() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { this.button1.Enabled = false; Thread t = new Thread(delegate() { this.handle(); this.Invoke(new MethodInvoker(delegate() { this.button1.Enabled = true; })); }); t.IsBackground = true; t.Start(); } private static DateTime UNIXTIME_BASE = new DateTime(1970, 1, 1, 8, 0, 0); private long ToUnixTime(DateTime time) { return (long)time.Subtract(UNIXTIME_BASE).TotalMilliseconds; } private MySqlDataReader TryGetReader(MySqlCommand cmd) { DateTime st = DateTime.Now; Exception lastEx = null; for (int i = 0; i < 3; i++) { try { if (cmd.Connection.State == ConnectionState.Closed) cmd.Connection.Open(); MySqlDataReader dr = cmd.ExecuteReader(); using (System.IO.FileStream fs = new System.IO.FileStream("db.time.log", System.IO.FileMode.Append)) { using (System.IO.StreamWriter sw = new System.IO.StreamWriter(fs)) { double ts = DateTime.Now.Subtract(st).TotalMilliseconds; if (ts > 5000) { StringBuilder sb = new StringBuilder(); foreach (MySqlParameter p in cmd.Parameters) { sb.Append(string.Format("{0}:{1}\r\n", p.ParameterName, p.Value)); } sw.WriteLine("{0:yyyy-MM-dd HH:mm:ss} > consume time:{1,6:0}ms, failed times:{2}\r\nsql:\r\n{3}\r\nparams:\r\n{4}", DateTime.Now, ts, i, cmd.CommandText, sb.ToString()); } else { sw.WriteLine("{0:yyyy-MM-dd HH:mm:ss} > consume time:{1,6:0}ms", DateTime.Now, ts); } } } return dr; } catch (Exception ex) { lastEx = ex; } if (i < 9) { Thread.Sleep(10000); } } throw new Exception("Try get reader failed 10 times", lastEx); } private bool TryRead(MySqlDataReader dr) { Exception lastEx = null; for (int i = 0; i < 10; i++) { try { return dr.Read(); } catch (Exception ex) { lastEx = ex; } if (i<9) { Thread.Sleep(10000); } } throw new Exception("Try read data failed 10 times", lastEx); } private string getRawInfoByAPI(string type, string id) { System.Net.WebClient wc = new System.Net.WebClient(); using (System.IO.Stream s = wc.OpenRead(string.Format("http://120.24.210.35:3000/data/market/{0}?record_id={1}", type, id))) { using (System.IO.StreamReader sr = new System.IO.StreamReader(s)) { JObject jo = (JObject)JsonConvert.DeserializeObject(sr.ReadToEnd()); if ((string)jo["STS"] == "OK") { return (string)jo["data"]; } else { return null; } } } } private void handle() { using (MySqlConnection conn = new MySqlConnection("server=120.24.210.35;user id=hrsdata;password=abcd0000;database=hrsdata;port=3306;charset=utf8")) { conn.Open(); using (MySqlCommand cmd = new MySqlCommand(@" SELECT a.*, b.`id` card_id FROM ct_race a INNER JOIN ct_card b ON b.`tournament_id` = a.`tournament_id` AND b.`tote_type` = 'HK' WHERE a.time_text IS NOT NULL AND a.race_loc = 3 and a.id >= 699540 LIMIT 10 ", conn)) { using (MySqlDataAdapter da = new MySqlDataAdapter(cmd)) { using (DataTable table = new DataTable()) { da.Fill(table); List<RaceData> data = new List<RaceData>(); #region 建立时间点并获取Tote foreach (DataRow row in table.Rows) { string date_str = (string)row["race_date"]; string time_str = (string)row["time_text"]; Match md = Regex.Match(date_str, @"^(\d{2})-(\d{2})-(\d{4})$"); // Match mt = Regex.Match(time_str, @"^(\d{2})\:(\d{2})(pm|am)$"); if (md.Success) { RaceData race = new RaceData(); race.StartTime = DateTime.Parse(string.Format("{0}-{1}-{2} {3}", md.Groups[3].Value, md.Groups[2].Value, md.Groups[1].Value, //mt.Groups[3].Value == "pm" ? int.Parse(mt.Groups[1].Value) + 12 : int.Parse(mt.Groups[1].Value), //mt.Groups[2].Value time_str)); race.CardID = (ulong)row["card_id"]; race.RaceNo = (int)row["race_no"]; data.Add(race); // 从开始时间往前推,每5分钟一个点,直到开赛前55分钟共12个点 // 每个点前后2.5分钟区间,取最靠近的数据 // 如果WP_TOTE/QN_TOTE/WP_BET_DISCOUNT/WP_EAT_DISCOUNT/QN_BET_DISCOUNT/QN_EAT_DISCOUNT/QP_BET_DISCOUNT/QP_EAT_DISCOUNT任意一项没有数据,则丢弃该时间点 // 建立时间点 long start_time_key = ToUnixTime(race.StartTime); for (int i = 0; i < 12; i++) { race.Add(start_time_key - i * 5 * 60 * 1000, new RaceDataItem()); } foreach (long tp in race.Keys.ToArray()) { using (MySqlCommand cmd2 = new MySqlCommand("select * from ct_raw_wp_tote where rc_id = ?rc_id and cd_id = ?cd_id and record_time between ?tb and ?te order by abs(record_time-?tp) limit 1", conn)) { cmd2.CommandTimeout = 120000; cmd2.Parameters.AddWithValue("?rc_id", row["id"]); cmd2.Parameters.AddWithValue("?cd_id", row["card_id"]); cmd2.Parameters.AddWithValue("?tb", tp - 150 * 1000); cmd2.Parameters.AddWithValue("?te", tp + 150 * 1000); cmd2.Parameters.AddWithValue("?tp", tp); using (MySqlDataReader dr = this.TryGetReader(cmd2)) { if (this.TryRead(dr)) { RaceDataItem item = race[tp]; string rawInfo; if (!object.Equals(dr["raw_info"], DBNull.Value)) { rawInfo = (string)dr["raw_info"]; } else { rawInfo = this.getRawInfoByAPI("get_tote_wp_raw_info", dr["id"].ToString()); } if (rawInfo != null) { JArray ja = (JArray)JsonConvert.DeserializeObject(rawInfo); foreach (JObject jo in ja) { double win = (double)jo["win"]; double plc = (double)jo["plc"]; if (win != 0 && plc != 0) { item.Odds.Add(new Hrs(jo["horseNo"].ToString(), win, plc)); } } } else { race.Remove(tp); continue; } } else { race.Remove(tp); continue; } } } using (MySqlCommand cmd2 = new MySqlCommand("select * from ct_raw_qn_tote where rc_id = ?rc_id and cd_id = ?cd_id and record_time between ?tb and ?te order by abs(record_time-?tp) limit 1", conn)) { cmd2.CommandTimeout = 120000; cmd2.Parameters.AddWithValue("?rc_id", row["id"]); cmd2.Parameters.AddWithValue("?cd_id", row["card_id"]); cmd2.Parameters.AddWithValue("?tb", tp - 150 * 1000); cmd2.Parameters.AddWithValue("?te", tp + 150 * 1000); cmd2.Parameters.AddWithValue("?tp", tp); using (MySqlDataReader dr = this.TryGetReader(cmd2)) { if (this.TryRead(dr)) { RaceDataItem item = race[tp]; string rawInfo; if (!object.Equals(dr["raw_info"], DBNull.Value)) { rawInfo = (string)dr["raw_info"]; } else { rawInfo = this.getRawInfoByAPI("get_tote_qn_raw_info", dr["id"].ToString()); } if (rawInfo != null) { JObject jo = (JObject)JsonConvert.DeserializeObject(rawInfo); this.parseQnTote((string)jo["text_q"], item.Odds.SpQ); this.parseQnTote((string)jo["text_qp"], item.Odds.SpQp); } else { race.Remove(tp); continue; } } else { race.Remove(tp); continue; } } } } } } #endregion #region 获取Discount foreach (ulong cardId in data.Where(x => x.Count > 0).Select(x => x.CardID).Distinct().ToArray()) { foreach (long tp in data.Where(x => x.CardID == cardId).SelectMany(x => x.Keys).Distinct().ToArray()) { Dictionary<int, RaceDataItem> items = new Dictionary<int, RaceDataItem>(); foreach (RaceData race in data.Where(x => x.CardID == cardId)) { if (race.ContainsKey(tp)) { items.Add(race.RaceNo, race[tp]); } } using (MySqlCommand cmd2 = new MySqlCommand("select * from ct_raw_wp_discount where cd_id = ?cd_id and direction = ?d and record_time between ?tb and ?te order by abs(record_time-?tp) limit 1", conn)) { cmd2.CommandTimeout = 120000; cmd2.Parameters.AddWithValue("?cd_id", cardId); cmd2.Parameters.AddWithValue("?tb", tp - 150 * 1000); cmd2.Parameters.AddWithValue("?te", tp + 150 * 1000); cmd2.Parameters.AddWithValue("?tp", tp); MySqlParameter pD = cmd2.Parameters.Add("?d", MySqlDbType.Byte); pD.Value = 0; using (MySqlDataReader dr = this.TryGetReader(cmd2)) { if (this.TryRead(dr)) { string rawInfo; if (!object.Equals(dr["raw_info"], DBNull.Value)) { rawInfo = (string)dr["raw_info"]; } else { rawInfo = this.getRawInfoByAPI("get_discount_wp_raw_info", dr["id"].ToString()); } if (rawInfo != null) { this.parseWpDiscount(rawInfo, items, dr["direction"].ToString()); } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } pD.Value = 1; using (MySqlDataReader dr = this.TryGetReader(cmd2)) { if (this.TryRead(dr)) { string rawInfo; if (!object.Equals(dr["raw_info"], DBNull.Value)) { rawInfo = (string)dr["raw_info"]; } else { rawInfo = this.getRawInfoByAPI("get_discount_wp_raw_info", dr["id"].ToString()); } if (rawInfo != null) { this.parseWpDiscount(rawInfo, items, dr["direction"].ToString()); } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } } using (MySqlCommand cmd2 = new MySqlCommand("select * from ct_raw_qn_discount where cd_id = ?cd_id and direction = ?d and `type` = ?type and record_time between ?tb and ?te order by abs(record_time-?tp) limit 1", conn)) { cmd2.CommandTimeout = 120000; cmd2.Parameters.AddWithValue("?cd_id", cardId); cmd2.Parameters.AddWithValue("?tb", tp - 150 * 1000); cmd2.Parameters.AddWithValue("?te", tp + 150 * 1000); cmd2.Parameters.AddWithValue("?tp", tp); MySqlParameter pD = cmd2.Parameters.Add("?d", MySqlDbType.Byte); MySqlParameter pT = cmd2.Parameters.Add("?type", MySqlDbType.VarChar, 20); pD.Value = 0; pT.Value = "Q"; using (MySqlDataReader dr = this.TryGetReader(cmd2)) { if (this.TryRead(dr)) { string rawInfo; if (!object.Equals(dr["raw_info"], DBNull.Value)) { rawInfo = (string)dr["raw_info"]; } else { rawInfo = this.getRawInfoByAPI("get_discount_qn_raw_info", dr["id"].ToString()); } if (rawInfo != null) { this.parseQnDiscount(rawInfo, items, dr["direction"].ToString(), dr["type"].ToString()); } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } pD.Value = 1; pT.Value = "Q"; using (MySqlDataReader dr = this.TryGetReader(cmd2)) { if (this.TryRead(dr)) { string rawInfo; if (!object.Equals(dr["raw_info"], DBNull.Value)) { rawInfo = (string)dr["raw_info"]; } else { rawInfo = this.getRawInfoByAPI("get_discount_qn_raw_info", dr["id"].ToString()); } if (rawInfo != null) { this.parseQnDiscount(rawInfo, items, dr["direction"].ToString(), dr["type"].ToString()); } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } pD.Value = 0; pT.Value = "QP"; using (MySqlDataReader dr = this.TryGetReader(cmd2)) { if (this.TryRead(dr)) { string rawInfo; if (!object.Equals(dr["raw_info"], DBNull.Value)) { rawInfo = (string)dr["raw_info"]; } else { rawInfo = this.getRawInfoByAPI("get_discount_qn_raw_info", dr["id"].ToString()); } if (rawInfo != null) { this.parseQnDiscount((string)rawInfo, items, dr["direction"].ToString(), dr["type"].ToString()); } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } pD.Value = 1; pT.Value = "QP"; using (MySqlDataReader dr = this.TryGetReader(cmd2)) { if (this.TryRead(dr)) { string rawInfo; if (!object.Equals(dr["raw_info"], DBNull.Value)) { rawInfo = (string)dr["raw_info"]; } else { rawInfo = this.getRawInfoByAPI("get_discount_qn_raw_info", dr["id"].ToString()); } if (rawInfo != null) { this.parseQnDiscount(rawInfo, items, dr["direction"].ToString(), dr["type"].ToString()); } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } else { foreach (RaceData race in data.Where(x => x.CardID == cardId)) { race.Remove(tp); } continue; } } } } foreach (RaceData race in data.Where(x => x.CardID == cardId && x.Count > 0)) { race.Save(string.Format("sp-{0:yyyy-MM-dd}-{1}-{2}.dat", race.StartTime, race.CardID, race.RaceNo)); } } #endregion } } } } } private void parseQnTote(string text, Dictionary<string, double> dict) { text = Regex.Replace(text, @"^\s+", "", RegexOptions.Singleline); text = Regex.Replace(text, @"\s+$", "", RegexOptions.Singleline); string[] rows = text.Split('\n'); int splitIndex = 0; bool bottom_end = false; for (int i = 1; i < rows.Length; i++) { string[] segments = rows[i].Split('\t'); string hrs_1, hrs_2, hrs_key; int j; // 第二行获取分割索引 if (i == 1) { splitIndex = int.Parse(Regex.Replace(segments[1], @"^H(\d+)$", "$1")); } // 下方的赔率 if (!bottom_end) { for (j = 1; j < i; j++) { if (segments[j] == "") { bottom_end = true; break; } else { hrs_1 = (splitIndex + j - 1).ToString(); hrs_2 = (splitIndex + i - 1).ToString(); hrs_key = hrs_1 + "-" + hrs_2; if (segments[j] != "SCR") { Match m = Regex.Match(segments[j], @"^(?:\[[123]\])?(\d+(?:\.\d+)?)$"); if (m.Success) { dict.Add(hrs_key, double.Parse(m.Groups[1].Value)); } } } } } // 右方的赔率 for (j = i + 2; j < segments.Length - 1; j++) { if (segments[j] == "") break; hrs_1 = i.ToString(); hrs_2 = (j - 1).ToString(); hrs_key = hrs_1 + "-" + hrs_2; if (segments[j] != "SCR") { Match m = Regex.Match(segments[j], @"^(?:\[[123]\])?(\d+(?:\.\d+)?)$"); if (m.Success) { dict.Add(hrs_key, double.Parse(m.Groups[1].Value)); } } } } } private void parseWpDiscount(string text, Dictionary<int, RaceDataItem> items, string direction) { foreach (string line in text.Split('\n')) { if (line.Length > 0) { string[] elements = line.Split('\t'); int raceNo = int.Parse(elements[0]); if (!items.ContainsKey(raceNo)) continue; Match mLimit = Regex.Match(elements[5], @"^(!)?(\d+(?:\.\d+)?)\/(\d+(?:\.\d+)?)$"); string horseNo = elements[1]; WaterWP water; if (direction == "0") { water = items[raceNo].Waters.GetWpBetWater(horseNo); } else { water = items[raceNo].Waters.GetWpEatWater(horseNo); } water.Add(new WaterWPItem() { Percent = double.Parse(elements[4]), WinAmount = double.Parse(elements[2]), WinLimit = double.Parse(mLimit.Groups[2].Value), PlcAmount = double.Parse(elements[3]), PlcLimit = double.Parse(mLimit.Groups[3].Value) }); } } } private void parseQnDiscount(string text, Dictionary<int, RaceDataItem> items, string direction, string type) { foreach (string line in text.Split('\n')) { if (line.Length > 0) { string[] elements = line.Split('\t'); int raceNo = int.Parse(elements[0]); if (!items.ContainsKey(raceNo)) continue; string horseNo = Regex.Replace(elements[1], @"^\((\d+\-\d+)\)$", "$1"); WaterQn water; if (type == "Q") { if (direction == "0") { water = items[raceNo].Waters.GetQnBetWater(horseNo); } else { water = items[raceNo].Waters.GetQnEatWater(horseNo); } } else { if (direction == "0") { water = items[raceNo].Waters.GetQpBetWater(horseNo); } else { water = items[raceNo].Waters.GetQpEatWater(horseNo); } } water.Add(new WaterQnItem() { Percent = double.Parse(elements[3]), Amount = double.Parse(elements[2]), Limit = double.Parse(elements[4]) }); } } } } }
using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Task2 { public class BinarySearchTree<T> : IEnumerable<T> { protected class Node<TValue> { public TValue Value { get; private set; } public Node<TValue> Left { get; set; } public Node<TValue> Right { get; set; } public Node(TValue value) { Value = value; } } public int Count { get; protected set; } private Node<T> _root; protected IComparer<T> Comparer; public BinarySearchTree() : this(Comparer<T>.Default) { } public BinarySearchTree(IComparer<T> defaultComparer) { if (defaultComparer == null) throw new ArgumentNullException("Default comparer is null"); Comparer = defaultComparer; } public BinarySearchTree(IEnumerable<T> collection) : this(collection, Comparer<T>.Default) { } public BinarySearchTree(IEnumerable<T> collection, IComparer<T> defaultComparer) : this(defaultComparer) { AddRange(collection); } public IEnumerable<T> Inorder() => Inorder(_root); public IEnumerable<T> Preorder() => Preorder(_root); public IEnumerable<T> Postorder() => Postorder(_root); private IEnumerable<T> Inorder(Node<T> node) { if (node == null) yield break; foreach (var n in Inorder(node.Left)) yield return n; yield return node.Value; foreach (var n in Inorder(node.Right)) yield return n; } private IEnumerable<T> Preorder(Node<T> node) { if (node == null) yield break; yield return node.Value; foreach (var n in Preorder(node.Left)) yield return n; foreach (var n in Preorder(node.Right)) yield return n; } private IEnumerable<T> Postorder(Node<T> node) { if (node == null) yield break; foreach (var n in Postorder(node.Left)) yield return n; foreach (var n in Postorder(node.Right)) yield return n; yield return node.Value; } public IEnumerator<T> GetEnumerator() { return Inorder().GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } public void AddRange(IEnumerable<T> collection) { foreach (var value in collection) Add(value); } public void Add(T item) { var node = new Node<T>(item); if (_root == null) _root = node; else { Node<T> current = _root, parent = null; while (current != null) { parent = current; if (Comparer.Compare(item, current.Value) < 0) current = current.Left; else current = current.Right; } if (Comparer.Compare(item, parent.Value) < 0) parent.Left = node; else parent.Right = node; } ++Count; } public virtual bool Remove(T item) { if (_root == null) return false; Node<T> current = _root, parent = null; int result; do { result = Comparer.Compare(item, current.Value); if (result < 0) { parent = current; current = current.Left; } else if (result > 0) { parent = current; current = current.Right; } if (current == null) return false; } while (result != 0); if (current.Right == null) { if (current == _root) _root = current.Left; else { result = Comparer.Compare(current.Value, parent.Value); if (result < 0) parent.Left = current.Left; else parent.Right = current.Left; } } else if (current.Right.Left == null) { current.Right.Left = current.Left; if (current == _root) _root = current.Right; else { result = Comparer.Compare(current.Value, parent.Value); if (result < 0) parent.Left = current.Right; else parent.Right = current.Right; } } else { Node<T> min = current.Right.Left, prev = current.Right; while (min.Left != null) { prev = min; min = min.Left; } prev.Left = min.Right; min.Left = current.Left; min.Right = current.Right; if (current == _root) _root = min; else { result = Comparer.Compare(current.Value, parent.Value); if (result < 0) parent.Left = min; else parent.Right = min; } } --Count; return true; } } }
using System; namespace Ts.Core.Enums { public enum KeyboardType { Number, Phone, Default, Email, } }
using System; namespace NetFabric.Hyperlinq { public readonly struct FunctionWrapper<T, TResult> : IFunction<T, TResult> { readonly Func<T, TResult> function; public FunctionWrapper(Func<T, TResult> function) => this.function = function; public TResult Invoke(T arg) => function(arg); } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace SchoolManagementSystem { public partial class SubjectAssign : Form { public SubjectAssign() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "") { MessageBox.Show("All Fields must be filled!"); } else { try { SqlConnection con = new SqlConnection(@"Data Source=localhost;Initial Catalog=sclmgtsys_db;Integrated Security=True;"); con.Open(); String sql1 = "INSERT INTO teacher_module(module_id,teacher_id,module_name,teacher_name) VALUES('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "');"; SqlCommand cmd1 = new SqlCommand(sql1, con); int i = cmd1.ExecuteNonQuery(); if (i>0) { MessageBox.Show("Subject Assigned Successfully..."); } this.Close(); } catch (SqlException ex) { MessageBox.Show(ex.Message); } } } private void button3_Click(object sender, EventArgs e) { if(textBox1.Text == "" || textBox2.Text == "") { MessageBox.Show("All fields must be filled!"); } else { try { SqlConnection con = new SqlConnection(@"Data Source=localhost;Initial Catalog=sclmgtsys_db;Integrated Security=True;"); con.Open(); String sql2 = "SELECT teacher_name FROM teacher WHERE teacher_id='" + textBox1.Text + "';"; SqlCommand cmd2 = new SqlCommand(sql2, con); cmd2.ExecuteNonQuery(); SqlDataReader dr2; dr2 = cmd2.ExecuteReader(); if (dr2.Read()) { textBox4.Text = dr2.GetValue(0).ToString(); } dr2.Close(); String sql3 = "SELECT module_name FROM module WHERE module_id='" + textBox2.Text + "';"; SqlCommand cmd3 = new SqlCommand(sql3, con); cmd3.ExecuteNonQuery(); SqlDataReader dr3; dr3 = cmd3.ExecuteReader(); if (dr3.Read()) { textBox3.Text = dr3.GetValue(0).ToString(); } con.Close(); } catch (SqlException ex) { MessageBox.Show(ex.Message); } } } private void button2_Click(object sender, EventArgs e) { textBox1.Clear(); textBox2.Clear(); textBox3.Clear(); textBox4.Clear(); } private void SubjectAssign_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'sclmgtsys_dbDataSet3.teacher_module' table. You can move, or remove it, as needed. this.teacher_moduleTableAdapter.Fill(this.sclmgtsys_dbDataSet3.teacher_module); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class GameOverWindow { private GameOverWindowBehaviour _gameOverWindowBehaviour; private PauseManager _pauseManager; private AsyncProcessor _asyncProcessor; private Score _score; private const float _delayBeforeShow = 2f; private const string _currentScoreText = "Âàø ñ÷¸ò: "; private const string _bestScoreText = "Ëó÷øèé ñ÷¸ò: "; public GameOverWindow(GameOverWindowBehaviour gameOverWindowBehaviour, PauseManager pauseManager, Player player, AsyncProcessor asyncProcessor, Score score) { _gameOverWindowBehaviour = gameOverWindowBehaviour; _pauseManager = pauseManager; _asyncProcessor = asyncProcessor; _score = score; _gameOverWindowBehaviour.exitToMenuButton.onClick.AddListener(LoadMainScene); player.Damaged += () => _asyncProcessor.StartCoroutine(PauseGameAndShowWindowWithDelay()); } public IEnumerator PauseGameAndShowWindowWithDelay() { yield return new WaitForSeconds(_delayBeforeShow); _pauseManager.Pause(); Show(); } public void Show() { _gameOverWindowBehaviour.Show(); _gameOverWindowBehaviour.SetCurrentScoreText(_currentScoreText + _score.CurScore.ToString()); _gameOverWindowBehaviour.SetBestScoreText(_bestScoreText + _score.GetBestScore()); } private void LoadMainScene() { _pauseManager.Resume(); SceneManager.LoadScene(Scenes.MainMenu); } }
using System; using System.IO; using System.Linq; namespace BlazorUtils.Interfaces.EventArgs { public class LMTDropEventArgs : LMTEventArgs { private Stream _fileStream; private byte[] _dataByte; private string _base64String; public JsPrototypes.File File { get; } public string DataUrl { get; } public string StringData { get; } public string Base64String { get { if (_base64String == null) { _base64String = DataUrl.Substring(DataUrl.IndexOf("base64,") + 7); } return _base64String; } } public byte[] DataBytes { get { if (_dataByte == null) { _dataByte = Convert.FromBase64String(Base64String); } return _dataByte; } } public Stream FileStream { get { if (_fileStream == null) { _fileStream = new MemoryStream(DataBytes); } return _fileStream; } } public LMTDropEventArgs(string dataUrl, JsPrototypes.File file) { DataUrl = dataUrl; File = file; } public LMTDropEventArgs(string stringData) { StringData = stringData; } } }
using System; using System.ComponentModel.DataAnnotations; namespace Vaccination.Data { public class Vaccine { public int Id { get; set; } public enum Type { Unknown, mRNA, Vector } public Supplier Supplier { get; set; } [MaxLength(50)] public string Name { get; set; } public DateTime? EuOKStatus { get; set; } public Type VaccineType { get; set; } public string Comment { get; set; } public int AntalDoser { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data ; using System.Globalization; public partial class Invoice : System.Web.UI.Page { InvoiceClass obj_Class = new InvoiceClass(); int res1, res2,res3,res4,GrandTotal; DataSet ds_InvoiceID = new DataSet(); DataSet ds_InvoBilling = new DataSet(); DataSet ds_InvoBillDetails = new DataSet(); double total, Amount1, Amount2, Amount3, Amount4, AmtTotal, STax, ECess, HesCess, TotalGrand; string GTotal; public string Tblcount; protected void Page_Load(object sender, EventArgs e) { //if (Session["UserID"] != string.Empty && Convert.ToInt32(Session["UserID"].ToString()) > 0) // { if (IsPostBack != true) { if (Request.QueryString.Count > 0) { txt_InvoiceID.Text = Request.QueryString["InVID"]; SearchInvoiceDetails(Convert.ToInt32(Request.QueryString["InVID"])); } else { txt_Dated.Text = DateTime.Now.ToString("dd/MM/yyyy"); Get_InvoiceID(); lbl_BillNO.Text = "AARMS/BIZ-2014/"; } } //} //else // { // Response.Redirect("Index.aspx"); // } } public void Get_InvoiceID() { ds_InvoiceID = obj_Class.Get_InvoiceID(); txt_InvoiceID.Text = ds_InvoiceID.Tables[0].Rows[0][0].ToString(); } protected void ddl_Domain_SelectedIndexChanged(object sender, EventArgs e) { if (ddl_Domain.SelectedValue == "SCMBizconnect") { lbl_Companyname.Text = "ARM SUPPLY CHAIN SOLUTIONS"; img_Logo.Visible = false ; lbl_BillNO.Text = "ARM/BIZ-2013/"; lbl_Name.Text = "ARM SUPPLY CHAIN SOLUTIONS"; } else if (ddl_Domain.SelectedValue == "SCMJunction") { lbl_Companyname.Text = "ARM SUPPLY CHAIN SOLUTIONS"; img_Logo.Visible = false; lbl_BillNO.Text = "ARM/SCM-2013/"; lbl_Name.Text = "ARM SUPPLY CHAIN SOLUTIONS"; } else if (ddl_Domain.SelectedValue == "AaumConnect") { lbl_Companyname.Text = "ARM SUPPLY CHAIN SOLUTIONS"; img_Logo.Visible = false; lbl_BillNO.Text = "ARM/AUM-2013/"; lbl_Name.Text = "ARM SUPPLY CHAIN SOLUTIONS"; } else if (ddl_Domain.SelectedValue == "SCMBizconnect1") { lbl_Companyname.Text = "AARMS VALUE CHAIN PRIVATE LIMITED"; img_Logo.Visible = true; lbl_BillNO.Text = "AARMSCM/BIZ-2013/"; lbl_Name.Text = "AARMS VALUE CHAIN PRIVATE LIMITED"; } Clearfields2(); GetZerosforNumericfields(); } //protected void btn_Print_Click(object sender, EventArgs e) //{ // lbl_Particulars.Visible = true; // lbl_Particulars.Text = ddl_particulars.SelectedValue.ToString(); // ddl_particulars.Visible = false; // lbl_Quantity.Visible = true; // lbl_Quantity.Text = ddl_QuantityorNooftrucks.SelectedValue.ToString(); // ddl_QuantityorNooftrucks.Visible = false; // lbl_Buyer.Visible = true; // ddl_BuyerorTo.Visible = false; // lbl_Buyer.Text = ddl_BuyerorTo.SelectedValue.ToString(); // lbl_Domain.Visible = true; // lbl_Domain.Text = ddl_Domain.SelectedValue.ToString(); // ddl_Domain.Visible = false; // //Page.ClientScript.RegisterStartupScript(GetType(), "MyKey1", "callPrint('divReport');", true); //} protected void btn_Submit_Click(object sender, EventArgs e) { obj_Class.InvoiceID = Convert .ToInt32(txt_InvoiceID.Text); obj_Class.Dated = DateTime.ParseExact(txt_Dated.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture); obj_Class.Domain = ddl_Domain.SelectedValue; obj_Class.OtherReferences = txt_OtherRef.Text; obj_Class.InvoiceRemarks = txt_Remarks.Text; obj_Class.BuyerorTo = ddl_BuyerorTo.SelectedValue; obj_Class.BuyerorToDetails = txt_BuyerOrTodetails.Text; obj_Class.BillNo = lbl_BillNO.Text; obj_Class.Status = 2; res1 = obj_Class.Insert_InvoiceBilling(); if (res1 == 0) { this.Page.ClientScript.RegisterStartupScript(typeof(Page), "notification", "window.alert('This Invoice BillNo Already Exists!Click Reset Button For New BillNo');", true); } else { obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); obj_Class.Tax12percent = Convert.ToSingle(txt_12percent.Text); obj_Class.Tax2percent = Convert.ToSingle(txt_2percent.Text); obj_Class.Tax1percent = Convert.ToSingle(txt_1percent.Text); obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); obj_Class.ServiceTax=Convert.ToSingle(txt_Tax12per.Text); obj_Class.EducationCess=Convert.ToSingle(txt_Tax2per.Text); obj_Class.HigherEducationCess=Convert.ToSingle(txt_Tax1per.Text); string Words = retWord(Convert.ToInt32(txt_Total.Text)); txt_AmountInwords.Text = Words; obj_Class.AmountInwords = txt_AmountInwords.Text+" Only"; if (txt_Desc1.Text != string.Empty) { obj_Class.Particulars = txt_Desc1.Text; if (txt_Quantity1.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity1.Text); } obj_Class.Rate = Convert.ToSingle(txt_Rate1.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount1.Text); res2 = obj_Class.Insert_InvoiceBilling_Details(); } if (txt_Desc2.Text != string.Empty) { obj_Class.Particulars = txt_Desc2.Text; if (txt_Quantity1.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity1.Text); } obj_Class.Rate = Convert.ToSingle(txt_Rate2.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount2.Text); res2 = obj_Class.Insert_InvoiceBilling_Details(); } if (txt_Desc3.Text != string.Empty) { obj_Class.Particulars = txt_Desc3.Text; obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity3.Text); obj_Class.Rate = Convert.ToSingle(txt_Rate3.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount3.Text); res2 = obj_Class.Insert_InvoiceBilling_Details(); } if (txt_Desc4.Text != string.Empty) { obj_Class.Particulars = txt_Desc4.Text; obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity4.Text); obj_Class.Rate = Convert.ToSingle(txt_Rate4.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount4.Text); res2 = obj_Class.Insert_InvoiceBilling_Details(); } //if (txt_Desc5.Text != string.Empty) //{ // obj_Class.Particulars = txt_Desc5.Text; // obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity5.Text); // obj_Class.Rate = Convert.ToSingle(txt_Rate5.Text); // obj_Class.Amount = Convert.ToSingle(txt_Amount5.Text); // res2 = obj_Class.Insert_InvoiceBilling_Details(); //} if (res1 == 1 && res2 == 1) { //ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Invoice Details Inserted Successfully');</script>"); this.Page.ClientScript.RegisterStartupScript(typeof(Page), "notification", "window.alert('Invoice Details Inserted Successfully! And The BillNo is " + txt_InvoiceID.Text + "');", true); Clearfields(); Get_InvoiceID(); GetZerosToAmountFields(); } } txt_Dated.Text = DateTime.Now.ToString("dd/MM/yyyy"); //btn_Print.Enabled =true; } public void Clearfields() { txt_Dated.Text = ""; txt_OtherRef.Text = ""; txt_Remarks.Text = ""; txt_BuyerOrTodetails.Text = ""; txt_Amount1.Text = ""; txt_Amount2.Text = ""; txt_Amount3.Text = ""; txt_Amount4.Text = ""; //txt_Amount5.Text = ""; txt_Desc1.Text = ""; txt_Desc2.Text = ""; txt_Desc3.Text = ""; txt_Desc4.Text = ""; txt_Desc4.Text = ""; //txt_Desc5.Text = ""; txt_Quantity1.Text = ""; txt_Quantity2.Text = ""; txt_Quantity3.Text = ""; txt_Quantity4.Text = ""; //txt_Quantity5.Text = ""; txt_Rate1.Text = ""; txt_Rate2.Text = ""; txt_Rate3.Text = ""; txt_Rate4.Text = ""; //txt_Rate5.Text = ""; txt_GrandTotal.Text = ""; txt_Total.Text=""; txt_12percent.Text = ""; txt_2percent.Text = ""; txt_1percent.Text = ""; txt_Tax12per.Text = ""; txt_Tax2per.Text = ""; txt_Tax1per.Text = ""; txt_AmountInwords.Text = ""; ddl_BuyerorTo.SelectedIndex = -1; ddl_BuyerorTo.ClearSelection(); ddl_Domain.SelectedIndex = -1; ddl_Domain.ClearSelection(); ddl_particulars.SelectedIndex = -1; ddl_particulars.ClearSelection(); ddl_QuantityorNooftrucks.SelectedIndex = -1; ddl_QuantityorNooftrucks.ClearSelection(); } protected void imgbtn_Search_Click(object sender, ImageClickEventArgs e) { SearchInvoiceDetails(Convert.ToInt32(txt_InvoiceID.Text)); } public void SearchInvoiceDetails(int InvoiceID) { ds_InvoBillDetails = obj_Class.Search_InvoiceBillingDetails(InvoiceID); Tblcount = ds_InvoBillDetails.Tables[0].Rows.Count.ToString(); Session["Tblcount"] = Convert.ToInt32(Tblcount); ddl_particulars.Visible = true; lbl_Particulars.Visible = false; lbl_Quantity.Visible = false; ddl_QuantityorNooftrucks.Visible = true; Clearfields(); GetZerosToAmountFields(); //btn_Print.Enabled =true; btn_Update.Enabled = true; ds_InvoBilling = obj_Class.Search_InvoiceBilling(InvoiceID); if (ds_InvoBilling.Tables[0].Rows.Count > 0) { try { txt_Dated.Text = ds_InvoBilling.Tables[0].Rows[0][0].ToString(); ddl_Domain.SelectedValue = ds_InvoBilling.Tables[0].Rows[0][1].ToString(); txt_OtherRef.Text = ds_InvoBilling.Tables[0].Rows[0][2].ToString(); txt_Remarks.Text = ds_InvoBilling.Tables[0].Rows[0][3].ToString(); ddl_BuyerorTo.SelectedValue = ds_InvoBilling.Tables[0].Rows[0][4].ToString(); txt_BuyerOrTodetails.Text = ds_InvoBilling.Tables[0].Rows[0][5].ToString(); lbl_BillNO.Text = ds_InvoBilling.Tables[0].Rows[0][6].ToString(); } catch (Exception ex) { } txt_AmountInwords.Text = ""; } ds_InvoBillDetails = obj_Class.Search_InvoiceBillingDetails(InvoiceID); if (ds_InvoBillDetails.Tables[0].Rows.Count > 0) { if (ds_InvoBillDetails.Tables[0].Rows.Count == 1) { txt_Desc1.Text = ds_InvoBillDetails.Tables[0].Rows[0][0].ToString(); txt_Quantity1.Text = ds_InvoBillDetails.Tables[0].Rows[0][1].ToString(); txt_Rate1.Text = ds_InvoBillDetails.Tables[0].Rows[0][2].ToString(); txt_Amount1.Text = ds_InvoBillDetails.Tables[0].Rows[0][3].ToString(); txt_GrandTotal.Text = ds_InvoBillDetails.Tables[0].Rows[0][4].ToString(); txt_12percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][5]).ToString(); txt_2percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][6]).ToString(); txt_1percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][7]).ToString(); //total=Math.Ceiling(ds_InvoBillDetails.Tables[0].Rows[0][8]); txt_Total.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][8]).ToString(); txt_Tax12per.Text = ds_InvoBillDetails.Tables[0].Rows[0][9].ToString(); txt_Tax2per.Text = ds_InvoBillDetails.Tables[0].Rows[0][10].ToString(); txt_Tax1per.Text = ds_InvoBillDetails.Tables[0].Rows[0][11].ToString(); txt_AmountInwords.Text = ds_InvoBillDetails.Tables[0].Rows[0][12].ToString(); Session["InvoiceBillID1"] = ds_InvoBillDetails.Tables[0].Rows[0][13].ToString(); tr1.Visible = true; tr2.Visible = false; tr3.Visible = false; tr4.Visible = false; } if (ds_InvoBillDetails.Tables[0].Rows.Count == 2) { txt_Desc1.Text = ds_InvoBillDetails.Tables[0].Rows[0][0].ToString(); txt_Quantity1.Text = ds_InvoBillDetails.Tables[0].Rows[0][1].ToString(); txt_Rate1.Text = ds_InvoBillDetails.Tables[0].Rows[0][2].ToString(); txt_Amount1.Text = ds_InvoBillDetails.Tables[0].Rows[0][3].ToString(); txt_GrandTotal.Text = ds_InvoBillDetails.Tables[0].Rows[0][4].ToString(); txt_12percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][5]).ToString(); txt_2percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][6]).ToString(); txt_1percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][7]).ToString(); //total=Math.Ceiling(ds_InvoBillDetails.Tables[0].Rows[0][8]); txt_Total.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][8]).ToString(); txt_Tax12per.Text = ds_InvoBillDetails.Tables[0].Rows[0][9].ToString(); txt_Tax2per.Text = ds_InvoBillDetails.Tables[0].Rows[0][10].ToString(); txt_Tax1per.Text = ds_InvoBillDetails.Tables[0].Rows[0][11].ToString(); txt_AmountInwords.Text = ds_InvoBillDetails.Tables[0].Rows[0][12].ToString(); Session["InvoiceBillID1"] = ds_InvoBillDetails.Tables[0].Rows[0][13].ToString(); txt_Desc2.Text = ds_InvoBillDetails.Tables[0].Rows[1][0].ToString(); txt_Quantity2.Text = ds_InvoBillDetails.Tables[0].Rows[1][1].ToString(); txt_Rate2.Text = ds_InvoBillDetails.Tables[0].Rows[1][2].ToString(); txt_Amount2.Text = ds_InvoBillDetails.Tables[0].Rows[1][3].ToString(); Session["InvoiceBillID2"] = ds_InvoBillDetails.Tables[0].Rows[1][13].ToString(); tr1.Visible = true; tr2.Visible = true; tr3.Visible = false; tr4.Visible = false; } if (ds_InvoBillDetails.Tables[0].Rows.Count == 3) { txt_Desc1.Text = ds_InvoBillDetails.Tables[0].Rows[0][0].ToString(); txt_Quantity1.Text = ds_InvoBillDetails.Tables[0].Rows[0][1].ToString(); txt_Rate1.Text = ds_InvoBillDetails.Tables[0].Rows[0][2].ToString(); txt_Amount1.Text = ds_InvoBillDetails.Tables[0].Rows[0][3].ToString(); txt_GrandTotal.Text = ds_InvoBillDetails.Tables[0].Rows[0][4].ToString(); txt_12percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][5]).ToString(); txt_2percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][6]).ToString(); txt_1percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][7]).ToString(); //total=Math.Ceiling(ds_InvoBillDetails.Tables[0].Rows[0][8]); txt_Total.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][8]).ToString(); txt_Tax12per.Text = ds_InvoBillDetails.Tables[0].Rows[0][9].ToString(); txt_Tax2per.Text = ds_InvoBillDetails.Tables[0].Rows[0][10].ToString(); txt_Tax1per.Text = ds_InvoBillDetails.Tables[0].Rows[0][11].ToString(); txt_AmountInwords.Text = ds_InvoBillDetails.Tables[0].Rows[0][12].ToString(); Session["InvoiceBillID1"] = ds_InvoBillDetails.Tables[0].Rows[0][13].ToString(); txt_Desc2.Text = ds_InvoBillDetails.Tables[0].Rows[1][0].ToString(); txt_Quantity2.Text = ds_InvoBillDetails.Tables[0].Rows[1][1].ToString(); txt_Rate2.Text = ds_InvoBillDetails.Tables[0].Rows[1][2].ToString(); txt_Amount2.Text = ds_InvoBillDetails.Tables[0].Rows[1][3].ToString(); Session["InvoiceBillID2"] = ds_InvoBillDetails.Tables[0].Rows[1][13].ToString(); txt_Desc3.Text = ds_InvoBillDetails.Tables[0].Rows[2][0].ToString(); txt_Quantity3.Text = ds_InvoBillDetails.Tables[0].Rows[2][1].ToString(); txt_Rate3.Text = ds_InvoBillDetails.Tables[0].Rows[2][2].ToString(); txt_Amount3.Text = ds_InvoBillDetails.Tables[0].Rows[2][3].ToString(); Session["InvoiceBillID3"] = ds_InvoBillDetails.Tables[0].Rows[2][13].ToString(); tr1.Visible = true; tr2.Visible = true; tr3.Visible = true; tr4.Visible = false; } if (ds_InvoBillDetails.Tables[0].Rows.Count == 4) { txt_Desc1.Text = ds_InvoBillDetails.Tables[0].Rows[0][0].ToString(); txt_Quantity1.Text = ds_InvoBillDetails.Tables[0].Rows[0][1].ToString(); txt_Rate1.Text = ds_InvoBillDetails.Tables[0].Rows[0][2].ToString(); txt_Amount1.Text = ds_InvoBillDetails.Tables[0].Rows[0][3].ToString(); txt_GrandTotal.Text = ds_InvoBillDetails.Tables[0].Rows[0][4].ToString(); txt_12percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][5]).ToString(); txt_2percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][6]).ToString(); txt_1percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][7]).ToString(); //total=Math.Ceiling(ds_InvoBillDetails.Tables[0].Rows[0][8]); txt_Total.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][8]).ToString(); txt_Tax12per.Text = ds_InvoBillDetails.Tables[0].Rows[0][9].ToString(); txt_Tax2per.Text = ds_InvoBillDetails.Tables[0].Rows[0][10].ToString(); txt_Tax1per.Text = ds_InvoBillDetails.Tables[0].Rows[0][11].ToString(); txt_AmountInwords.Text = ds_InvoBillDetails.Tables[0].Rows[0][12].ToString(); Session["InvoiceBillID1"] = ds_InvoBillDetails.Tables[0].Rows[0][13].ToString(); txt_Desc2.Text = ds_InvoBillDetails.Tables[0].Rows[1][0].ToString(); txt_Quantity2.Text = ds_InvoBillDetails.Tables[0].Rows[1][1].ToString(); txt_Rate2.Text = ds_InvoBillDetails.Tables[0].Rows[1][2].ToString(); txt_Amount2.Text = ds_InvoBillDetails.Tables[0].Rows[1][3].ToString(); Session["InvoiceBillID2"] = ds_InvoBillDetails.Tables[0].Rows[1][13].ToString(); txt_Desc3.Text = ds_InvoBillDetails.Tables[0].Rows[2][0].ToString(); txt_Quantity3.Text = ds_InvoBillDetails.Tables[0].Rows[2][1].ToString(); txt_Rate3.Text = ds_InvoBillDetails.Tables[0].Rows[2][2].ToString(); txt_Amount3.Text = ds_InvoBillDetails.Tables[0].Rows[2][3].ToString(); Session["InvoiceBillID3"] = ds_InvoBillDetails.Tables[0].Rows[2][13].ToString(); txt_Desc4.Text = ds_InvoBillDetails.Tables[0].Rows[3][0].ToString(); txt_Quantity4.Text = ds_InvoBillDetails.Tables[0].Rows[3][1].ToString(); txt_Rate4.Text = ds_InvoBillDetails.Tables[0].Rows[3][2].ToString(); txt_Amount4.Text = ds_InvoBillDetails.Tables[0].Rows[3][3].ToString(); Session["InvoiceBillID4"] = ds_InvoBillDetails.Tables[0].Rows[3][13].ToString(); tr1.Visible = true; tr2.Visible = true; tr3.Visible = true; tr4.Visible = true; } //try //{ // if (ds_InvoBillDetails.Tables[0].Rows[0] != null) // { // txt_Desc1.Text = ds_InvoBillDetails.Tables[0].Rows[0][0].ToString(); // txt_Quantity1.Text = ds_InvoBillDetails.Tables[0].Rows[0][1].ToString(); // txt_Rate1.Text = ds_InvoBillDetails.Tables[0].Rows[0][2].ToString(); // txt_Amount1.Text = ds_InvoBillDetails.Tables[0].Rows[0][3].ToString(); // txt_GrandTotal.Text = ds_InvoBillDetails.Tables[0].Rows[0][4].ToString(); // txt_12percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][5]).ToString(); // txt_2percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][6]).ToString(); // txt_1percent.Text = String.Format("{0:F2}", ds_InvoBillDetails.Tables[0].Rows[0][7]).ToString(); // //total=Math.Ceiling(ds_InvoBillDetails.Tables[0].Rows[0][8]); // txt_Total.Text = String.Format("{0:F2}",ds_InvoBillDetails.Tables[0].Rows[0][8]).ToString(); // txt_Tax12per.Text= ds_InvoBillDetails.Tables[0].Rows[0][9].ToString(); // txt_Tax2per.Text= ds_InvoBillDetails.Tables[0].Rows[0][10].ToString(); // txt_Tax1per.Text=ds_InvoBillDetails.Tables[0].Rows[0][11].ToString(); // txt_AmountInwords .Text =ds_InvoBillDetails.Tables[0].Rows[0][12].ToString(); // Session["InvoiceBillID1"] = ds_InvoBillDetails.Tables[0].Rows[0][13].ToString(); // } // if (ds_InvoBillDetails.Tables[0].Rows[1] != null) // { // txt_Desc2.Text = ds_InvoBillDetails.Tables[0].Rows[1][0].ToString(); // txt_Quantity2.Text = ds_InvoBillDetails.Tables[0].Rows[1][1].ToString(); // txt_Rate2.Text = ds_InvoBillDetails.Tables[0].Rows[1][2].ToString(); // txt_Amount2.Text = ds_InvoBillDetails.Tables[0].Rows[1][3].ToString(); // Session["InvoiceBillID2"] = ds_InvoBillDetails.Tables[0].Rows[1][13].ToString(); // } // if (ds_InvoBillDetails.Tables[0].Rows[2] != null) // { // txt_Desc3.Text = ds_InvoBillDetails.Tables[0].Rows[2][0].ToString(); // txt_Quantity3.Text = ds_InvoBillDetails.Tables[0].Rows[2][1].ToString(); // txt_Rate3.Text = ds_InvoBillDetails.Tables[0].Rows[2][2].ToString(); // txt_Amount3.Text = ds_InvoBillDetails.Tables[0].Rows[2][3].ToString(); // Session["InvoiceBillID3"] = ds_InvoBillDetails.Tables[0].Rows[2][13].ToString(); // } // if (ds_InvoBillDetails.Tables[0].Rows[3] != null) // { // txt_Desc4.Text = ds_InvoBillDetails.Tables[0].Rows[3][0].ToString(); // txt_Quantity4.Text = ds_InvoBillDetails.Tables[0].Rows[3][1].ToString(); // txt_Rate4.Text = ds_InvoBillDetails.Tables[0].Rows[3][2].ToString(); // txt_Amount4.Text = ds_InvoBillDetails.Tables[0].Rows[3][3].ToString(); // Session["InvoiceBillID4"] = ds_InvoBillDetails.Tables[0].Rows[3][13].ToString(); // } //} //catch (Exception ex) //{ //} if (ddl_Domain.SelectedValue == "SCMBizconnect") { lbl_Companyname.Text = "ARM SUPPLY CHAIN SOLUTIONS"; lbl_Name.Text = "ARM SUPPLY CHAIN SOLUTIONS"; img_Logo.Visible = false; } else if (ddl_Domain.SelectedValue == "SCMJunction") { lbl_Companyname.Text = "ARM SUPPLY CHAIN SOLUTIONS"; lbl_Name.Text = "ARM SUPPLY CHAIN SOLUTIONS"; img_Logo.Visible = false; } else if (ddl_Domain.SelectedValue == "AaumConnect") { lbl_Companyname.Text = "ARM SUPPLY CHAIN SOLUTIONS"; lbl_Name.Text = "ARM SUPPLY CHAIN SOLUTIONS"; img_Logo.Visible = false; } else if (ddl_Domain.SelectedValue == "SCMBizconnect1") { lbl_Companyname.Text = "AARMS VALUE CHAIN PRIVATE LIMITED"; lbl_Name.Text = "AARMS VALUE CHAIN PRIVATE LIMITED"; img_Logo.Visible = true; } } } public void Clearfields2() { txt_OtherRef.Text = ""; txt_Remarks.Text = ""; txt_BuyerOrTodetails.Text = ""; txt_Amount1.Text = ""; txt_Amount2.Text = ""; txt_Amount3.Text = ""; txt_Amount4.Text = ""; //txt_Amount5.Text = ""; txt_Desc1.Text = ""; txt_Desc2.Text = ""; txt_Desc3.Text = ""; txt_Desc4.Text = ""; txt_Desc4.Text = ""; //txt_Desc5.Text = ""; txt_Quantity1.Text = ""; txt_Quantity2.Text = ""; txt_Quantity3.Text = ""; txt_Quantity4.Text = ""; //txt_Quantity5.Text = ""; txt_Rate1.Text = ""; txt_Rate2.Text = ""; txt_Rate3.Text = ""; txt_Rate4.Text = ""; txt_GrandTotal.Text = ""; txt_12percent.Text = ""; txt_2percent.Text = ""; txt_1percent.Text = ""; txt_Total.Text = ""; txt_Tax12per.Text = ""; txt_Tax2per.Text = ""; txt_Tax1per.Text = ""; //txt_Rate5.Text = ""; ddl_BuyerorTo.SelectedIndex = -1; ddl_BuyerorTo.ClearSelection(); } protected void btn_Reset_Click(object sender, EventArgs e) { Get_InvoiceID(); ddl_particulars.Visible = true; lbl_Particulars.Visible = false; lbl_Quantity.Visible = false; ddl_QuantityorNooftrucks.Visible = true; //lbl_Buyer.Visible = false; //lbl_Domain.Visible = false; ddl_Domain.Visible = true; ddl_BuyerorTo.Visible = true; txt_Dated.Text = DateTime.Now.ToString("dd/MM/yyyy"); ddl_Domain.SelectedIndex = 0; txt_OtherRef.Text = ""; txt_Remarks.Text = ""; ddl_BuyerorTo.SelectedIndex = 0; txt_BuyerOrTodetails.Text = ""; ddl_particulars.SelectedIndex = 0; txt_Desc1.Text = ""; ddl_QuantityorNooftrucks.SelectedIndex = 0; txt_Desc2.Text = ""; txt_Desc3.Text = ""; txt_Desc4.Text = ""; txt_AmountInwords.Text=""; GetZerosforNumericfields(); } public void GetZerosforNumericfields() { txt_Quantity1.Text = "0"; txt_Rate1.Text = "0"; txt_Amount1.Text = "0"; txt_Quantity2.Text = "0"; txt_Rate2.Text = "0"; txt_Amount2.Text = "0"; txt_Quantity3.Text = "0"; txt_Rate3.Text = "0"; txt_Amount3.Text = "0"; txt_Quantity4.Text = "0"; txt_Rate4.Text = "0"; txt_Amount4.Text = "0"; txt_GrandTotal.Text = "0"; txt_12percent.Text = "0"; txt_2percent.Text = "0"; txt_1percent.Text = "0"; txt_Total.Text = "0"; txt_Tax12per.Text = "0"; txt_Tax2per.Text = "0"; txt_Tax1per.Text = "0"; txt_Dated.Text = DateTime.Now.ToString("dd/MM/yyyy"); Get_InvoiceID(); } public string retWord(int number) { if (number == 0) return "Zero"; if (number == -2147483648) return "Minus Two Hundred and Fourteen Crore Seventy Four Lakh Eighty Three Thousand Six Hundred and Forty Eight"; int[] num = new int[4]; int first = 0; int u, h, t; System.Text.StringBuilder sb = new System.Text.StringBuilder(); if (number < 0) { sb.Append("Minus"); number = -number; } string[] words0 = { "", "One ", "Two ", "Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine " }; string[] words = { "Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen " }; string[] words2 = { "Twenty ", "Thirty ", "Forty ", "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety " }; string[] words3 = { "Thousand ", "Lakh ", "Crore " }; num[0] = number % 1000; // units num[1] = number / 1000; num[2] = number / 100000; num[1] = num[1] - 100 * num[2]; // thousands num[3] = number / 10000000; // crores num[2] = num[2] - 100 * num[3]; // lakhs for (int i = 3; i > 0; i--) { if (num[i] != 0) { first = i; break; } } for (int i = first; i >= 0; i--) { if (num[i] == 0) continue; u = num[i] % 10; // ones t = num[i] / 10; h = num[i] / 100; // hundreds t = t - 10 * h; // tens if (h > 0) sb.Append(words0[h] + "Hundred "); if (u > 0 || t > 0) { if (h > 0 || i == 0) sb.Append("and "); if (t == 0) sb.Append(words0[u]); else if (t == 1) sb.Append(words[u]); else sb.Append(words2[t - 2] + words0[u]); } if (i != 0) sb.Append(words3[i - 1]); } return sb.ToString().TrimEnd(); } public string Get_GrandTotal() { GTotal = txt_Total.Text; if (GTotal.Contains(".")) { GrandTotal = Convert.ToInt32(GTotal.Remove(GTotal.Length - 3, 3)); } else { GrandTotal = Convert.ToInt32(GTotal); } string Words = retWord(GrandTotal); return Words; } // protected void btn_Update_Click(object sender, EventArgs e) //{ // try // { // Assign_InvoiceDetails(); // res3 = obj_Class.Update_InvoiceBilling(); // if (txt_Desc1.Text != string.Empty) // { // obj_Class.Particulars = txt_Desc1.Text; // if (txt_Quantity1.Text == string.Empty) // { // obj_Class.QuantityNoofTrucks = 0; // } // else // { // obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity1.Text); // } // txt_AmountInwords.Text=""; // obj_Class.Rate = Convert.ToSingle(txt_Rate1.Text); // obj_Class.Amount = Convert.ToSingle(txt_Amount1.Text); // obj_Class.ServiceTax = Convert.ToSingle(txt_Tax12per.Text); // obj_Class.EducationCess = Convert.ToSingle(txt_Tax2per.Text); // obj_Class.HigherEducationCess = Convert.ToSingle(txt_Tax1per.Text); // obj_Class.Tax12percent = Convert.ToSingle(txt_12percent.Text); // obj_Class .Tax2percent =Convert.ToSingle(txt_2percent .Text); // obj_Class.Tax1percent = Convert.ToSingle(txt_1percent.Text); // obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); // obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); // string AmountWords = Get_GrandTotal(); // txt_AmountInwords.Text = AmountWords; // obj_Class.AmountInwords = txt_AmountInwords.Text; // obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID1"]); // res4 = obj_Class.Update_InvoiceBilling_Details(); // } // if (txt_Desc2.Text != string.Empty) // { // obj_Class.Particulars = txt_Desc2.Text; // if (txt_Quantity2.Text == string.Empty) // { // obj_Class.QuantityNoofTrucks = 0; // } // else // { // obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity2.Text); // } // obj_Class.Rate = Convert.ToSingle(txt_Rate2.Text); // obj_Class.Amount = Convert.ToSingle(txt_Amount2.Text); // obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); // obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); // string AmountWords = Get_GrandTotal(); // txt_AmountInwords.Text = AmountWords; // obj_Class.AmountInwords = txt_AmountInwords.Text; // obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID2"]); // res4 = obj_Class.Update_InvoiceBilling_Details(); // } // if (txt_Desc3.Text != string.Empty) // { // obj_Class.Particulars = txt_Desc3.Text; // if (txt_Quantity3.Text == string.Empty) // { // obj_Class.QuantityNoofTrucks = 0; // } // else // { // obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity3.Text); // } // obj_Class.Rate = Convert.ToSingle(txt_Rate3.Text); // obj_Class.Amount = Convert.ToSingle(txt_Amount3.Text); // obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); // obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); // string AmountWords = Get_GrandTotal(); // txt_AmountInwords.Text = AmountWords; // obj_Class.AmountInwords = txt_AmountInwords.Text; // obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID3"]); // res4 = obj_Class.Update_InvoiceBilling_Details(); // } // if (txt_Desc4.Text != string.Empty) // { // obj_Class.Particulars = txt_Desc4.Text; // if (txt_Quantity4.Text == string.Empty) // { // obj_Class.QuantityNoofTrucks = 0; // } // else // { // obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity4.Text); // } // obj_Class.Rate = Convert.ToSingle(txt_Rate4.Text); // obj_Class.Amount = Convert.ToSingle(txt_Amount4.Text); // obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); // obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); // string AmountWords = Get_GrandTotal(); // txt_AmountInwords.Text = AmountWords; // obj_Class.AmountInwords = txt_AmountInwords.Text; // obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID4"]); // res4 = obj_Class.Update_InvoiceBilling_Details(); // } // if (res3 == 1 && res4 == 1) // { // //ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Invoice Details Inserted Successfully');</script>"); // this.Page.ClientScript.RegisterStartupScript(typeof(Page), "notification", "window.alert('Invoice Details Updated Successfully! With The BillNo is " + txt_InvoiceID.Text + "');", true); // Clearfields(); // Get_InvoiceID(); // } // } // catch (Exception ex) // { // } //} public void Assign_InvoiceDetails() { obj_Class.InvoiceID = Convert.ToInt32(txt_InvoiceID.Text); obj_Class.OtherReferences = txt_OtherRef.Text; obj_Class.Domain = ddl_Domain.SelectedValue; obj_Class.InvoiceRemarks = txt_Remarks.Text; obj_Class.BuyerorTo = ddl_BuyerorTo.SelectedValue; obj_Class.BuyerorToDetails = txt_BuyerOrTodetails.Text; obj_Class.Status = 0; } public void GetZerosToAmountFields() { txt_Quantity1.Text = "0"; txt_Rate1.Text = "0"; txt_Amount1.Text = "0"; txt_Quantity2.Text = "0"; txt_Rate2.Text = "0"; txt_Amount2.Text = "0"; txt_Quantity3.Text = "0"; txt_Rate3.Text = "0"; txt_Amount3.Text = "0"; txt_Quantity4.Text = "0"; txt_Rate4.Text = "0"; txt_Amount4.Text = "0"; txt_GrandTotal.Text = "0"; txt_12percent.Text = "0"; txt_2percent.Text = "0"; txt_1percent.Text = "0"; txt_Total.Text = "0"; txt_Tax12per.Text = "0"; txt_Tax2per.Text = "0"; txt_Tax1per.Text = "0"; } protected void btn_Edit_Click(object sender, EventArgs e) { if (txt_Username.Text == "admin" && txt_Password.Text == "admin") { try { Assign_InvoiceDetails(); res3 = obj_Class.Update_InvoiceBilling(); if (txt_Desc1.Text != string.Empty) { obj_Class.Particulars = txt_Desc1.Text; if (txt_Quantity1.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity1.Text); } txt_AmountInwords.Text = ""; obj_Class.Rate = Convert.ToSingle(txt_Rate1.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount1.Text); obj_Class.ServiceTax = Convert.ToSingle(txt_Tax12per.Text); obj_Class.EducationCess = Convert.ToSingle(txt_Tax2per.Text); obj_Class.HigherEducationCess = Convert.ToSingle(txt_Tax1per.Text); obj_Class.Tax12percent = Convert.ToSingle(txt_12percent.Text); obj_Class.Tax2percent = Convert.ToSingle(txt_2percent.Text); obj_Class.Tax1percent = Convert.ToSingle(txt_1percent.Text); obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); string AmountWords = Get_GrandTotal(); txt_AmountInwords.Text = AmountWords; obj_Class.AmountInwords = txt_AmountInwords.Text + " Olny"; obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID1"]); res4 = obj_Class.Update_InvoiceBilling_Details(); } if (txt_Desc2.Text != string.Empty) { obj_Class.Particulars = txt_Desc2.Text; if (txt_Quantity2.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity2.Text); } obj_Class.Rate = Convert.ToSingle(txt_Rate2.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount2.Text); obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); string AmountWords = Get_GrandTotal(); txt_AmountInwords.Text = AmountWords; obj_Class.AmountInwords = txt_AmountInwords.Text; obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID2"]); res4 = obj_Class.Update_InvoiceBilling_Details(); } if (txt_Desc3.Text != string.Empty) { obj_Class.Particulars = txt_Desc3.Text; if (txt_Quantity3.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity3.Text); } obj_Class.Rate = Convert.ToSingle(txt_Rate3.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount3.Text); obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); string AmountWords = Get_GrandTotal(); txt_AmountInwords.Text = AmountWords; obj_Class.AmountInwords = txt_AmountInwords.Text; obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID3"]); res4 = obj_Class.Update_InvoiceBilling_Details(); } if (txt_Desc4.Text != string.Empty) { obj_Class.Particulars = txt_Desc4.Text; if (txt_Quantity4.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity4.Text); } obj_Class.Rate = Convert.ToSingle(txt_Rate4.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount4.Text); obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); string AmountWords = Get_GrandTotal(); txt_AmountInwords.Text = AmountWords; obj_Class.AmountInwords = txt_AmountInwords.Text; obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID4"]); res4 = obj_Class.Update_InvoiceBilling_Details(); } if (res3 == 1 && res4 == 1) { //ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Invoice Details Inserted Successfully');</script>"); this.Page.ClientScript.RegisterStartupScript(typeof(Page), "notification", "window.alert('Invoice Details Updated Successfully! With The BillNo is " + txt_InvoiceID.Text + "');", true); Clearfields(); Get_InvoiceID(); txt_Password.Text = ""; txt_Username.Text = ""; } } catch (Exception ex) { } } else { this.Page.ClientScript.RegisterStartupScript(typeof(Page), "notification", "window.alert('Invalid Username and Password');", true); txt_Password.Text = ""; txt_Username.Text = ""; } } protected void btn_EditCalculationst_Click(object sender, EventArgs e) { if (Convert.ToInt32(Session["Tblcount"]) == 4) { Amount1 = (Convert.ToDouble(txt_Quantity1.Text) * Convert.ToDouble(txt_Rate1.Text)); Amount2 = (Convert.ToDouble(txt_Quantity2.Text) * Convert.ToDouble(txt_Rate2.Text)); Amount3 = (Convert.ToDouble(txt_Quantity3.Text) * Convert.ToDouble(txt_Rate3.Text)); Amount4 = (Convert.ToDouble(txt_Quantity4.Text) * Convert.ToDouble(txt_Rate4.Text)); AmtTotal = (Amount1 + Amount2 + Amount3 + Amount4); STax = (AmtTotal) * Convert.ToDouble(txt_Tax12per.Text) / 100; ECess = (STax * Convert.ToDouble(txt_Tax2per.Text) / 100); HesCess = (STax * Convert.ToDouble(txt_Tax1per.Text) / 100); TotalGrand = (AmtTotal + STax + ECess + HesCess); txt_Amount1.Text = Amount1.ToString(); txt_Amount2.Text = Amount2.ToString(); txt_Amount3.Text = Amount3.ToString(); txt_Amount4.Text = Amount4.ToString(); txt_GrandTotal.Text = AmtTotal.ToString(); txt_12percent.Text = STax.ToString(); txt_2percent.Text = ECess.ToString(); txt_1percent.Text = HesCess.ToString(); txt_Total.Text = Math.Round(TotalGrand, 0).ToString(); txt_AmountInwords.Text = retWord(Convert.ToInt32(TotalGrand))+" Only"; } if (Convert.ToInt32(Session["Tblcount"]) == 3) { Amount1 = (Convert.ToDouble(txt_Quantity1.Text) * Convert.ToDouble(txt_Rate1.Text)); Amount2 = (Convert.ToDouble(txt_Quantity2.Text) * Convert.ToDouble(txt_Rate2.Text)); Amount3 = (Convert.ToDouble(txt_Quantity3.Text) * Convert.ToDouble(txt_Rate3.Text)); AmtTotal = (Amount1 + Amount2 + Amount3); STax = (AmtTotal) * Convert.ToDouble(txt_Tax12per.Text) / 100; ECess = (STax * Convert.ToDouble(txt_Tax2per.Text) / 100); HesCess = (STax * Convert.ToDouble(txt_Tax1per.Text) / 100); TotalGrand = (AmtTotal + STax + ECess + HesCess); txt_Amount1.Text = Amount1.ToString(); txt_Amount2.Text = Amount2.ToString(); txt_Amount3.Text = Amount3.ToString(); txt_GrandTotal.Text = AmtTotal.ToString(); txt_12percent.Text = STax.ToString(); txt_2percent.Text = ECess.ToString(); txt_1percent.Text = HesCess.ToString(); txt_Total.Text = Math.Round(TotalGrand, 0).ToString(); txt_AmountInwords.Text = retWord(Convert.ToInt32(TotalGrand)) + " Only"; } if (Convert.ToInt32(Session["Tblcount"]) == 2) { Amount1 = (Convert.ToDouble(txt_Quantity1.Text) * Convert.ToDouble(txt_Rate1.Text)); Amount2 = (Convert.ToDouble(txt_Quantity2.Text) * Convert.ToDouble(txt_Rate2.Text)); AmtTotal = (Amount1 + Amount2); STax = (AmtTotal) * Convert.ToDouble(txt_Tax12per.Text) / 100; ECess = (STax * Convert.ToDouble(txt_Tax2per.Text) / 100); HesCess = (STax * Convert.ToDouble(txt_Tax1per.Text) / 100); TotalGrand = (AmtTotal + STax + ECess + HesCess); txt_Amount1.Text = Amount1.ToString(); txt_Amount2.Text = Amount2.ToString(); txt_GrandTotal.Text = AmtTotal.ToString(); txt_12percent.Text = STax.ToString(); txt_2percent.Text = ECess.ToString(); txt_1percent.Text = HesCess.ToString(); txt_Total.Text = Math.Round(TotalGrand, 0).ToString(); txt_AmountInwords.Text = retWord(Convert.ToInt32(TotalGrand)) + " Only"; } if (Convert.ToInt32(Session["Tblcount"]) == 1) { Amount1 = (Convert.ToDouble(txt_Quantity1.Text) * Convert.ToDouble(txt_Rate1.Text)); AmtTotal = (Amount1); STax = (AmtTotal) * Convert.ToDouble(txt_Tax12per.Text) / 100; ECess = (STax * Convert.ToDouble(txt_Tax2per.Text) / 100); HesCess = (STax * Convert.ToDouble(txt_Tax1per.Text) / 100); TotalGrand = (AmtTotal + STax + ECess + HesCess); txt_Amount1.Text = Amount1.ToString(); txt_GrandTotal.Text = AmtTotal.ToString(); txt_12percent.Text = STax.ToString(); txt_2percent.Text = ECess.ToString(); txt_1percent.Text = HesCess.ToString(); txt_Total.Text = Math.Round (TotalGrand,0).ToString(); txt_AmountInwords.Text = retWord(Convert.ToInt32(TotalGrand)) + " Only"; } } protected void btn_Update_Click(object sender, EventArgs e) { try { Assign_InvoiceDetails(); res3 = obj_Class.Update_InvoiceBilling(); if (txt_Desc1.Text != string.Empty) { //obj_Class.Particulars = txt_Desc1.Text; if (txt_Quantity1.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity1.Text); } txt_AmountInwords.Text = ""; obj_Class.Rate = Convert.ToSingle(txt_Rate1.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount1.Text); obj_Class.ServiceTax = Convert.ToSingle(txt_Tax12per.Text); obj_Class.EducationCess = Convert.ToSingle(txt_Tax2per.Text); obj_Class.HigherEducationCess = Convert.ToSingle(txt_Tax1per.Text); obj_Class.Tax12percent = Convert.ToSingle(txt_12percent.Text); obj_Class.Tax2percent = Convert.ToSingle(txt_2percent.Text); obj_Class.Tax1percent = Convert.ToSingle(txt_1percent.Text); obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); string AmountWords = Get_GrandTotal(); txt_AmountInwords.Text = AmountWords; obj_Class.AmountInwords = txt_AmountInwords.Text; obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID1"]); res4 = obj_Class.Update_InvoiceBilling_DetailsWithoutFirstParticulars(); } if (txt_Desc2.Text != string.Empty) { obj_Class.Particulars = txt_Desc2.Text; if (txt_Quantity2.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity2.Text); } obj_Class.Rate = Convert.ToSingle(txt_Rate2.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount2.Text); obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); string AmountWords = Get_GrandTotal(); txt_AmountInwords.Text = AmountWords; obj_Class.AmountInwords = txt_AmountInwords.Text; obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID2"]); res4 = obj_Class.Update_InvoiceBilling_Details(); } if (txt_Desc3.Text != string.Empty) { obj_Class.Particulars = txt_Desc3.Text; if (txt_Quantity3.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity3.Text); } obj_Class.Rate = Convert.ToSingle(txt_Rate3.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount3.Text); obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); string AmountWords = Get_GrandTotal(); txt_AmountInwords.Text = AmountWords; obj_Class.AmountInwords = txt_AmountInwords.Text; obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID3"]); res4 = obj_Class.Update_InvoiceBilling_Details(); } if (txt_Desc4.Text != string.Empty) { obj_Class.Particulars = txt_Desc4.Text; if (txt_Quantity4.Text == string.Empty) { obj_Class.QuantityNoofTrucks = 0; } else { obj_Class.QuantityNoofTrucks = Convert.ToInt32(txt_Quantity4.Text); } obj_Class.Rate = Convert.ToSingle(txt_Rate4.Text); obj_Class.Amount = Convert.ToSingle(txt_Amount4.Text); obj_Class.Total = Convert.ToSingle(txt_GrandTotal.Text); obj_Class.GrandTotal = Convert.ToSingle(txt_Total.Text); string AmountWords = Get_GrandTotal(); txt_AmountInwords.Text = AmountWords; obj_Class.AmountInwords = txt_AmountInwords.Text; obj_Class.InvoiceBillID = Convert.ToInt32(Session["InvoiceBillID4"]); res4 = obj_Class.Update_InvoiceBilling_Details(); } if (res3 == 1 && res4 == 1) { //ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Invoice Details Inserted Successfully');</script>"); this.Page.ClientScript.RegisterStartupScript(typeof(Page), "notification", "window.alert('Invoice Details Updated Successfully! With The BillNo is " + txt_InvoiceID.Text + "');", true); Clearfields(); Get_InvoiceID(); txt_Password.Text = ""; txt_Username.Text = ""; } } catch (Exception ex) { } } protected void btn_Report_Click(object sender, EventArgs e) { Response.Redirect("~/InvoiceBillReport.aspx"); } protected void btn_BillPayment_Click(object sender, EventArgs e) { Response.Redirect("~/InvoiceBillPayment.aspx"); } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; ////////////////////// // Gavin Macleod // ////////////////////// // S1715408 // // Honours Project // // BSc Computing // ////////////////////// namespace Prototype1 { public partial class SortPlayersForm : Form { List<Player> playerList = new List<Player>(); public Player SelectedPlayer { get; set; } = new Player(); public SortPlayersForm() { InitializeComponent(); LoadPlayersIntoList(); } /// <summary> /// Clears the rank lists and sorts all players /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSort_Click(object sender, EventArgs e) { ClearLists(); SortPlayersByRank(); } /// <summary> /// Loads all players from the db into the all players list box /// </summary> private void LoadPlayersIntoList() { playerList = SQLiteDataAccess.LoadPlayers(); if (playerList != null) { AllPlayersListBox.DataSource = playerList; AllPlayersListBox.DisplayMember = "Username"; } else { MessageBox.Show("There are no players to load, create one by going to 'File > New Player'", "No Players Found", MessageBoxButtons.OK, MessageBoxIcon.Error); } } /// <summary> /// Sorts players into rank list boxes /// </summary> private void SortPlayersByRank() { foreach(Player p in playerList) { switch (p.RankName) { case null : lstBoxNeutral.Items.Add(p); break; case "-": lstBoxNeutral.Items.Add(p); break; case "Lawful Good": lstBoxLawfulGood.Items.Add(p); break; case "Lawful Neutral": lstBoxLawfulNeutral.Items.Add(p); break; case "Neutral": lstBoxNeutral.Items.Add(p); break; case "Chaotic Neutral": lstBoxChaoticNeutral.Items.Add(p); break; case "Chaotic Evil": lstBoxChaoticEvil.Items.Add(p); break; } } } private void lstBoxChaoticEvil_SelectedIndexChanged(object sender, EventArgs e) { if(lstBoxChaoticEvil.SelectedItem != null) { SelectedPlayer = (Player)lstBoxChaoticEvil.SelectedItem; } } private void lstBoxChaoticNeutral_SelectedIndexChanged(object sender, EventArgs e) { if (lstBoxChaoticNeutral.SelectedItem != null) { SelectedPlayer = (Player)lstBoxChaoticNeutral.SelectedItem; } } private void lstBoxNeutral_SelectedIndexChanged(object sender, EventArgs e) { if (lstBoxNeutral.SelectedItem != null) { SelectedPlayer = (Player)lstBoxNeutral.SelectedItem; } } private void lstBoxLawfulNeutral_SelectedIndexChanged(object sender, EventArgs e) { if (lstBoxLawfulNeutral.SelectedItem != null) { SelectedPlayer = (Player)lstBoxLawfulNeutral.SelectedItem; } } private void lstBoxLawfulGood_SelectedIndexChanged(object sender, EventArgs e) { if (lstBoxLawfulGood.SelectedItem != null) { SelectedPlayer = (Player)lstBoxLawfulGood.SelectedItem; } } private void AllPlayersListBox_SelectedIndexChanged(object sender, EventArgs e) { if (AllPlayersListBox.SelectedItem != null) { SelectedPlayer = (Player)AllPlayersListBox.SelectedItem; } } /// <summary> /// Clears rank list boxes /// </summary> private void ClearLists() { lstBoxNeutral.Items.Clear(); lstBoxLawfulNeutral.Items.Clear(); lstBoxLawfulGood.Items.Clear(); lstBoxChaoticNeutral.Items.Clear(); lstBoxChaoticEvil.Items.Clear(); } //Opens any player that is selected in any list. Only the last selected player will be opened. private void btnOpenPlayer_Click(object sender, EventArgs e) { ViewPlayerForm viewPlayerForm = new ViewPlayerForm(SelectedPlayer); viewPlayerForm.Show(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace AudioToolNew.Models.Musicline { public class MusicContent { public string voiceFile { get; set; } public double voiceMilliSecond { get; set; } public string baidu_text { get; set; } } }
namespace Triton.Game.Mapping { using ns25; using ns26; using System; using System.Collections.Generic; using Triton.Game; using Triton.Game.Mono; [Attribute38("StringUtils")] public class StringUtils : MonoClass { public StringUtils(IntPtr address) : this(address, "StringUtils") { } public StringUtils(IntPtr address, string className) : base(address, className) { } public static bool CompareIgnoreCase(string a, string b) { object[] objArray1 = new object[] { a, b }; return MonoClass.smethod_14<bool>(TritonHs.MainAssemblyPath, "", "StringUtils", "CompareIgnoreCase", objArray1); } public static List<string> SplitLines(string str) { object[] objArray1 = new object[] { str }; Class245 class2 = MonoClass.smethod_15<Class245>(TritonHs.MainAssemblyPath, "", "StringUtils", "SplitLines", objArray1); if (class2 != null) { return class2.method_25(); } return null; } public static string StripNewlines(string str) { object[] objArray1 = new object[] { str }; return MonoClass.smethod_12(TritonHs.MainAssemblyPath, "", "StringUtils", "StripNewlines", objArray1); } public static string StripNonNumbers(string str) { object[] objArray1 = new object[] { str }; return MonoClass.smethod_12(TritonHs.MainAssemblyPath, "", "StringUtils", "StripNonNumbers", objArray1); } public static List<string> SPLIT_LINES_CHARS { get { Class245 class2 = MonoClass.smethod_7<Class245>(TritonHs.MainAssemblyPath, "", "StringUtils", "SPLIT_LINES_CHARS"); if (class2 != null) { return class2.method_25(); } return null; } } } }
namespace Inheritence { public class Text : Presentation { public string FontColor { get; set; } public int FontSize { get; set; } } }
namespace Logic.Resource { public interface IBasicResources { double CommonMetals { get; } double Hydrogen { get; } double RareEarthElements { get; } } }
namespace Enrollment.Forms.Configuration.SearchForm { public class SearchFilterDescriptor : SearchFilterDescriptorBase { public string Field { get; set; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Cognitive_Metier; namespace Cognitive_Application { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { static Grid menu { get; set; } static Frame frame { get; set; } static Home home { get; set; } static EmotionUI emotionUI { get; set; } static TextAnalysisUI textAnalysisUI { get; set; } static StatisticsUI statisticsUI { get; set; } /// <summary> /// Constructor /// </summary> public MainWindow() { InitializeComponent(); menu = Menu; frame = Container; emotionUI = new EmotionUI(); textAnalysisUI = new TextAnalysisUI(); statisticsUI = new StatisticsUI(); home = new Home(); SwitchPage("home"); } private void EmotionButton_Click(object sender, RoutedEventArgs e) { SwitchPage("Emotion"); } private void TextButton_Click(object sender, RoutedEventArgs e) { SwitchPage("TextAnalysis"); } private void StatisticsButton_Click(object sender, RoutedEventArgs e) { SwitchPage("Statistics"); } private void HomeButton_Click(object sender, MouseButtonEventArgs e) { SwitchPage("home"); } /// <summary> /// Set the frame's content with page who's name has been given in parameter /// </summary> /// <param name="pageName">Name of the page to display</param> public static void SwitchPage(string pageName) { if(pageName == "Emotion") { frame.Content = emotionUI; ShowMenu(); } else if(pageName == "TextAnalysis") { frame.Content = textAnalysisUI; ShowMenu(); } else if(pageName == "Statistics") { // Calculate the stats (update) statisticsUI.InitiateStatistics(); frame.Content = statisticsUI; ShowMenu(); } else { frame.Content = home; HideMenu(); } } /// <summary> /// Hide the menu grid /// </summary> static void HideMenu() { menu.Visibility = Visibility.Hidden; } /// <summary> /// Display the menu grid /// </summary> static void ShowMenu() { menu.Visibility = Visibility.Visible; } #region Esthetic private void HomeButton_MouseEnter(object sender, MouseEventArgs e) { HomeButton.Background = new SolidColorBrush(Color.FromRgb(63, 63, 63)); } private void HomeButton_MouseLeave(object sender, MouseEventArgs e) { HomeButton.Background = new SolidColorBrush(Color.FromRgb(32, 32, 32)); } private void EmotionButton_MouseEnter(object sender, MouseEventArgs e) { EmotionButton.Background = new SolidColorBrush(Color.FromRgb(20, 190, 196)); } private void EmotionButton_MouseLeave(object sender, MouseEventArgs e) { EmotionButton.Background = new SolidColorBrush(Color.FromRgb(17, 168, 171)); } private void TextButton_MouseEnter(object sender, MouseEventArgs e) { TextButton.Background = new SolidColorBrush(Color.FromRgb(128, 211, 247)); } private void TextButton_MouseLeave(object sender, MouseEventArgs e) { TextButton.Background = new SolidColorBrush(Color.FromRgb(79, 196, 246)); } private void StatisticsButton_MouseEnter(object sender, MouseEventArgs e) { StatisticsButton.Background = new SolidColorBrush(Color.FromRgb(244, 115, 136)); } private void StatisticsButton_MouseLeave(object sender, MouseEventArgs e) { StatisticsButton.Background = new SolidColorBrush(Color.FromRgb(230, 76, 101)); } #endregion Esthetic } }
namespace Zillow.Core.Constant { public static class ExceptionMessage { public const string EntityNotFound = "Not Found or it's Deleted"; public const string EmptyFile = "Can't Save an Empty File"; public const string InvalidEmail = "Email not Valid"; public const string UpdateEntityIdError = "Id property is a Primary Key and can't be modified"; public const string LoginFailure = "Error When Login to Server\nPlease Make Sure Your Email & Password is Correct"; public const string UserRegistrationFailure = "User registration failed for the following reasons:"; } }
using System.Collections.Generic; namespace JPAssets.Binary.Tests { /// <summary> /// This class contains predefined binary/value pairs for each primitive data type /// for use in unit tests. /// Note: Byte arrays declared within this class are defined in big-endian order /// (most significant byte first) for readability. /// </summary> internal static class BinaryTestData { internal static IEnumerable<object[]> GetBooleanPairs() { return new object[][] { new object[2] { (byte) 0, false }, new object[2] { (byte)0x01, true }, new object[2] { (byte)0x7F, true }, new object[2] { (byte)0x80, true }, new object[2] { (byte)0xFF, true } }; } internal static IEnumerable<object[]> GetSBytePairs() { return new object[][] { new object[2]{ (byte) 0, (sbyte)0 }, new object[2]{ (byte)0x01, (sbyte)1 }, new object[2]{ (byte)0x7F, (sbyte)127 }, new object[2]{ (byte)0x80, (sbyte)-128 }, new object[2]{ (byte)0xFF, (sbyte)-1 } }; } internal static IEnumerable<object[]> GetCharPairs() { return new object[][] { new object[2] { new byte[2] { 0, 0 }, (char)0 }, new object[2] { new byte[2] { 0, 0x01 }, (char)1 }, new object[2] { new byte[2] { 0, 0x80 }, (char)128 }, new object[2] { new byte[2] { 0, 0xFF }, (char)255 }, new object[2] { new byte[2] { 0x01, 0 }, (char)256 }, new object[2] { new byte[2] { 0x04, 0 }, (char)1024 }, new object[2] { new byte[2] { 0xFF, 0xFF }, (char)65535 } }; } internal static IEnumerable<object[]> GetInt16Pairs() { return new object[][] { new object[2] { new byte[2] { 0, 0 }, (short)0 }, new object[2] { new byte[2] { 0, 0x01 }, (short)+1 }, new object[2] { new byte[2] { 0, 0x80 }, (short)+128 }, new object[2] { new byte[2] { 0, 0xFF }, (short)+255 }, new object[2] { new byte[2] { 0x01, 0 }, (short)+256 }, new object[2] { new byte[2] { 0x04, 0 }, (short)+1024 }, new object[2] { new byte[2] { 0x7F, 0xFF }, (short)+32767 }, new object[2] { new byte[2] { 0x80, 0 }, (short)-32768 }, new object[2] { new byte[2] { 0xFF, 0xFF }, (short)-1 } }; } internal static IEnumerable<object[]> GetUInt16Pairs() { return new object[][] { new object[2] { new byte[2] { 0, 0 }, (ushort)0 }, new object[2] { new byte[2] { 0, 0x01 }, (ushort)1 }, new object[2] { new byte[2] { 0, 0x80 }, (ushort)128 }, new object[2] { new byte[2] { 0, 0xFF }, (ushort)255 }, new object[2] { new byte[2] { 0x01, 0 }, (ushort)256 }, new object[2] { new byte[2] { 0x04, 0 }, (ushort)1024 }, new object[2] { new byte[2] { 0xFF, 0xFF }, (ushort)65535 } }; } internal static IEnumerable<object[]> GetInt32Pairs() { return new object[][] { new object[2] { new byte[4] { 0, 0, 0, 0 }, (int)0 }, new object[2] { new byte[4] { 0, 0, 0, 0x01 }, (int)+1 }, new object[2] { new byte[4] { 0, 0, 0, 0x80 }, (int)+128 }, new object[2] { new byte[4] { 0, 0, 0, 0xFF }, (int)+255 }, new object[2] { new byte[4] { 0, 0, 0x01, 0 }, (int)+256 }, new object[2] { new byte[4] { 0, 0, 0x04, 0 }, (int)+1024 }, new object[2] { new byte[4] { 0, 0, 0x7F, 0xFF }, (int)+32767 }, new object[2] { new byte[4] { 0, 0x80, 0, 0 }, (int)+8388608 }, new object[2] { new byte[4] { 0x7F, 0xFF, 0xFF, 0xFF }, (int)+2147483647 }, new object[2] { new byte[4] { 0x80, 0, 0, 0 }, (int)-2147483648 }, new object[2] { new byte[4] { 0xFF, 0xFF, 0x80, 0 }, (int)-32768 }, new object[2] { new byte[4] { 0xFF, 0xFF, 0xFF, 0xFF }, (int)-1 } }; } internal static IEnumerable<object[]> GetUInt32Pairs() { return new object[][] { new object[2] { new byte[4] { 0, 0, 0, 0 }, (uint)0 }, new object[2] { new byte[4] { 0, 0, 0, 0x01 }, (uint)1 }, new object[2] { new byte[4] { 0, 0, 0, 0x80 }, (uint)128 }, new object[2] { new byte[4] { 0, 0, 0, 0xFF }, (uint)255 }, new object[2] { new byte[4] { 0, 0, 0x01, 0 }, (uint)256 }, new object[2] { new byte[4] { 0, 0, 0x04, 0 }, (uint)1024 }, new object[2] { new byte[4] { 0, 0, 0x7F, 0xFF }, (uint)32767 }, new object[2] { new byte[4] { 0, 0x80, 0, 0 }, (uint)8388608 }, new object[2] { new byte[4] { 0x7F, 0xFF, 0xFF, 0xFF }, (uint)2147483647 }, new object[2] { new byte[4] { 0x80, 0, 0, 0 }, (uint)2147483648 }, new object[2] { new byte[4] { 0xFF, 0xFF, 0xFF, 0xFF }, (uint)4294967295 } }; } internal static IEnumerable<object[]> GetInt64Pairs() { return new object[][] { new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }, (long)0 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0x01 }, (long)+1 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0x80 }, (long)+128 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0xFF }, (long)+255 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0x01, 0 }, (long)+256 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0x04, 0 }, (long)+1024 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0x7F, 0xFF }, (long)+32767 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0x80, 0, 0 }, (long)+8388608 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0x7F, 0xFF, 0xFF, 0xFF }, (long)+2147483647 }, new object[2] { new byte[8] { 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, (long)+9223372036854775807 }, new object[2] { new byte[8] { 0x80, 0, 0, 0, 0, 0, 0, 0 }, (long)-9223372036854775808 }, new object[2] { new byte[8] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0 }, (long)-256 }, new object[2] { new byte[8] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, (long)-1 } }; } internal static IEnumerable<object[]> GetUInt64Pairs() { return new object[][] { new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }, (ulong)0 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0x01 }, (ulong)1 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0x80 }, (ulong)128 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0xFF }, (ulong)255 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0x01, 0 }, (ulong)256 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0x04, 0 }, (ulong)1024 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0x7F, 0xFF }, (ulong)32767 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0x80, 0, 0 }, (ulong)8388608 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0x7F, 0xFF, 0xFF, 0xFF }, (ulong)2147483647 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0x80, 0, 0, 0 }, (ulong)2147483648 }, new object[2] { new byte[8] { 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF }, (ulong)4294967295 }, new object[2] { new byte[8] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0 }, (ulong)18446744073709551360 }, new object[2] { new byte[8] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, (ulong)18446744073709551615 } }; } internal static IEnumerable<object[]> GetSinglePairs() { return new object[][] { new object[2] { new byte[4] { 0, 0, 0, 0 }, (float)0f }, new object[2] { new byte[4] { 0x3D, 0xCC, 0xCC, 0xCD }, (float)+0.1f }, new object[2] { new byte[4] { 0xBD, 0xCC, 0xCC, 0xCD }, (float)-0.1f }, new object[2] { new byte[4] { 0x3C, 0x23, 0xD7, 0x0A }, (float)+0.01f }, new object[2] { new byte[4] { 0xBC, 0x23, 0xD7, 0x0A }, (float)-0.01f }, new object[2] { new byte[4] { 0x38, 0xD1, 0xB7, 0x17 }, (float)+0.0001f }, new object[2] { new byte[4] { 0xB8, 0xD1, 0xB7, 0x17 }, (float)-0.0001f }, new object[2] { new byte[4] { 0x3F, 0x80, 0, 0 }, (float)+1f }, new object[2] { new byte[4] { 0xBF, 0x80, 0, 0 }, (float)-1f }, new object[2] { new byte[4] { 0x42, 0xC8, 0, 0 }, (float)+100f }, new object[2] { new byte[4] { 0xC2, 0xC8, 0, 0 }, (float)-100f }, new object[2] { new byte[4] { 0x3F, 0x9E, 0x06, 0x10 }, (float)+1.23456f }, new object[2] { new byte[4] { 0xBF, 0x9E, 0x06, 0x10 }, (float)-1.23456f }, new object[2] { new byte[4] { 0x7F, 0x7F, 0xFF, 0xFF }, (float)float.MaxValue }, new object[2] { new byte[4] { 0xFF, 0x7F, 0xFF, 0xFF }, (float)float.MinValue } }; } internal static IEnumerable<object[]> GetDoublePairs() { return new object[][] { new object[2] { new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }, (double)0d }, new object[2] { new byte[8] { 0x3F, 0xB9, 0x99, 0x99, 0x99, 0x99, 0x99, 0x9A }, (double)+0.1d }, new object[2] { new byte[8] { 0xBF, 0xB9, 0x99, 0x99, 0x99, 0x99, 0x99, 0x9A }, (double)-0.1d }, new object[2] { new byte[8] { 0x3F, 0x84, 0x7A, 0xE1, 0x47, 0xAE, 0x14, 0x7B }, (double)+0.01d }, new object[2] { new byte[8] { 0xBF, 0x84, 0x7A, 0xE1, 0x47, 0xAE, 0x14, 0x7B }, (double)-0.01d }, new object[2] { new byte[8] { 0x3F, 0x1A, 0x36, 0xE2, 0xEB, 0x1C, 0x43, 0x2D }, (double)+0.0001d }, new object[2] { new byte[8] { 0xBF, 0x1A, 0x36, 0xE2, 0xEB, 0x1C, 0x43, 0x2D }, (double)-0.0001d }, new object[2] { new byte[8] { 0x3F, 0xF0, 0, 0, 0, 0, 0, 0 }, (double)+1d }, new object[2] { new byte[8] { 0xBF, 0xF0, 0, 0, 0, 0, 0, 0 }, (double)-1d }, new object[2] { new byte[8] { 0x40, 0x59, 0, 0, 0, 0, 0, 0 }, (double)+100d }, new object[2] { new byte[8] { 0xC0, 0x59, 0, 0, 0, 0, 0, 0 }, (double)-100d }, new object[2] { new byte[8] { 0x3F, 0xF3, 0xC0, 0xC1, 0xFC, 0x8F, 0x32, 0x38 }, (double)+1.23456d }, new object[2] { new byte[8] { 0xBF, 0xF3, 0xC0, 0xC1, 0xFC, 0x8F, 0x32, 0x38 }, (double)-1.23456d }, new object[2] { new byte[8] { 0x7F, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, (double)double.MaxValue }, new object[2] { new byte[8] { 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, (double)double.MinValue } }; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SinavSistemi.Entity { public class DersEntity { public int dersID { get; set; } public string dersAd { get; set; } public int dersOgretmenID { get; set; } } }
// Copyright (c) Micro Support Center, Inc. All rights reserved. using System; using System.Collections.Generic; using System.Text; namespace CodeGenHero.Core.Metadata { /// <summary> /// Represents an index on a set of properties. /// </summary> public interface IIndex : IAnnotatable { /// <summary> /// Gets the entity type the index is defined on. This may be different from the type that <see cref="Properties" /> /// are defined on when the index is defined a derived type in an inheritance hierarchy (since the properties /// may be defined on a base type). /// </summary> IEntityType DeclaringEntityType { get; } /// <summary> /// Gets a value indicating whether the values assigned to the indexed properties are unique. /// </summary> bool IsUnique { get; } /// <summary> /// Gets the properties that this index is defined on. /// </summary> IList<IProperty> Properties { get; } } }
using BAKKAL_BLL.SqlRepostories; using BAKKAL_BOL.Entities; using BAKKAL_DAL.Contexts; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WFBakkal_Defter.Forms.UrunForms { public partial class FrmUrunZam : Form { public FrmUrunZam() { InitializeComponent(); } SqlRepository<Urun> repoUrun = new SqlRepository<Urun>(); SQLDbContext db = new SQLDbContext(); private void FrmUrunZam_Load(object sender, EventArgs e) { Yukle(); } void Yukle() { var urunler = from u in db.uruns orderby u.Ad ascending select new { u.ID, u.Ad }; cmbUrun.DataSource = urunler.ToList(); } private void btnGuncelle_Click(object sender, EventArgs e) { try { int u_id = Convert.ToInt16(cmbUrun.SelectedValue); Urun urun = repoUrun.Listele(w => w.ID == u_id).FirstOrDefault(); if(urun != null) { int zam = Convert.ToInt16(txtZamOrani.Text); decimal eskiFiyat = urun.SFiyat; decimal yenifiyat = eskiFiyat + (eskiFiyat * zam) / 100; urun.SFiyat = yenifiyat; repoUrun.Update(urun); txtZamOrani.Clear(); MessageBox.Show("Fiyatı " + eskiFiyat + " olan " + urun.Ad + " ürünün yeni fiyatı : " + yenifiyat,"BİLGİLENDİRME!"); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } private void btnKapat_Click(object sender, EventArgs e) { this.Close(); } } }
using bot_backEnd.Models.DbModels; using bot_backEnd.Models.ViewModels; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace bot_backEnd.DAL.Interfaces { public interface IRankDAL { Task<ActionResult<List<Rank>>> GetAllRanks(); Task<ActionResult<Rank>> AddNewRank(Rank rank, string image); Task<ActionResult<bool>> AddRankImages(Rank rank, string image); Task<ActionResult<bool>> DeleteRank(int rankID); Task<ActionResult<Rank>> ChangeRankData(RankVM rank); Task<ActionResult<bool>> ChangeRankLogo(int rankID, string image); } }
using System; using System.Net; using System.Windows.Data; namespace DataSetInDataGrid.Silverlight { public class DateTimeConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { try { DateTime date = (DateTime)value; if (parameter is string && parameter != null) return date.ToString((string)parameter); else return date.ToShortTimeString(); } catch (Exception e) { } return ""; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string strValue = value.ToString(); DateTime resultDateTime; if (DateTime.TryParse(strValue, out resultDateTime)) { return resultDateTime; } return value; } } }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using CppNet; using Nitra; using NUnit.Framework; namespace HlslParser.Tests { [TestFixture] public class HlslParserTests { [TestCaseSource("GetTestShaders")] public void CanParseShader(string testFile, string knownGoodFile) { // Preprocess test code using CppNet. var sourceCode = Preprocess(File.ReadAllText(testFile), testFile); // Parse test code. var sourceSnapshot = new SourceSnapshot(sourceCode); var parserHost = new ParserHost(); var compilationUnit = HlslGrammar.CompilationUnit(sourceSnapshot, parserHost); // Check for parse errors. if (!compilationUnit.IsSuccess) { throw new Exception(string.Join(Environment.NewLine, compilationUnit.GetErrors().Select(x => string.Format("Line {0}, Col {1}: {2}{3}{4}", x.Location.StartLineColumn.Line, x.Location.StartLineColumn.Column, x.Message, Environment.NewLine, x.Location.Source.GetSourceLine(x.Location.StartPos).GetText())))); } Assert.That(compilationUnit.IsSuccess, Is.True); // Get pretty-printed version of parse tree. var parseTree = compilationUnit.CreateParseTree(); var parsedCode = parseTree.ToString(); // Compare pretty-printed parse tree with known good version // (if known good version exists). if (File.Exists(knownGoodFile)) { var knownGoodCode = File.ReadAllText(knownGoodFile).Replace("\r\n", "\n"); Assert.That(parsedCode.Replace("\r\n", "\n"), Is.EqualTo(knownGoodCode)); } } private static IEnumerable<TestCaseData> GetTestShaders() { return Directory.GetFiles("Shaders", "*.hlsl", SearchOption.AllDirectories) .Select(x => new TestCaseData(x, Path.ChangeExtension(x, ".knowngood"))); } private static string Preprocess(string effectCode, string filePath) { var fullPath = Path.GetFullPath(filePath); var pp = new Preprocessor(); pp.EmitExtraLineInfo = false; pp.addFeature(Feature.LINEMARKERS); pp.setQuoteIncludePath(new List<string> { Path.GetDirectoryName(fullPath) }); pp.addInput(new StringLexerSource(effectCode, true, fullPath)); var result = new StringBuilder(); var endOfStream = false; while (!endOfStream) { var token = pp.token(); switch (token.getType()) { case Token.EOF: endOfStream = true; break; case Token.CCOMMENT: case Token.CPPCOMMENT: break; default: var tokenText = token.getText(); if (tokenText != null) result.Append(tokenText); break; } } return result.ToString(); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BuildInfoRetriever { /// <summary> /// Code generated via JSON by http://json2csharp.com/ /// </summary> public class BuildLogDetail { public int count { get; set; } public List<BuildStep> value { get; set; } } public class BuildStep { public int lineCount { get; set; } public string createdOn { get; set; } public string lastChangedOn { get; set; } public int id { get; set; } public string type { get; set; } public string url { get; set; } } }
using ChatApp.Lib.Azure.Storage; using ChatApp.Lib.Messaging.Model; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace ChatApp.Lib.Messaging.Persistence { /// <summary> /// Azure Table Storage based implementation of <see cref="IChatMessageRepository"/> /// </summary> public class AzureStorageChatMessageRepository : IChatMessageRepository { private readonly ITableStorageClient _client; public AzureStorageChatMessageRepository(ITableStorageClient client) { _client = client; } /// <inheritdoc /> public async Task<IEnumerable<ChatMessage>> GetMessages(int maxCount = 0) { //RowKey is "reverse" timestamp => returned entities or in latest to oldest order automatically var entities = await _client.GetAll<ChatMessageTableEntity>(maxCount).ConfigureAwait(false); return entities.Select(e => e.ToChatMessage()); } /// <inheritdoc /> public async Task InsertMessage(ChatMessage message) { if (message == null) { throw new ArgumentNullException("Message cannot be null", nameof(message)); } if (message.Id == Guid.Empty) { throw new ArgumentException(nameof(message.Id), "Message Id cannot be empty Guid"); } if (string.IsNullOrWhiteSpace(message.Handle)) { throw new ArgumentNullException("Message handle cannot be null or white space", nameof(message.Handle)); } await _client.InsertOrReplace(new ChatMessageTableEntity(message)); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; /// <summary> /// Mgallery의 요약 설명입니다. /// </summary> public class Mgallery { public string cjmgry_type { get; set; } public int cjmgry_id { get; set; } }
namespace Triton.Game.Mapping { using ns26; using System; using Triton.Game; using Triton.Game.Mono; [Attribute38("FbDebugOverride")] public class FbDebugOverride : MonoClass { public FbDebugOverride(IntPtr address) : this(address, "FbDebugOverride") { } public FbDebugOverride(IntPtr address, string className) : base(address, className) { } public static void Error(string msg) { object[] objArray1 = new object[] { msg }; MonoClass.smethod_18(TritonHs.MainAssemblyPath, "", "FbDebugOverride", "Error", objArray1); } public static void Info(string msg) { object[] objArray1 = new object[] { msg }; MonoClass.smethod_18(TritonHs.MainAssemblyPath, "", "FbDebugOverride", "Info", objArray1); } public static void Log(string msg) { object[] objArray1 = new object[] { msg }; MonoClass.smethod_18(TritonHs.MainAssemblyPath, "", "FbDebugOverride", "Log", objArray1); } public static void Warn(string msg) { object[] objArray1 = new object[] { msg }; MonoClass.smethod_18(TritonHs.MainAssemblyPath, "", "FbDebugOverride", "Warn", objArray1); } public static bool allowLogging { get { return MonoClass.smethod_6<bool>(TritonHs.MainAssemblyPath, "", "FbDebugOverride", "allowLogging"); } } } }
using System; using System.Collections.Generic; using System.Text; namespace Chess.Pieces { public class Knight : Piece { public Knight(Color color, int x, int y) : base(color, x, y) { } protected override IEnumerable<(int X, int Y)> GetPossibleMovements(Board board) { IEnumerable<(int X, int Y)> getDirectPositions() { yield return (X + 2, Y + 1); yield return (X + 2, Y - 1); yield return (X - 2, Y - 1); yield return (X - 2, Y + 1); yield return (X + 1, Y + 2); yield return (X + 1, Y - 2); yield return (X - 1, Y - 2); yield return (X - 1, Y + 2); } Piece tempPiece; foreach (var position in getDirectPositions()) if (IsInBounds(position.X, position.Y) && ((tempPiece = board[position.X, position.Y]) == default || tempPiece.Color == Color.Invert())) yield return position; } } }
using System.Threading.Tasks; namespace HseClass.Core.Services { public interface IAuthService { Task<object> Login(string email, string password); Task<object> Register(string email, string password, string name, RoleEnums role); } }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using System.IO; using CMS.Entities; namespace CMS { public partial class index : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { bind(); } private void bind() { WSCMS.WSCMS ws = new WSCMS.WSCMS(); var lst = ws.GetNovedadesAll(); var items = from item in lst select new { item.nov_identificador, item.titulo, item.descripcion_breve }; this.lvItems.DataSource = lst; lvItems.DataBind(); } } }
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApp1 { class Map { public int Height { get; set; } public int Width { get; set; } Tile[,] Board; public void InitMap() { Random r = new Random(); int randomX = r.Next(Width); int randomY = r.Next(Height); Board = new Tile[Width, Height]; for (int i = 0; i < Width; ++i) { for (int j = 0; j < Width; ++j) { Board[i, j] = new Tile(); } } Board[randomX, randomY].Items = new List<string>(); Board[randomX, randomY].Items.Add("Sword"); } public String Search(Location location) { var tile = Board[location.X, location.Y]; if (tile.Items != null) { return tile.Items[0]; } return ""; } } class Tile { public List<String> Items { get; set; } } }
using System; using System.IO; using Newtonsoft.Json.Linq; namespace Weather { public static class Safety { internal static T CheckNotNull<T>(T instance) { if (instance.Equals(null)) { throw new NullReferenceException(); } return instance; } internal static string ReadToEndOfStream(Stream stream) { try { return new StreamReader(stream).ReadToEnd(); } catch { return null; } } public static JToken GetJToken(JToken token, string key) { return GetJToken<JToken>(token, key, null); } public static string GetJTokenString(JToken token, string key) { return GetJToken(token, key, ""); } public static int GetJTokenInt(JToken token, string key) { return GetJToken(token, key, -1); } public static double GetJTokenDouble(JToken token, string key) { return GetJToken(token, key, -1d); } public static T GetJToken<T>(JToken token, string key, T failValue) { try { return token[key].ToObject<T>(); } catch { return failValue; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace PESWeb.Friends.Interface { public interface IConfirmFriendshipRequest { void LoadDisplay(string FriendInvitationKey, Int32 AccountID, string AccountFirstName, string AccountLastName, string SiteName); void ShowConfirmPanel(bool value); void ShowMessage(string Message); } }
namespace BaseProdutos { using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity.Spatial; public partial class Produtos { public string GuidProduto { get; set; } public string Gtin { get; set; } public string DescricaoNormalizada { get; set; } public string DescricaoUpper { get; set; } public string DescricaoAcento { get; set; } public string Peso { get; set; } public string Ncm { get; set; } public string Cest { get; set; } public string Marca { get; set; } public string Categoria { get; set; } public string Embalagem { get; set; } public decimal Quantidade { get; set; } public decimal PrecoMedio { get; set; } public string ImgGtin { get; set; } public string FotoPng { get; set; } public string FotoGif { get; set; } public string FotoTabloidePng { get; set; } public string FotoTabloideGif { get; set; } public DateTime CriadoEm { get; set; } public DateTime AtualizadoEm { get; set; } } }
using UnityEngine; using System.Collections; //Класс для хранения и обработки основных параметров игры public class MainGameScr : MonoBehaviour { public GameObject Obj_Ball, Obj_Star, Obj_Line; //Переменная хранения ссылки на префаб - шарик, префаб-звезду, префаб-платформу public GameObject Obj_ctimer, Obj_timer, Obj_scores, Obj_level, Obj_clevel; //Переменные для хранения ссылок на основные объекты отображения параметров игры private float V_ball_timer, V_ball_time; //Переменные для хранения времени между созданием шариков и времени создания последнего шарика private float V_level_time; //Переменная для хранения времени начала текущего уровня (чтобы перейти к следующему при превышении 30 секунд) private int V_scores; //Переменная хранения количества очков public int V_scores_add_sv //Свойство для изменения количества очков { set { V_scores += value; //изменяем количество очков Obj_scores.GetComponent<UILabel> ().text = V_scores.ToString(); //Отображаем текущеее количество очков PlayerPrefs.SetInt ("Score", V_scores); //Запоминаем количество очков } } private int V_level; //Переменная хранения текущего уровня public int V_level_sv //Свойство для изменения уровня { set { V_level = value; //Присваиваем новое значение уровня //Меняем скорость появления шариков в зависимости от уровня if (V_level == 1) V_ball_timer = 3f; else if (V_level == 2) V_ball_timer = 2.66f; else if (V_level == 3) V_ball_timer = 2.33f; else if (V_level == 4) V_ball_timer = 2f; else V_ball_timer = 2f - (float)(V_level-4)*0.1f; if (V_ball_timer < 0.5f) V_ball_timer = 0.5f; //Выводим текущий уровень посредством двух объектов на сцене Obj_level.GetComponent<UILabel> ().text = V_level.ToString(); Obj_clevel.GetComponent<UILabel> ().text = V_level.ToString(); } } void Awake () { //Инициализируем начальные параметры игры V_ball_time = Time.time; V_level_time = Time.time; V_level_sv = 1; PlayerPrefs.SetInt ("Score", 0); } void Update () { if (Network.isServer) { //Определяем время прошедшее с создания последнего шарика и при необходимости - создаем новый шарик if (Time.time - V_ball_time >= V_ball_timer) { V_ball_time += V_ball_timer; CreateBall(); } //Определяем время прошедшее с начала последнего уровня и при необходимости переходим к следующему уровню if (Time.time - V_level_time >= 30f) { V_level_time += 30f; V_level_sv = V_level+1; } //Выводим время до начала следующего уровня посредством двух объектов на сцене Obj_timer.GetComponent<UILabel> ().text = (1+(int)(30f - (Time.time - V_level_time))).ToString(); Obj_ctimer.GetComponent<UISprite> ().fillAmount = (Time.time - V_level_time)/(float)30f; } } //Метод для создания шариков void CreateBall() { Network.AllocateViewID (); GameObject Clone; Clone = Network.Instantiate (Obj_Ball, new Vector3(0f, 0f, 0f), Quaternion.identity, 0) as GameObject; Clone.transform.parent = GameObject.Find("Folder_ball").transform; Clone.transform.localPosition = new Vector3((Random.value-0.5f)*1000f, 550f, 0f); Clone.transform.localScale = new Vector3(1f, 1f, 1f); Clone.GetComponent<BallScr> ().Init (V_level); } //Метод для создания шариков-двойников public void CreateBallFake(Vector3 Pos, float V_sp_y) { Network.AllocateViewID (); GameObject Clone; Clone = Network.Instantiate (Obj_Ball, new Vector3(0f, 0f, 0f), Quaternion.identity, 0) as GameObject; Clone.transform.parent = GameObject.Find("Folder_ball").transform; Clone.transform.localPosition = Pos; Clone.transform.localScale = new Vector3(1f, 1f, 1f); Clone.GetComponent<BallScr> ().InitClone (V_sp_y); } }
using System; using System.Collections.Generic; using System.Text; using ENTITY; //<summary> //Summary description for ProductBatchInfo //</summary> namespace ENTITY { public class ProductBatchInfo { private decimal _productBatchId; private decimal _productId; private decimal _batchId; private string _partNo; private string _barcode; private string _extra1; private string _extra2; private DateTime _extraDate; public decimal ProductBatchId { get { return _productBatchId; } set { _productBatchId = value; } } public decimal ProductId { get { return _productId; } set { _productId = value; } } public decimal BatchId { get { return _batchId; } set { _batchId = value; } } public string PartNo { get { return _partNo; } set { _partNo = value; } } public string Barcode { get { return _barcode; } set { _barcode = value; } } public string Extra1 { get { return _extra1; } set { _extra1 = value; } } public string Extra2 { get { return _extra2; } set { _extra2 = value; } } public DateTime ExtraDate { get { return _extraDate; } set { _extraDate = value; } } } }
using System; using Microsoft.SPOT; using Microsoft.SPOT.Presentation; namespace SimpleFace { public class Device { public Device() { Border = new Border(); } public Border Border { get; set; } public static int ScreenHeight { get { return SystemMetrics.ScreenHeight; } } public static int ScreenWidth { get { return SystemMetrics.ScreenWidth; } } public static int AgentSize { get { return 128; } } public DateTime Time { get; set; } public string AMPM { get { if (Time.Hour >= 12) return "PM"; return "AM"; } } public string HourMinute { get { return Hour + ":" + Minute; } } public string Hour24Minute { get { return Hour24 + ":" + Minute; } } public string HourMinuteSecond { get { return Hour + ":" + Minute + ":" + Second; } } public string Hour24MinuteSecond { get { return Hour24 + ":" + Minute + ":" + Second; } } public string Month { get { return Time.Month.ToString(); } } public string Day { get { return Time.Day.ToString(); } } public string Year { get { return Time.Year.ToString(); } } public string MonthName { get { return System.Globalization.DateTimeFormatInfo.CurrentInfo.MonthNames[(int)Time.Month]; } } public string MonthNameShort { get { return System.Globalization.DateTimeFormatInfo.CurrentInfo.AbbreviatedMonthNames[(int)Time.Month]; } } public string DayOfWeek { get { return System.Globalization.DateTimeFormatInfo.CurrentInfo.DayNames[(int) Time.DayOfWeek]; } } public string ShortDate { get { return Year + "/" + Month + "/" + Day; } } public string Hour { get { Time = DateTime.Now; int hour = Time.Hour; if (hour > 12) hour = hour - 12; var h = hour.ToString(); return h; } } public string Hour24 { get { Time = DateTime.Now; var hour = Time.Hour.ToString(); if (hour.Length == 1) hour = "0" + hour; return hour; } } public string Minute { get { Time = DateTime.Now; var min = Time.Minute.ToString(); if (min.Length == 1) min = "0" + min; return min; } } public string Second { get { Time = DateTime.Now; var seconds = Time.Second.ToString(); if (seconds.Length == 1) seconds = "0" + seconds; return seconds; } } private object _lock = new object(); private Bitmap _DrawingSurface; private Painter _painter; public Painter Painter { get { return _painter; } } public Bitmap DrawingSurface { get { lock (_lock) { if (_DrawingSurface == null) { _DrawingSurface = new Bitmap(ScreenWidth, ScreenHeight); _painter = new Painter(_DrawingSurface); } } return _DrawingSurface; } } private Font _SmallFont = Resources.GetFont(Resources.FontResources.small); public Font SmallFont { get { return _SmallFont; } } private Font _NinaBFont = Resources.GetFont(Resources.FontResources.NinaB); public Font NinaBFont { get { return _NinaBFont; } } public static Point Center { get { return new Point(64, 64); } } private Font _Candara48NPSSp = Resources.GetFont(Resources.FontResources.Candara48NPSSp); public Font DefaultFont { get { return _Candara48NPSSp; } } private Font _medium = Resources.GetFont(Resources.FontResources.BookAntiquaNumbers); public Font MediumFont { get { return _medium; } } private Font _Digital12 = Resources.GetFont(Resources.FontResources.Digital712point); public Font Digital12 { get { return _Digital12; } } private Font _Digital20 = Resources.GetFont(Resources.FontResources.Digital720point); public Font Digital20 { get { return _Digital20; } } } }
using QuickProj.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace QuickProj.Controllers { public class BookController : Controller { public ApplicationDbContext _context; // GET: Book public BookController() { _context = new ApplicationDbContext(); } public ActionResult Index(string keyword) { return View(_context.Books.Where(k=>k.Name.Contains(keyword)||k.ISBN.Contains(keyword)||k.Author.Contains(keyword)||keyword==null).ToList()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Common.Console { /// <summary> /// Defines the options used for drawing simple ASCII boxes. /// </summary> public class AsciiBoxOptions : AsciiLineOptions { /// <summary> /// Text justification of lines. /// </summary> public AsciiLineJustification Justify { get; set; } /// <summary> /// Justification of the menu header. /// </summary> public AsciiLineJustification HeaderJustification { get; set; } /// <summary> /// The padding between the text and box border. /// </summary> public int Padding { get; set; } public AsciiBoxOptions() { Padding = 1; HeaderJustification = AsciiLineJustification.Center; Justify = AsciiLineJustification.Center; } } }
using MarsRoverAPI.Model; namespace MarsRoverAPI.Requests { public class LandTheRoverOnMarsRequest { public string RoverName { get; set; } public LocationInfo Location { get; set; } public string Heading { get; set; } } }
using System; using System.Collections.Generic; using System.Text; using AgentStoryComponents.core; using AgentStoryComponents; namespace AgentStoryComponents.commands { public class cmdCreateInvitation : ICommand { public MacroEnvelope execute(Macro macro) { utils ute = new utils(); int operatorID = MacroUtils.getParameterInt("operatorID", macro); int fromID = MacroUtils.getParameterInt("fromID", macro); string toUserIDs = MacroUtils.getParameterString("toUserIDs", macro); string toGroupIDs = MacroUtils.getParameterString("toGroupIDs", macro); string greeting64 = MacroUtils.getParameterString("greeting", macro); string subject64 = MacroUtils.getParameterString("subject", macro); string bodyContent64 = MacroUtils.getParameterString("bodyContent", macro); string inviteEventName64 = MacroUtils.getParameterString("inviteEventName", macro); string greeting = ute.decode64(greeting64); string subject = ute.decode64(subject64); string bodyContent = ute.decode64(bodyContent64); string inviteEventName = ute.decode64(inviteEventName64); string CreateInviteEmails = MacroUtils.getParameterString("CreateInviteEmails", macro); bool bCreateInviteEmails = Convert.ToBoolean(CreateInviteEmails); User by = new User(config.conn, operatorID); //create a unique pool of user id's List<int> userIDsTo = new List<int>(); System.Collections.Hashtable userIDsToIndex = new System.Collections.Hashtable(); //loop through user ID's string[] toUserIDsArray = toUserIDs.Split('|'); foreach (string userID in toUserIDsArray) { if (userID == "-1") continue; if (userID.Trim().Length == 0) break; int idToADD = Convert.ToInt32(userID); if (userIDsToIndex.ContainsKey("u_" + idToADD)) { //ignore continue; } else { userIDsToIndex.Add("u_" + idToADD, idToADD); userIDsTo.Add(idToADD); } } //loop through group ID's string[] toGroupsIDsArray = toGroupIDs.Split('|'); foreach (string groupID in toGroupsIDsArray) { if (groupID == "-1") continue; if (groupID.Trim().Length == 0) break; int nGrpID = Convert.ToInt32(groupID); Group tmpGroup = new Group(config.conn, nGrpID); List<User> tmpUsers = tmpGroup.GroupUsers; foreach (User tmpUser in tmpUsers) { int idToADD = tmpUser.ID; if (userIDsToIndex.ContainsKey("u_" + idToADD)) { //ignore continue; } else { userIDsToIndex.Add("u_" + idToADD, idToADD); userIDsTo.Add(idToADD); } } } User fromUser = new User(config.conn,fromID); List<string> inviteGUIDS = new List<string>(); int numInvites = 0; int numEmails = 0; if (userIDsTo.Count > 0) { //so there are some users to create invites for. for (int userCounter = 0; userCounter < userIDsTo.Count; userCounter++) { User toUser = new User(config.conn, userIDsTo[userCounter]); Invitation tmpInvite = new Invitation(config.conn, fromUser, toUser); tmpInvite.InviteEvent = inviteEventName64; tmpInvite.Title = subject64; string inviteBody = greeting + " " + toUser.FirstName + "."; inviteBody += " <br><br> " + bodyContent; bodyContent64 = ute.encode64(inviteBody); tmpInvite.InvitationText = bodyContent64; tmpInvite.InviteCode = toUser.OrigInviteCode; tmpInvite.Save(); string inviteGUID = tmpInvite.GUID; inviteGUIDS.Add(inviteGUID); numInvites++; if (bCreateInviteEmails) { string pickupURL = "http://"; pickupURL += config.host + "/"; if (config.app.Length > 0) { pickupURL += config.app + "/"; } pickupURL += "ViewInvitation2.aspx?guid=" + inviteGUID; EmailMsg email = new EmailMsg(config.conn, fromUser); email.to = toUser.Email; email.from = config.allEmailFrom; email.ReplyToAddress = fromUser.Email; email.subject = subject64; //DEAR ... email.body = greeting; email.body += " "; email.body += toUser.FirstName; email.body += "\r\n"; email.body += "\r\n"; email.body += fromUser.FirstName; email.body += " has sent you a personal invitation."; email.body += "\r\n"; email.body += "\r\n"; email.body += "To view it please use this link: "; email.body += "\r\n"; email.body += "\r\n"; email.body += pickupURL; email.body += "\r\n"; email.body += "\r\n"; email.body += "\r\n"; email.body += "\r\n"; email.body = ute.encode64(email.body); int emailID = email.Save(); numEmails++; } } } /* Having trouble? If you are unable to open this Evite, try copying the entire URL below into your browser: http://www.evite.com/pages/invite/viewInvite.jsp?inviteId=DDVUOLVCVWSOYCMSCLRS&li=iq&src=email Was this email unwanted? Manage your communication preferences. Replying to this email will reply directly to the sender. Your email address will be displayed. If you found this email in your junk/bulk folder, please add info@evite.com to ensure that you'll receive all future Evite invitations in your Inbox. */ //$TODO: LOG EASIER string msg = numInvites + " invites created "; if (numEmails > 0) msg += " with " + numEmails + " associated email messages. Please go to your messages and send them from your drafts folder"; StoryLog sl = new StoryLog(config.conn); sl.AddToLog(msg); sl = null; msg = ute.encode64(msg); MacroEnvelope me = new MacroEnvelope(); //group already added Macro m = new Macro("ProcessNewInvites", 1); m.addParameter("msg", msg); me.addMacro(m); return me; } } }
using System; using System.Collections.Generic; using System.Text; public class PickleJar : Jar<Pickle> {}
using System.Collections; using System.Collections.Generic; using UnityEngine; using Vuforia; public class ObjectLoaderTesti : MonoBehaviour { // string assetName = "model.cube"; // // Start is called before the first frame update // void Start() // { // string url = "https://hololensfiles.file.core.windows.net/objshare/Assetbundles/model.cube?st=2019-08-02T11%3A18%3A53Z&se=2019-08-03T11%3A18%3A53Z&sp=rl&sv=2018-03-28&sr=f&sig=O17QsoQLk4piyhCtkBSo4Q1loK1oSadVcCsyqRs6d8g%3D"; // WWW www = new WWW(url); // StartCoroutine(WaitForReq(www)); // } //IEnumerator WaitForReq(WWW www) // { // yield return www; // AssetBundle bundle = www.assetBundle; // if(www.error == null) // { // GameObject testi = (GameObject)bundle.LoadAsset("model.cube?st=2019-08-02T11%3A18%3A53Z&se=2019-08-03T11%3A18%3A53Z&sp=rl&sv=2018-03-28&sr=f&sig=O17QsoQLk4piyhCtkBSo4Q1loK1oSadVcCsyqRs6d8g%3D"); // Instantiate(testi); // } // else // { // Debug.Log(www.error); // } // } public string url; public GameObject objekti; public GameObject newParent; private void Start() { StartCoroutine(DownloadModel()); } IEnumerator DownloadModel() { WWW www = new WWW(url); yield return www; AssetBundle assetBundle = www.assetBundle; //GameObject g = Instantiate(assetBundle.LoadAsset("model.cube")) as GameObject; foreach (var name in assetBundle.GetAllAssetNames()) { GameObject gameObject = Instantiate(assetBundle.LoadAsset("lamppu")) as GameObject; gameObject.transform.localScale += new Vector3(001, 001, 001); } } //public void SetParent(GameObject newParent) //{ // gameObject.transform.parent = newParent.transform; //} }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class CloseWallManager : MonoBehaviour { [SerializeField] private float wallXMovementOnTrigger; [SerializeField] private float wallYMovementOnTrigger; private GameObject sprite; private float wallMovementSpeed; private Vector3 targetPosition; private CloseWallManager() { wallMovementSpeed = 7; } private void Awake() { sprite = transform.GetChild(0).gameObject; targetPosition = transform.position; } public void CloseWall() { transform.position = targetPosition; sprite.transform.position -= Vector3.up * wallYMovementOnTrigger; StartCoroutine(MoveWall()); } private IEnumerator MoveWall() { while (sprite.transform.position != targetPosition) { sprite.transform.position = Vector2.MoveTowards(sprite.transform.position, targetPosition, wallMovementSpeed * Time.deltaTime); yield return null; } } }
using Sirenix.OdinInspector; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; [Serializable] public class EarthNoise { public float noiseFrequency = 1; public float noiseStrength = 0.1f; public Vector3 noiseOffset; public float noiseThreshould = 0; public int noiseMultiLayer = 1; public float noiseFrequencyMulti = 2; // smaller than 1 [Range(0, 0.99f)] public float noiseStrenthMulti = 0.5f; }
using System.Collections; using System.Collections.Generic; using UnityEngine; using LitJson; using System.IO; public class DataBase : MonoBehaviour { //单例 private static DataBase mInstance; public static DataBase GetInstance() { return mInstance; } //物品 private JsonData ItemDataBase; private JsonData EnergyDataBase; private List<MyItem> ItemList = new List<MyItem>(); private List<MyEnergy> EnergyList = new List<MyEnergy>(); public const int STYLE_Item = 0; public const int STYLE_Energy = 1; //对话交互 private JsonData DialogDataBase; private List<DialogSystem> DialogList = new List<DialogSystem>(); //当前数据 public Save SaveGame = new Save(); /// <summary> /// 初始化数据库(Item和Energy) /// </summary> private void ConstructDataBase() { //加载物品 for (int i=0;i<ItemDataBase.Count;i++) { ItemList.Add(new MyItem(ItemDataBase[i]["ID"].ToString(), ItemDataBase[i]["Name"].ToString(), (int)ItemDataBase[i]["Pro"], ItemDataBase[i]["Description"].ToString() )); } //加载能量 for (int i = 0; i < EnergyDataBase.Count; i++) { EnergyList.Add(new MyEnergy(EnergyDataBase[i]["ID"].ToString(), EnergyDataBase[i]["Name"].ToString(), (int)EnergyDataBase[i]["Energy"], EnergyDataBase[i]["Description"].ToString() )); } //加载交互对话 for(int i=0;i<DialogDataBase.Count;i++) { DialogList.Add(new DialogSystem(DialogDataBase[i]["Player"].ToString(), DialogDataBase[i]["Info"].ToString() )); } } //===================Item读取数据 public MyItem FetchItemByID(string _id) { for(int i=0;i<ItemList.Count;i++) { if(_id==ItemList[i].ID) { return ItemList[i]; } } return null; } public MyItem FetchItemByName(string _name) { for (int i = 0; i < ItemList.Count; i++) { if (_name == ItemList[i].Name) { return ItemList[i]; } } return null; } //===================Energy读取数据 public MyEnergy FetchEnergyByID(string _id) { for (int i = 0; i < EnergyList.Count; i++) { if (_id == EnergyList[i].ID) { return EnergyList[i]; } } return null; } public MyEnergy FetchEnergyByName(string _name) { for (int i = 0; i < EnergyList.Count; i++) { if (_name == EnergyList[i].Name) { return EnergyList[i]; } } return null; } //===================Dialog读取数据 public DialogSystem FetchDialogByIndex(int _index) { if (_index >= DialogList.Count) return new DialogSystem(); return DialogList[_index]; } void Awake() { mInstance = this; ItemDataBase = JsonMapper.ToObject(File.ReadAllText(Application.dataPath + "/StreamingAssets/Items.json")); EnergyDataBase = JsonMapper.ToObject(File.ReadAllText(Application.dataPath + "/StreamingAssets/Energys.json")); DialogDataBase = JsonMapper.ToObject(File.ReadAllText(Application.dataPath + "/StreamingAssets/SystemNotification.json")); ConstructDataBase(); } // Use this for initialization void Start() { //单例 } // UpData is called once per frame void UpData () { } } public class MyItem { public string ID { get; set; } public string Name { get; set; } public float Probability { get; set; } public string Description { get; set; } public Sprite sprite { get; set; } public MyItem(string _id,string _name,float _probability,string _description) { ID = _id; Name = _name; Probability = _probability; Description = _description; sprite = Resources.Load<Sprite>("Items/" + Name); } public MyItem() { ID = "000"; } } public class MyEnergy { public string ID { get; set; } public string Name { get; set; } public int Energy { get; set; } public string Description { get; set; } public Sprite sprite { get; set; } public MyEnergy(string _id,string _name,int _energy, string _description) { ID = _id; Name = _name; Energy = _energy; Description = _description; sprite = Resources.Load<Sprite>("Energys/" + Name); } public MyEnergy() { ID = "000"; } } public class DialogSystem { public string Player; public string Info; public DialogSystem(string _player,string _info) { Player = _player; Info = _info; } public DialogSystem() { Player = ""; Info = ""; } } //存储当前信息类 public class Save { //存储能量 public int CurrentEnergy; public int MaxEnergy; //存储通信信息 public int DialogIndex; //存储生命值 public int CurrentPlayerHp; public int MaxPlayerHp; //存储天数...格式待定 // public Save() { CurrentEnergy = 50; MaxEnergy = 100; DialogIndex = 0; CurrentPlayerHp = 100; MaxPlayerHp = 100; } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace DBManager { public partial class frmGeneratePHP_CRUDexpandable : BlueForm { public frmGeneratePHP_CRUDexpandable(string tbl, string[] tbls) { InitializeComponent(); label1.Text = string.Format("Table {0} found as FK to the following tables, please which one will be shown as expandable. By double click on it.", tbl); lst.Items.AddRange(tbls); lst.SelectedIndex = 0; } public DialogResult ShowDialog(out int result) { DialogResult dialogResult = base.ShowDialog(); if (this.DialogResult == System.Windows.Forms.DialogResult.OK) result = lst.SelectedIndex; else result = -1; return dialogResult; } private void lst_DoubleClick(object sender, EventArgs e) { this.DialogResult = System.Windows.Forms.DialogResult.OK; } } }
namespace HackedBrain.BotBuilder.Samples.IdiomaticNetCore.BotWebApp { public class SampleBotState { public bool HasIssuedGreeting { get; set; } public int EchoCount { get; set; } } }
using Ast.Models; using Ast.Common; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Ast.HcNetWork { public class UserBaseController : BaseController { private readonly Hc_WebSetting _cacheWeb = CacheHelper.GetCache("WebSetting") as Hc_WebSetting; public UserBaseController() { OTAUsers user = CommFun.GetSession("LoginUser") as OTAUsers; if (user == null) return; CurrentUserId = user.Id; CurrentUserName = user.LoginName; CurrentRealName = user.RealName; OTAMSGUID = user.OTAMSGUID; IsAdmin = user.IsAdmin; IsLeader = user.IsLeader; CurrentUserType = user.UserType; CurrentDepartmentId = user.DepartmentId; CurrentPostId = user.PostId; var hcwebset = _cacheWeb; if (hcwebset == null) return; CurrentWebSet = hcwebset; } protected Hc_WebSetting CurrentWebSet { get; set; } protected string OTAMSGUID { get; set; } protected int CurrentUserId { get; set; } protected string CurrentUserName { get; set; } protected int CurrentUserType { get; set; } protected int CurrentDepartmentId { get; set; } protected int IsLeader { get; set; } protected int IsAdmin { get; set; } protected string CurrentRealName { get; set; } protected int CurrentPostId { get; set; } } }
using MXDbHelper; using System.Configuration; namespace MailHelper { /// <summary> /// 文件设置 /// </summary> public class MailFile { /// <summary> /// 结构化 /// </summary> public MailFile() { } /// <summary> /// 结构化--文件编号自动转换 /// </summary> /// <param name="strMailNo">邮件序号</param> /// <param name="strAttachSn"></param> /// <param name="strPos"></param> public MailFile(string strMailNo, string strAttachSn, string strPos = null) { FileAttach file = FileAttachConvert.ToFile(strAttachSn); this.AttachSn = file.AttachSn; this.OriginalName = file.OriginalName; this.FileType = file.FileType; this.BodyPosition = strPos; this.MailNo = strMailNo; this.FilePath = ConfigurationManager.AppSettings.Get("File").ToString() + "\\" + file.FormalDir + "\\" + this.OriginalName + this.FileType; } /// <summary> /// 邮件编号 /// </summary> public string MailNo { get; set; } /// <summary> /// 文件编号 /// </summary> public string AttachSn { get; set; } /// <summary> /// 原始文件 /// </summary> public string OriginalName { get; set; } /// <summary> /// 文件类型 /// </summary> public string FileType { get; set; } /// <summary> /// 文件下载路径 /// </summary> public string FileUrl { get { return ConfigurationManager.AppSettings.Get("FileUrl") + this.AttachSn + this.FileType; } } /// <summary> /// 文件路径 /// </summary> public string FilePath { get; set; } /// <summary> /// /// </summary> public string BodyPosition { get; set; } } }
using CompleteThisSentence.Data; using CompleteThisSentence.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace CompleteThisSentence.Controllers { public class KishnakController : Controller { private KishnakAnswers Answers { get; set; } private KishnakModel Model { get; set; } public KishnakController() { Answers = new KishnakAnswers(); Model = new KishnakModel(); } public ActionResult Kishnak() { return View(); } [HttpPost] public ActionResult KishnakAnswers() { return Content(Model.AnswerBuilder()); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; using WebAPIRoutingExample.Filters; using WebAPIRoutingExample.Models; namespace WebAPIRoutingExample.Controllers { [MyModelValidation] public class UserController : ApiController { // POST: api/User [HttpPost] public HttpResponseMessage Post([FromBody] User value) { return Request.CreateResponse(HttpStatusCode.Created, "Kullanıcı Oluşturuldu"); } } }
using System; using System.Collections.Generic; using UnityEditor; using UnityEngine; namespace AorFramework.NodeGraph { [NodeToolItem("#<3>", "AorFramework.NodeGraph.AssetNodeGraphToolItemDefinder", "CreatePrefabProcessor")] public class PrefabProcessorGUIController : NodeGUIController { private GUIStyle _describeStyle; private GUIStyle _resultInfoStyle; public override string GetNodeLabel() { return AssetNodeGraphLagDefind.GetLabelDefine(3); } private Vector2 _NodeMinSize = new Vector2(230, 120); public override Vector2 GetNodeMinSizeDefind() { return _NodeMinSize; } public override List<ConnectionPointGUI> GetConnectionPointInfo(GetConnectionPointMode GetMode) { if (_ConnectionPointGUIList == null) { ConnectionPointGUI p0 = new ConnectionPointGUI(100, 0, 2, typeof(string[]).Name, "PathInput", m_nodeGUI, AssetNodeGraphLagDefind.GetLabelDefine(10) + AssetNodeGraphLagDefind.GetLabelDefine(7), new Vector2(100, 60), ConnectionPointInoutType.MutiInput); ConnectionPointGUI p1 = new ConnectionPointGUI(101, 1, 2, typeof(int[]).Name, "PrefabInput", m_nodeGUI, AssetNodeGraphLagDefind.GetLabelDefine(9) + AssetNodeGraphLagDefind.GetLabelDefine(7), new Vector2(100, 60), ConnectionPointInoutType.MutiInput); ConnectionPointGUI p2 = new ConnectionPointGUI(200, 0, 1, typeof(string[]).Name, "AssetsPath", m_nodeGUI, AssetNodeGraphLagDefind.GetLabelDefine(8), new Vector2(100, 60), ConnectionPointInoutType.Output); _ConnectionPointGUIList = new List<ConnectionPointGUI>() {p0, p1, p2}; } return _GetConnectionPointsByMode(GetMode); } public override void DrawConnectionTip(Vector3 centerPos, ConnectionGUI connection) { //string string info = "0"; string[] assetList = (string[])m_nodeGUI.data.ref_GetField_Inst_Public("AssetsPath"); if (assetList != null) { info = assetList.Length.ToString(); } //size Vector2 CTSzie = new Vector2(NodeGraphTool.GetConnectCenterTipLabelWidth(info) + 4, NodeGraphDefind.ConnectCenterTipLabelPreHeight); //rect connection.CenterRect = new Rect(centerPos.x - CTSzie.x * 0.5f, centerPos.y - CTSzie.y * 0.5f, CTSzie.x, CTSzie.y); //ConnectionTip GUI.Label(connection.CenterRect, info, GetConnectCenterTipStyle()); //右键菜单检测 if (Event.current.button == 1 && Event.current.isMouse && connection.CenterRect.Contains(Event.current.mousePosition)) { DrawCenterTipContextMenu(connection); Event.current.Use(); } } public override void DrawNodeInspector(float inspectorWidth) { if (m_nodeGUI == null) return; GUILayout.BeginVertical("box", GUILayout.Width(inspectorWidth)); string oguid = (string)m_nodeGUI.data.ref_GetField_Inst_Public("CustomScriptGUID"); if (!string.IsNullOrEmpty(oguid)) { string customPath = AssetDatabase.GUIDToAssetPath(oguid); if (!string.IsNullOrEmpty(customPath)) { UnityEngine.Object custom = AssetDatabase.LoadMainAssetAtPath(customPath); if (custom != null) { UnityEngine.Object n = EditorGUILayout.ObjectField(AssetNodeGraphLagDefind.GetLabelDefine(4), custom, typeof(MonoScript), false); if (n != custom) { string guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(n)); if (!string.IsNullOrEmpty(guid)) { if((bool)m_nodeGUI.controller.ref_InvokeMethod_Inst_NonPublic("_getCustomScript", new object[] { guid })) { m_nodeGUI.data.ref_SetField_Inst_Public("CustomScriptGUID", guid); m_nodeGUI.SetDirty(); } } } //显示描述 string des = (string) m_nodeGUI.data.ref_GetField_Inst_Public("CustomScriptDescribe"); if (!string.IsNullOrEmpty(des)) { if (_describeStyle == null) { _describeStyle = GUI.skin.GetStyle("box"); _describeStyle.fontSize = 12; _describeStyle.alignment = TextAnchor.MiddleLeft; _describeStyle.wordWrap = true; _describeStyle.normal.textColor = Color.white; } GUILayout.Label(AssetNodeGraphLagDefind.GetLabelDefine(5) + " : " + des, _describeStyle); } } else { m_nodeGUI.data.ref_SetField_Inst_Public("CustomScriptGUID", null); m_nodeGUI.data.ref_SetField_Inst_Public("CustomScriptDescribe", null); m_nodeGUI.SetDirty(); } } else { m_nodeGUI.data.ref_SetField_Inst_Public("CustomScriptGUID", null); m_nodeGUI.data.ref_SetField_Inst_Public("CustomScriptDescribe", null); m_nodeGUI.SetDirty(); } } else { UnityEngine.Object n = EditorGUILayout.ObjectField(AssetNodeGraphLagDefind.GetLabelDefine(4), null, typeof (MonoScript), false); if (n != null) { string guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(n)); if (!string.IsNullOrEmpty(guid)) { if ((bool)m_nodeGUI.controller.ref_InvokeMethod_Inst_NonPublic("_getCustomScript", new object[] { guid })) { m_nodeGUI.data.ref_SetField_Inst_Public("CustomScriptGUID", guid); m_nodeGUI.SetDirty(); } } } } //显示结果信息 string[] scriptResultInfo = (string[]) m_nodeGUI.data.ref_GetField_Inst_Public("CustomScriptResultInfo"); if (scriptResultInfo != null) { GUILayout.Space(10); string rid = (string)m_nodeGUI.data.ref_GetField_Inst_Public("ResultInfoDescribe"); if (string.IsNullOrEmpty(rid)) { GUILayout.Label(AssetNodeGraphLagDefind.GetLabelDefine(6) + ":"); } else { GUILayout.Label(rid + ":"); } GUILayout.Space(6); GUILayout.BeginVertical("box"); int i, len = scriptResultInfo.Length; for (i = 0; i < len; i++) { if (_resultInfoStyle == null) { _resultInfoStyle = GUI.skin.label; _resultInfoStyle.alignment = TextAnchor.MiddleLeft; _resultInfoStyle.wordWrap = true; _resultInfoStyle.normal.textColor = Color.white; } GUILayout.Label(scriptResultInfo[i], _resultInfoStyle); } GUILayout.EndVertical(); } if (GUILayout.Button("Update")) { m_nodeGUI.controller.update(); } GUILayout.EndVertical(); // base.DrawNodeInspector(inspectorWidth); } } }
/* * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using SquatCounter.Services; using System; using System.Timers; using System.Windows.Input; using Xamarin.Forms; namespace SquatCounter.ViewModels { /// <summary> /// Provides squat counter page view abstraction. /// </summary> public class SquatCounterPageViewModel : ViewModelBase { /// <summary> /// Backing field of IsCounting property. /// </summary> private bool _isCounting; /// <summary> /// Backing field of SquatsCount property. /// </summary> private int _squatsCount; /// <summary> /// Backing field of Time property. /// </summary> private string _time; /// <summary> /// Field containing reference to squat counter service. /// </summary> private SquatCounterService _squatService; /// <summary> /// Field holding seconds count. /// </summary> private int _seconds; /// <summary> /// Field containing Timer object. /// </summary> private Timer _timer; /// <summary> /// Changes squat counting service state depending on actual state. /// </summary> public ICommand ChangeServiceStateCommand { get; } /// <summary> /// Resets squat count. /// </summary> public ICommand ResetCommand { get; } /// <summary> /// Number of squats made. /// </summary> public int SquatsCount { get => _squatsCount; set => SetProperty(ref _squatsCount, value); } /// <summary> /// Property indicating if squat counting is enabled. /// </summary> public bool IsCounting { get => _isCounting; set => SetProperty(ref _isCounting, value); } /// <summary> /// Time in minutes and seconds. /// </summary> public string Time { get => _time; set => SetProperty(ref _time, value); } /// <summary> /// Initializes SquatCounterPageViewModel class instance. /// </summary> public SquatCounterPageViewModel() { IsCounting = true; _seconds = 0; _time = "00:00"; _squatService = new SquatCounterService(); _squatService.SquatsUpdated += ExecuteSquatsUpdatedCallback; _timer = new Timer(1000); _timer.Elapsed += TimerTick; _timer.Start(); ChangeServiceStateCommand = new Command(ExecuteChangeServiceStateCommand); ResetCommand = new Command(ExecuteResetCommand); if (Application.Current.MainPage is NavigationPage navigationPage) { navigationPage.Popped += OnPagePopped; } } /// <summary> /// Handles execution of ChangeServiceStateCommand. /// </summary> private void ExecuteChangeServiceStateCommand() { if (IsCounting) { _timer.Stop(); _squatService.Stop(); } else { _timer.Start(); _squatService.Start(); } IsCounting = !IsCounting; } /// <summary> /// Handles execution of ResetCommand. /// </summary> private void ExecuteResetCommand() { _squatService.Reset(); Time = "00:00"; _seconds = 0; } /// <summary> /// Handles execution of Elapsed event. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">Event arguments.</param> private void TimerTick(object sender, EventArgs e) { _seconds++; Time = TimeSpan.FromSeconds(_seconds).ToString("mm\\:ss"); } /// <summary> /// Handles execution of SquatsUpdated event callback. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="squatsCount">Squat count value.</param> private void ExecuteSquatsUpdatedCallback(object sender, int squatsCount) { SquatsCount = squatsCount; } private void OnPagePopped(object sender, NavigationEventArgs e) { _timer.Elapsed -= TimerTick; _timer.Close(); _squatService.SquatsUpdated -= ExecuteSquatsUpdatedCallback; _squatService.Dispose(); if (Application.Current.MainPage is NavigationPage navigationPage) { navigationPage.Popped -= OnPagePopped; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Http; using System.Net.Http; namespace ASPNetDependencyInjectionHttpClient { class Program { static void Main(string[] args) { IServiceCollection serviceCollection = new ServiceCollection(); serviceCollection.AddHttpClient<TypedClient>(x => { x.BaseAddress = new Uri("http://a.a"); x.DefaultRequestHeaders.Host = "b"; }); IServiceProvider serviceProvider = serviceCollection.BuildServiceProvider(); TypedClient typedClient = serviceProvider.GetRequiredService<TypedClient>(); typedClient.Work(); } } class TypedClient { readonly HttpClient httpClient; public TypedClient(HttpClient httpClient) { this.httpClient = httpClient; } public void Work() { Console.WriteLine(httpClient.ToString()); } } }
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using RBIScoreboard.Models; namespace RBIScoreboard { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private ViewModels.MainViewModel mainViewModel = new ViewModels.MainViewModel(); public MainWindow() { InitializeComponent(); //OutputWindow outputWindow = new OutputWindow(mainViewModel); //outputWindow.Show(); mainViewModel.Draw(HeaderRuns,AwayTeamRuns,HomeTeamRuns,true); this.DataContext = mainViewModel; } private void EditTeam_Click(object sender, RoutedEventArgs e) { MenuItem menuItem = (MenuItem)sender; Windows.EditTeam editTeam = new Windows.EditTeam(); switch(menuItem.Name) { case "EditAwayTeam": editTeam.DataContext = mainViewModel.AwayTeam; break; case "EditHomeTeam": editTeam.DataContext = mainViewModel.HomeTeam; break; } editTeam.ShowDialog(); } private void InningPart_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox comboBox = (ComboBox)sender; string selectedItem = (string) ((ComboBoxItem) comboBox.SelectedItem).Content; this.mainViewModel.Inning.Part = selectedItem; } private void RunOutput_Click(object sender, RoutedEventArgs e) { OutputWindow outputWindow = new OutputWindow( mainViewModel); this.mainViewModel.OutputWindow = outputWindow; outputWindow.Show(); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Bullet : Obj { private static LinkedList<Bullet> Bullets = new LinkedList<Bullet>(); private float Speed; private Vector3 Direction; private LinkedListNode<Bullet> bulletNode; private float destroySelfOT; public static void BulletsUpdate(QTree qTree) { foreach (Bullet b in Bullets) { b.Move(); b.destroySelfOT -= Time.deltaTime; } LinkedListNode<Bullet> _node = Bullets.First; while (_node != null) { Bullet _b = _node.Value; _node = _node.Next; if (_b.destroySelfOT <= 0) { _b.DestroySelf(); } else { qTree.SearchNode(_b); } } } public Bullet(GameObject go, Vector3 direction, float speed) : base(go) { Type = ObjType.Bullet; bulletNode = Bullets.AddLast(this); this.Direction = direction; this.Speed = speed; destroySelfOT = 5.0f; } public override void DestroySelf() { Bullets.Remove(bulletNode); base.DestroySelf(); } public void Move() { Go.transform.position += Direction.normalized * Speed; } }
using ScribblersSharp; using UnityEngine; /// <summary> /// Scribble.rs Pad namespace /// </summary> namespace ScribblersPad { /// <summary> /// An interface that represents a player list controller /// </summary> public interface IPlayerListController : IScribblersClientController { /// <summary> /// Player list element asset /// </summary> GameObject PlayerListElementAsset { get; set; } /// <summary> /// Own player list element asset /// </summary> GameObject OwnPlayerListElementAsset { get; set; } /// <summary> /// Player list element parent rectangle transform /// </summary> RectTransform PlayerListElementParentRectangleTransform { get; set; } /// <summary> /// Gets invoked when a "ready" game message has been received /// </summary> event ReadyGameMessageReceivedDelegate OnReadyGameMessageReceived; /// <summary> /// Gets invoked when a "next-turn" game message has been received /// </summary> event NextTurnGameMessageReceivedDelegate OnNextTurnGameMessageReceived; /// <summary> /// Gets invoked when a "name-change" game message has been received /// </summary> event NameChangeGameMessageReceivedDelegate OnNameChangeGameMessageReceived; /// <summary> /// Gets invoked when a "update-player" game message has been received /// </summary> event UpdatePlayersGameMessageReceivedDelegate OnUpdatePlayersGameMessageReceived; /// <summary> /// Gets invoked when a "correct-guess" game message has been received /// </summary> event CorrectGuessGameMessageReceivedDelegate OnCorrectGuessGameMessageReceived; } }
using System; using Microsoft.EntityFrameworkCore.Migrations; namespace PointOfSalesV2.EntityFramework.Migrations { public partial class LanguageKeys : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "LanguageKeys", columns: table => new { LanguageCode = table.Column<string>(maxLength: 2, nullable: false), Key = table.Column<string>(maxLength: 100, nullable: false), CreatedBy = table.Column<Guid>(nullable: false), CreatedByName = table.Column<string>(nullable: true), ModifiedBy = table.Column<Guid>(nullable: true), ModifiedByName = table.Column<string>(nullable: true), CreatedDate = table.Column<DateTime>(nullable: false), ModifiedDate = table.Column<DateTime>(nullable: true), Active = table.Column<bool>(nullable: false), LanguageId = table.Column<long>(nullable: false), Value = table.Column<string>(nullable: true) }, constraints: table => { table.PrimaryKey("PK_LanguageKeys", x => new { x.LanguageCode, x.Key }); table.ForeignKey( name: "FK_LanguageKeys_Languages_LanguageCode", column: x => x.LanguageCode, principalTable: "Languages", principalColumn: "Code", onDelete: ReferentialAction.Restrict); }); migrationBuilder.InsertData( table: "LanguageKeys", columns: new[] { "LanguageCode", "Key", "Active", "CreatedBy", "CreatedByName", "CreatedDate", "LanguageId", "ModifiedBy", "ModifiedByName", "ModifiedDate", "Value" }, values: new object[,] { { "EN", "unitNotExist_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 354, DateTimeKind.Local).AddTicks(8794), 1L, null, null, null, "Unit does not exist." }, { "ES", "ok_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2117), 2L, null, null, null, "Operation completed successfully." }, { "ES", "error_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2119), 2L, null, null, null, "Error: Could not completed the current operation. " }, { "ES", "cannotUpdatePayment_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2120), 2L, null, null, null, "Cannot update payment. " }, { "ES", "invalidInvoice_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2123), 2L, null, null, null, "Invalid invoice." }, { "ES", "owedAmountOutdated_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2125), 2L, null, null, null, "Owed amount is outdated. please try update and try again." }, { "ES", "invoicePaid_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2126), 2L, null, null, null, "Invoice is already paid." }, { "ES", "paymentNotValid_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2128), 2L, null, null, null, "Payment is not valid." }, { "ES", "emptyInvoice_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2130), 2L, null, null, null, "Invoice doesn't have any details. Cannot be empty." }, { "ES", "creditLimitReached_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2132), 2L, null, null, null, "Credit limit reached. Cannot continue." }, { "ES", "trnNotAvailable_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2134), 2L, null, null, null, "TRN is not available." }, { "ES", "outOfStock_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2136), 2L, null, null, null, "Product is out of stock." }, { "ES", "defWarehouseNotExit_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2137), 2L, null, null, null, "Defective warehouse does not exist. Please create one with 'DEF' as code first. " }, { "ES", "notExistingClass_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2139), 2L, null, null, null, "Cannot process this product/Service. Class does not exist." }, { "ES", "warehouseError_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2141), 2L, null, null, null, "Warehouse does not exist." }, { "ES", "creditNoteNotExist_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2142), 2L, null, null, null, "Credit note does not exist. " }, { "ES", "creditNoteApplied_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2145), 2L, null, null, null, "Credit note is already applied." }, { "ES", "differentCurrency_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2146), 2L, null, null, null, "Currencies are different. You can only apply the same currency. " }, { "ES", "amountIsGreater_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2148), 2L, null, null, null, "Credit note amount is greater than invoice amount." }, { "ES", "productNeedsUnits_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2150), 2L, null, null, null, "Product needs at least one unit." }, { "ES", "productNeedsPrimaryUnit_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2152), 2L, null, null, null, "Product needs one primary unit." }, { "ES", "cannotEraseUnit_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2153), 2L, null, null, null, "Cannot erase product unit." }, { "ES", "cannotDeleteTax_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2155), 2L, null, null, null, "Cannot delete product tax. " }, { "ES", "cannotRemoveBaseProduct_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2156), 2L, null, null, null, "Cannot remove base product." }, { "ES", "parentUnitDoesntExist_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2116), 2L, null, null, null, "Parent unit does not exist." }, { "ES", "sequenceError_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2158), 2L, null, null, null, "Sequence Error." }, { "ES", "unitNotExist_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(2110), 2L, null, null, null, "Unit does not exist." }, { "EN", "cannotRemoveBaseProduct_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1901), 1L, null, null, null, "Cannot remove base product." }, { "EN", "parentUnitDoesntExist_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1787), 1L, null, null, null, "Parent unit does not exist." }, { "EN", "ok_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1837), 1L, null, null, null, "Operation completed successfully." }, { "EN", "error_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1840), 1L, null, null, null, "Error: Could not completed the current operation. " }, { "EN", "cannotUpdatePayment_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1843), 1L, null, null, null, "Cannot update payment. " }, { "EN", "invalidInvoice_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1850), 1L, null, null, null, "Invalid invoice." }, { "EN", "owedAmountOutdated_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1853), 1L, null, null, null, "Owed amount is outdated. please try update and try again." }, { "EN", "invoicePaid_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1856), 1L, null, null, null, "Invoice is already paid." }, { "EN", "paymentNotValid_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1858), 1L, null, null, null, "Payment is not valid." }, { "EN", "emptyInvoice_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1862), 1L, null, null, null, "Invoice doesn't have any details. Cannot be empty." }, { "EN", "creditLimitReached_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1865), 1L, null, null, null, "Credit limit reached. Cannot continue." }, { "EN", "trnNotAvailable_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1867), 1L, null, null, null, "TRN is not available." }, { "EN", "outOfStock_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1869), 1L, null, null, null, "Product is out of stock." }, { "EN", "defWarehouseNotExit_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1872), 1L, null, null, null, "Defective warehouse does not exist. Please create one with 'DEF' as code first. " }, { "EN", "notExistingClass_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1874), 1L, null, null, null, "Cannot process this product/Service. Class does not exist." }, { "EN", "warehouseError_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1877), 1L, null, null, null, "Warehouse does not exist." }, { "EN", "creditNoteNotExist_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1880), 1L, null, null, null, "Credit note does not exist. " }, { "EN", "creditNoteApplied_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1884), 1L, null, null, null, "Credit note is already applied." }, { "EN", "differentCurrency_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1886), 1L, null, null, null, "Currencies are different. You can only apply the same currency. " }, { "EN", "amountIsGreater_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1889), 1L, null, null, null, "Credit note amount is greater than invoice amount." }, { "EN", "productNeedsUnits_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1891), 1L, null, null, null, "Product needs at least one unit." }, { "EN", "productNeedsPrimaryUnit_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1893), 1L, null, null, null, "Product needs one primary unit." }, { "EN", "cannotEraseUnit_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1896), 1L, null, null, null, "Cannot erase product unit." }, { "EN", "cannotDeleteTax_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1898), 1L, null, null, null, "Cannot delete product tax. " }, { "EN", "sequenceError_msg", true, new Guid("00000000-0000-0000-0000-000000000000"), "admin", new DateTime(2019, 12, 28, 16, 31, 50, 355, DateTimeKind.Local).AddTicks(1915), 1L, null, null, null, "Sequence Error." } }); migrationBuilder.UpdateData( table: "Languages", keyColumn: "Code", keyValue: "EN", column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 354, DateTimeKind.Local).AddTicks(6952)); migrationBuilder.UpdateData( table: "Languages", keyColumn: "Code", keyValue: "ES", columns: new[] { "CreatedDate", "Id" }, values: new object[] { new DateTime(2019, 12, 28, 16, 31, 50, 354, DateTimeKind.Local).AddTicks(7585), 2L }); migrationBuilder.UpdateData( table: "MovementTypes", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 342, DateTimeKind.Local).AddTicks(6104)); migrationBuilder.UpdateData( table: "MovementTypes", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 342, DateTimeKind.Local).AddTicks(6244)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 334, DateTimeKind.Local).AddTicks(2761)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(4980)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 3L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5003)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 4L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5007)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 5L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5010)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 6L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5037)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 7L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5041)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 8L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5044)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 9L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5047)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 10L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5052)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 11L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5055)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 12L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5058)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 13L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5062)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 14L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5065)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 15L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5068)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 16L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5071)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 17L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5074)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 18L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5079)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 19L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5082)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 20L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5085)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 21L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5088)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 22L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5091)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 23L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5276)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 24L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5282)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 25L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5285)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 26L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5288)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 27L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5291)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 28L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5294)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 29L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5298)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 30L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5300)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 31L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5304)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 32L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5307)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 33L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5310)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 34L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 335, DateTimeKind.Local).AddTicks(5315)); migrationBuilder.UpdateData( table: "PaymentTypes", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 337, DateTimeKind.Local).AddTicks(6777)); migrationBuilder.UpdateData( table: "PaymentTypes", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 337, DateTimeKind.Local).AddTicks(6889)); migrationBuilder.UpdateData( table: "PaymentTypes", keyColumn: "Id", keyValue: 3L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 337, DateTimeKind.Local).AddTicks(7078)); migrationBuilder.UpdateData( table: "PaymentTypes", keyColumn: "Id", keyValue: 4L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 337, DateTimeKind.Local).AddTicks(7083)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1241)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1353)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 3L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1368)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 4L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1376)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 5L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1385)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 6L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1426)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 7L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1436)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 8L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1446)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 9L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1457)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 10L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1471)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 11L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1482)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 12L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1490)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 13L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1499)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 14L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1510)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 15L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1521)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 16L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1529)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 17L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1537)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 18L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1553)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 19L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1562)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 20L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1573)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 21L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1581)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 22L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1592)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 23L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1603)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 24L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1613)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 25L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1621)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 26L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1631)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 27L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1642)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 28L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1651)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 29L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1660)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 30L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1669)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 31L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1680)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 32L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1690)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 33L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1698)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 34L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(1712)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 339, DateTimeKind.Local).AddTicks(9787)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(34)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 3L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(49)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 4L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(59)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 5L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(69)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 6L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(85)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 7L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(96)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 8L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(106)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 9L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(117)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 10L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(130)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 11L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 340, DateTimeKind.Local).AddTicks(139)); migrationBuilder.UpdateData( table: "Users", keyColumn: "UserId", keyValue: new Guid("8a2fdd4a-e702-482c-f181-08d7015e3521"), column: "CreatedDate", value: new DateTime(2019, 12, 28, 16, 31, 50, 343, DateTimeKind.Local).AddTicks(7281)); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "LanguageKeys"); migrationBuilder.UpdateData( table: "Languages", keyColumn: "Code", keyValue: "EN", column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 947, DateTimeKind.Local).AddTicks(8824)); migrationBuilder.UpdateData( table: "Languages", keyColumn: "Code", keyValue: "ES", columns: new[] { "CreatedDate", "Id" }, values: new object[] { new DateTime(2019, 12, 28, 15, 45, 14, 948, DateTimeKind.Local).AddTicks(148), 1L }); migrationBuilder.UpdateData( table: "MovementTypes", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 937, DateTimeKind.Local).AddTicks(7704)); migrationBuilder.UpdateData( table: "MovementTypes", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 937, DateTimeKind.Local).AddTicks(7779)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 930, DateTimeKind.Local).AddTicks(5950)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9186)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 3L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9215)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 4L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9219)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 5L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9222)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 6L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9229)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 7L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9232)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 8L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9235)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 9L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9239)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 10L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9243)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 11L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9246)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 12L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9314)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 13L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9531)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 14L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9535)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 15L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9538)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 16L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9541)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 17L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9544)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 18L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9549)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 19L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9552)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 20L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9555)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 21L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9558)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 22L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9562)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 23L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9565)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 24L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9568)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 25L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9571)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 26L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9574)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 27L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9577)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 28L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9580)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 29L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9583)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 30L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9586)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 31L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9590)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 32L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9593)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 33L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9596)); migrationBuilder.UpdateData( table: "Operations", keyColumn: "Id", keyValue: 34L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 931, DateTimeKind.Local).AddTicks(9600)); migrationBuilder.UpdateData( table: "PaymentTypes", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 934, DateTimeKind.Local).AddTicks(53)); migrationBuilder.UpdateData( table: "PaymentTypes", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 934, DateTimeKind.Local).AddTicks(340)); migrationBuilder.UpdateData( table: "PaymentTypes", keyColumn: "Id", keyValue: 3L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 934, DateTimeKind.Local).AddTicks(345)); migrationBuilder.UpdateData( table: "PaymentTypes", keyColumn: "Id", keyValue: 4L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 934, DateTimeKind.Local).AddTicks(348)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(667)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(723)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 3L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(727)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 4L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(730)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 5L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(734)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 6L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(739)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 7L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(743)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 8L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(746)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 9L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(749)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 10L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(754)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 11L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(757)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 12L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(760)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 13L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(763)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 14L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(767)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 15L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(770)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 16L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(773)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 17L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(776)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 18L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(781)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 19L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(784)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 20L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(787)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 21L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(790)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 22L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(794)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 23L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(797)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 24L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(800)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 25L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(868)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 26L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(872)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 27L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(875)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 28L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(878)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 29L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(881)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 30L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(884)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 31L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(888)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 32L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(891)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 33L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(894)); migrationBuilder.UpdateData( table: "Sections", keyColumn: "Id", keyValue: 34L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(899)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 1L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1760)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 2L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1873)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 3L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1878)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 4L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1969)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 5L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1974)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 6L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1980)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 7L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1984)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 8L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1987)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 9L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1990)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 10L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1994)); migrationBuilder.UpdateData( table: "SequencesControl", keyColumn: "Id", keyValue: 11L, column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 936, DateTimeKind.Local).AddTicks(1998)); migrationBuilder.UpdateData( table: "Users", keyColumn: "UserId", keyValue: new Guid("8a2fdd4a-e702-482c-f181-08d7015e3521"), column: "CreatedDate", value: new DateTime(2019, 12, 28, 15, 45, 14, 938, DateTimeKind.Local).AddTicks(4689)); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.AI; public class PlayerController : MonoBehaviour { public float MovementSpeed; public float AccelerationSpeed; private NavMeshAgent _agent; void Awake() { _agent = GetComponent<NavMeshAgent>(); } // Start is called before the first frame update void Start() { _agent.speed = MovementSpeed; _agent.acceleration = AccelerationSpeed; } // Update is called once per frame void Update() { if (Input.GetButtonDown("Fire1")) { Vector3 mousePosition = Input.mousePosition; Ray cameraPoint = Camera.main.ScreenPointToRay(mousePosition); RaycastHit hit; if (Physics.Raycast(cameraPoint, out hit, Mathf.Infinity)) { _agent.SetDestination(hit.point); } } } }
/* DotNetMQ - A Complete Message Broker For .NET Copyright (C) 2011 Halil ibrahim KALKAN This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ namespace MDS.Client.AppService { /// <summary> /// This class is used as base class for classes that are processing messages of an application concurrently. Thus, /// an application can process more than one message in a time. /// MDS creates an instance of this class for every incoming message to process it. /// Maximum limit of messages that are being processed at the same time is configurable for individual applications. /// </summary> public abstract class MDSMessageProcessor : MDSAppServiceBase { /// <summary> /// Used to get/set if messages are auto acknowledged. /// If AutoAcknowledgeMessages is true, then messages are automatically acknowledged after MessageReceived event, /// if they are not acknowledged/rejected before by application. /// Default: true. /// </summary> protected bool AutoAcknowledgeMessages { get { return _autoAcknowledgeMessages; } set { _autoAcknowledgeMessages = value; } } private bool _autoAcknowledgeMessages = true; /// <summary> /// This method is called by MDS server to process the message, when a message is sent to this application. /// </summary> /// <param name="message">Message to process</param> public abstract void ProcessMessage(IIncomingMessage message); } }
namespace OlisProgrammingTasks.Stacks { public interface IStack { void Push(char t, int stackNumber); char Pop(int stackNumber); } }
using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Reflection; using MediatR; namespace OmniSharp.Extensions.JsonRpc { public interface IHandlerTypeDescriptorProvider<out T> where T : IHandlerTypeDescriptor? { T GetHandlerTypeDescriptor<TA>(); T GetHandlerTypeDescriptor(Type type); string? GetMethodName<TH>() where TH : IJsonRpcHandler; bool IsMethodName(string name, params Type[] types); string? GetMethodName(Type type); } public class HandlerTypeDescriptorHelper { internal static Type? GetMethodType(Type type) { // Custom method if (MethodAttribute.AllFrom(type).Any()) { return type; } return type.GetTypeInfo() .ImplementedInterfaces .FirstOrDefault(t => MethodAttribute.AllFrom(t).Any()); } private static readonly Type[] HandlerTypes = { typeof(IJsonRpcNotificationHandler<>), typeof(IJsonRpcRequestHandler<>), typeof(IJsonRpcRequestHandler<,>), typeof(IRequestHandler<>), typeof(IRequestHandler<,>), }; private static bool IsValidInterface(Type type) { if (type.GetTypeInfo().IsGenericType) { return HandlerTypes.Contains(type.GetGenericTypeDefinition()); } return HandlerTypes.Contains(type); } public static Type GetHandlerInterface(Type type) { try { if (IsValidInterface(type)) return type; return type.GetTypeInfo() .ImplementedInterfaces .First(IsValidInterface); } catch (Exception e) { throw new AggregateException("Errored with type: " + type.FullName, e); } } internal static Type? UnwrapGenericType(Type genericType, Type type, int arity = 0) { return type.GetTypeInfo() .ImplementedInterfaces .FirstOrDefault(x => x.GetTypeInfo().IsGenericType && x.GetTypeInfo().GetGenericTypeDefinition() == genericType) ?.GetTypeInfo() ?.GetGenericArguments()[arity]; } } internal class AssemblyScanningHandlerTypeDescriptorProvider : IHandlerTypeDescriptorProvider<IHandlerTypeDescriptor?> { private readonly ConcurrentDictionary<Type, string> _methodNames = new(); internal readonly ILookup<string, IHandlerTypeDescriptor> KnownHandlers; internal AssemblyScanningHandlerTypeDescriptorProvider(IEnumerable<Assembly> assemblies) { try { KnownHandlers = GetDescriptors(assemblies) .ToLookup(x => x.Method, StringComparer.Ordinal); } catch (Exception e) { throw new AggregateException("Failed", e); } } internal static IEnumerable<IHandlerTypeDescriptor> GetDescriptors(IEnumerable<Assembly> assemblies) { return assemblies.SelectMany( x => { try { return x.GetTypes(); } catch { return Enumerable.Empty<Type>(); } } ) .Where(z => z.IsInterface || ( z.IsClass && !z.IsAbstract )) // running on mono this call can cause issues when scanning of the entire assembly. .Where( z => { try { return typeof(IJsonRpcHandler).IsAssignableFrom(z); } catch { return false; } } ) .Where(z => MethodAttribute.From(z) != null) .Where(z => !z.Name.EndsWith("Manager")) // Manager interfaces are generally specializations around the handlers .Select(HandlerTypeDescriptorHelper.GetMethodType) .Distinct() .ToLookup(x => MethodAttribute.From(x)!.Method) .SelectMany( x => x .Distinct() .Select(z => new HandlerTypeDescriptor(z!) as IHandlerTypeDescriptor) ); } public IHandlerTypeDescriptor? GetHandlerTypeDescriptor<TA>() { return GetHandlerTypeDescriptor(typeof(TA)); } public IHandlerTypeDescriptor? GetHandlerTypeDescriptor(Type type) { var @default = KnownHandlers .SelectMany(g => g) .FirstOrDefault(x => x.InterfaceType == type || x.HandlerType == type || x.ParamsType == type); if (@default != null) { return @default; } var methodName = GetMethodName(type)!; return string.IsNullOrWhiteSpace(methodName) ? null : KnownHandlers[methodName].FirstOrDefault(); } public string? GetMethodName<T>() where T : IJsonRpcHandler { return GetMethodName(typeof(T)); } public bool IsMethodName(string name, params Type[] types) { return types.Any(z => GetMethodName(z)?.Equals(name) == true); } public string? GetMethodName(Type type) { if (_methodNames.TryGetValue(type, out var method)) return method; // Custom method var attribute = MethodAttribute.From(type); var handler = KnownHandlers.SelectMany(z => z) .FirstOrDefault(z => z.InterfaceType == type || z.HandlerType == type || z.ParamsType == type); if (handler != null) { return handler.Method; } if (attribute is null) { return null; } _methodNames.TryAdd(type, attribute.Method); return attribute.Method; } } internal class AssemblyAttributeHandlerTypeDescriptorProvider : IHandlerTypeDescriptorProvider<IHandlerTypeDescriptor?> { private readonly ConcurrentDictionary<Type, string> _methodNames = new(); internal readonly ILookup<string, IHandlerTypeDescriptor> KnownHandlers; internal AssemblyAttributeHandlerTypeDescriptorProvider(IEnumerable<Assembly> assemblies) { try { KnownHandlers = GetDescriptors(assemblies) .ToLookup(x => x.Method, StringComparer.Ordinal); } catch (Exception e) { throw new AggregateException("Failed", e); } } internal static IEnumerable<IHandlerTypeDescriptor> GetDescriptors(IEnumerable<Assembly> assemblies) { return assemblies.SelectMany(x => x.GetCustomAttributes<AssemblyJsonRpcHandlersAttribute>()) .SelectMany(z => z.Types) .Where(z => !z.Name.EndsWith("Manager")) // Manager interfaces are generally specializations around the handlers .Select(HandlerTypeDescriptorHelper.GetMethodType) .Distinct() .ToLookup(x => MethodAttribute.From(x)!.Method) .SelectMany( x => x .Distinct() .Select(z => new HandlerTypeDescriptor(z!) as IHandlerTypeDescriptor) ); } public IHandlerTypeDescriptor? GetHandlerTypeDescriptor<TA>() { return GetHandlerTypeDescriptor(typeof(TA)); } public IHandlerTypeDescriptor? GetHandlerTypeDescriptor(Type type) { var @default = KnownHandlers .SelectMany(g => g) .FirstOrDefault(x => x.InterfaceType == type || x.HandlerType == type || x.ParamsType == type); if (@default != null) { return @default; } var methodName = GetMethodName(type)!; return string.IsNullOrWhiteSpace(methodName) ? null : KnownHandlers[methodName].FirstOrDefault(); } public string? GetMethodName<T>() where T : IJsonRpcHandler { return GetMethodName(typeof(T)); } public bool IsMethodName(string name, params Type[] types) { return types.Any(z => GetMethodName(z)?.Equals(name) == true); } public string? GetMethodName(Type type) { if (_methodNames.TryGetValue(type, out var method)) return method; // Custom method var attribute = MethodAttribute.From(type); var handler = KnownHandlers.SelectMany(z => z) .FirstOrDefault(z => z.InterfaceType == type || z.HandlerType == type || z.ParamsType == type); if (handler != null) { return handler.Method; } if (attribute is null) { return null; } _methodNames.TryAdd(type, attribute.Method); return attribute.Method; } } }
using CapstoneTravelApp.DatabaseTables; using SQLite; using System; using System.Collections.ObjectModel; using Xamarin.Essentials; using Xamarin.Forms; using Xamarin.Forms.Xaml; namespace CapstoneTravelApp.FlightsFolder { [XamlCompilation(XamlCompilationOptions.Compile)] public partial class FlightInfoPage : ContentPage { private Flights_Table _currentFlight; private SQLiteConnection conn; private ObservableCollection<Flights_Table> _flightsList; public FlightInfoPage(Flights_Table currentFlight) { InitializeComponent(); _currentFlight = currentFlight; Title = _currentFlight.AirlineName; conn = DependencyService.Get<ITravelApp_db>().GetConnection(); } protected override void OnAppearing() { conn.CreateTable<Flights_Table>(); var flightsList = conn.Query<Flights_Table>($"SELECT * FROM Flights_Table WHERE FlightID = '{_currentFlight.FlightId}'"); _flightsList = new ObservableCollection<Flights_Table>(flightsList); flighNameLabel.Text = _currentFlight.AirlineName; flightNumberLabel.Text = "Flight: " + $"{_currentFlight.FlightNumber}"; departGatelabel.Text = "Departure Gate: " + $"{_currentFlight.DepartGate}"; departLocLabel.Text = "Departs: " + $"{_currentFlight.DepartLocation}"; departTimeLabel.Text = $"{_currentFlight.DepartTime.ToString("MM/dd HH:mm tt")}"; arriveLocLabel.Text = "Arrives: " + $"{_currentFlight.ArriveLocation}"; arriveTimeLabel.Text = $"{_currentFlight.ArriveTime.ToString("MM/dd HH:mm tt")}"; notificationSwitch.IsToggled = _currentFlight.FlightNotifications == 1 ? true : false; base.OnAppearing(); } private async void MenuButton_Clicked(object sender, EventArgs e) { var action = await DisplayActionSheet("Flight Options", "Cancel", "Delete Flight", "Edit Flight", "Share Flight"); if (action == "Edit Flight") { await Navigation.PushModalAsync(new EditFlightPage(_currentFlight)); } else if (action == "Share Flight") { await Share.RequestAsync(new ShareTextRequest { Text = flighNameLabel.Text + "\n" + flightNumberLabel.Text + "\n" + departGatelabel.Text + "\n" + departLocLabel.Text + "\n" + departTimeLabel.Text + "\n" + arriveLocLabel.Text + "\n" + arriveTimeLabel.Text + "\n" + "Record updated at: " + DateTime.Now.ToString("MM/dd/yy HH:mm tt") }); } else if (action == "Delete Flight") { var deleteResponse = await DisplayAlert("Warning", "You are about to delete this flight! Are you sure?", "Yes", "No"); if (deleteResponse) { conn.Delete(_currentFlight); await Navigation.PopAsync(); } } } private async void FlightNotesButton_Clicked(object sender, EventArgs e) { await Navigation.PushModalAsync(new FlightNotesPage(_currentFlight)); } private void Switch_Toggled(object sender, ToggledEventArgs e) { _currentFlight.FlightNotifications = notificationSwitch.IsToggled == true ? 1 : 0; conn.Update(_currentFlight); } } }
// Accord Statistics Library // The Accord.NET Framework // http://accord-framework.net // // Copyright © César Souza, 2009-2015 // cesarsouza at gmail.com // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // namespace Accord.Statistics.Distributions.Univariate { using System; using Accord.Statistics.Distributions.Fitting; using AForge; using AForge.Math; using System.Numerics; /// <summary> /// Wrapped Cauchy Distribution. /// </summary> /// /// <remarks> /// <para> /// In probability theory and directional statistics, a wrapped Cauchy distribution /// is a wrapped probability distribution that results from the "wrapping" of the /// Cauchy distribution around the unit circle. The Cauchy distribution is sometimes /// known as a Lorentzian distribution, and the wrapped Cauchy distribution may /// sometimes be referred to as a wrapped Lorentzian distribution.</para> /// /// <para> /// The wrapped Cauchy distribution is often found in the field of spectroscopy where /// it is used to analyze diffraction patterns (e.g. see Fabry–Pérot interferometer)</para>. /// /// <para> /// References: /// <list type="bullet"> /// <item><description><a href="http://en.wikipedia.org/wiki/Directional_statistics"> /// Wikipedia, The Free Encyclopedia. Directional statistics. Available on: /// http://en.wikipedia.org/wiki/Directional_statistics </a></description></item> /// <item><description><a href="http://en.wikipedia.org/wiki/Wrapped_Cauchy_distribution"> /// Wikipedia, The Free Encyclopedia. Wrapped Cauchy distribution. Available on: /// http://en.wikipedia.org/wiki/Wrapped_Cauchy_distribution </a></description></item> /// </list></para> /// </remarks> /// /// <example> /// <code> /// // Create a Wrapped Cauchy distribution with μ = 0.42, γ = 3 /// var dist = new WrappedCauchyDistribution(mu: 0.42, gamma: 3); /// /// // Common measures /// double mean = dist.Mean; // 0.42 /// double var = dist.Variance; // 0.950212931632136 /// /// // Probability density functions /// double pdf = dist.ProbabilityDensityFunction(x: 0.42); // 0.1758330112785475 /// double lpdf = dist.LogProbabilityDensityFunction(x: 0.42); // -1.7382205338929015 /// /// // String representation /// string str = dist.ToString(); // "WrappedCauchy(x; μ = 0,42, γ = 3)" /// </code> /// </example> /// /// <seealso cref="CauchyDistribution"/> /// public class WrappedCauchyDistribution : UnivariateContinuousDistribution, IFittableDistribution<double, CauchyOptions> { private double mu; private double gamma; /// <summary> /// Initializes a new instance of the <see cref="WrappedCauchyDistribution"/> class. /// </summary> /// /// <param name="mu">The mean resultant parameter μ.</param> /// <param name="gamma">The gamma parameter γ.</param> /// public WrappedCauchyDistribution([Real] double mu, [Positive] double gamma) { if (gamma <= 0) throw new ArgumentOutOfRangeException("gamma", "Gamma must be positive."); this.mu = mu; this.gamma = gamma; } /// <summary> /// Gets the mean for this distribution. /// </summary> /// /// <value> /// The distribution's mean value. /// </value> /// public override double Mean { get { return mu; } } /// <summary> /// Gets the variance for this distribution. /// </summary> /// /// <value> /// The distribution's variance. /// </value> /// public override double Variance { get { return 1 - Math.Exp(-gamma); } } /// <summary> /// Not supported. /// </summary> /// public override double Median { get { throw new NotSupportedException(); } } /// <summary> /// Not supported. /// </summary> /// public override double Mode { get { throw new NotSupportedException(); } } /// <summary> /// Gets the support interval for this distribution. /// </summary> /// /// <value> /// A <see cref="DoubleRange" /> containing /// the support interval for this distribution. /// </value> /// public override DoubleRange Support { get { return new DoubleRange(-Math.PI, Math.PI); } } /// <summary> /// Gets the entropy for this distribution. /// </summary> /// /// <value> /// The distribution's entropy. /// </value> /// public override double Entropy { get { return Math.Log(2 * Math.PI * (1 - Math.Exp(-2 * gamma))); } } /// <summary> /// Not supported. /// </summary> /// public override double DistributionFunction(double x) { throw new NotSupportedException(); } /// <summary> /// Gets the probability density function (pdf) for /// this distribution evaluated at point <c>x</c>. /// </summary> /// /// <param name="x">A single point in the distribution range.</param> /// /// <returns> /// The probability of <c>x</c> occurring /// in the current distribution. /// </returns> /// public override double ProbabilityDensityFunction(double x) { double constant = (1.0 / (2 * Math.PI)); return constant * Math.Sinh(gamma) / (Math.Cosh(gamma) - Math.Cos(x - mu)); } /// <summary> /// Gets the log-probability density function (pdf) for /// this distribution evaluated at point <c>x</c>. /// </summary> /// /// <param name="x">A single point in the distribution range.</param> /// /// <returns> /// The logarithm of the probability of <c>x</c> /// occurring in the current distribution. /// </returns> /// public override double LogProbabilityDensityFunction(double x) { return Math.Log(ProbabilityDensityFunction(x)); } /// <summary> /// Creates a new object that is a copy of the current instance. /// </summary> /// /// <returns> /// A new object that is a copy of this instance. /// </returns> /// public override object Clone() { return new WrappedCauchyDistribution(mu, gamma); } /// <summary> /// Fits the underlying distribution to a given set of observations. /// </summary> /// /// <param name="observations">The array of observations to fit the model against. The array /// elements can be either of type double (for univariate data) or /// type double[] (for multivariate data).</param> /// <param name="weights">The weight vector containing the weight for each of the samples.</param> /// <param name="options">Optional arguments which may be used during fitting, such /// as regularization constants and additional parameters.</param> /// public void Fit(double[] observations, int[] weights, CauchyOptions options) { if (weights != null) throw new ArgumentException("This distribution does not support weighted samples.", "weights"); Fit(observations, (double[])null, options); } /// <summary> /// Fits the underlying distribution to a given set of observations. /// </summary> /// /// <param name="observations">The array of observations to fit the model against. The array /// elements can be either of type double (for univariate data) or /// type double[] (for multivariate data).</param> /// <param name="weights">The weight vector containing the weight for each of the samples.</param> /// <param name="options">Optional arguments which may be used during fitting, such /// as regularization constants and additional parameters.</param> /// public void Fit(double[] observations, double[] weights, CauchyOptions options) { if (weights != null) throw new ArgumentException("This distribution does not support weighted samples.", "weights"); double sin = 0, cos = 0; for (int i = 0; i < observations.Length; i++) { sin += Math.Sin(observations[i]); cos += Math.Cos(observations[i]); } mu = new Complex(sin, cos).Phase; double N = observations.Length; double R2 = (cos / N) * (cos / N) + (sin / N) * (sin / N); double R2e = N / (N - 1) * (R2 - 1.0 / N); gamma = Math.Log(1.0 / R2e) / 2.0; } /// <summary> /// Returns a <see cref="System.String"/> that represents this instance. /// </summary> /// /// <returns> /// A <see cref="System.String"/> that represents this instance. /// </returns> /// public override string ToString(string format, IFormatProvider formatProvider) { return String.Format(formatProvider, "WrappedCauchy(x; μ = {0}, γ = {1})", mu.ToString(format, formatProvider), gamma.ToString(format, formatProvider)); } } }
using System.Collections.Generic; namespace Azure.CosmosDB.Net.AzureDataFactory.Implementation { public class RootObject { public List<FactoryType> FactoryType { get; set; } } }
using System.Runtime.Serialization; namespace Acme.IONTestApp.Security.Authentication { [DataContract(Name = "LoginResponseResultType")] public enum LoginResponseResultTypeEnum { [EnumMember] Success, [EnumMember] AuthFailed, [EnumMember] NetworkError, [EnumMember] GenericError, [EnumMember] Undefined } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace NumbersInInterval { class InvalidNumberException : Exception { public InvalidNumberException() : base(String.Format("Invalid number!")) { } public InvalidNumberException(int firstValue, int secondValue) : base(String.Format("Invalid number! The number should be between {0} and {1}", firstValue, secondValue)) { } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data.OleDb; namespace Proje { class IstekListesineEkle:Client { private string almakisteyen; private string urunad; private int miktar; private string tur; private int fiyat; public string AlmakIsteyen { get { return almakisteyen; } set { this.almakisteyen = value; } } public string UrunAd { get { return urunad; } set { this.urunad = value; } } public int Miktar { get { return miktar; } set { this.miktar = value; } } public string Tur { get { return tur; } set { this.tur = value; } } public int Fiyat { get { return fiyat; } set { this.fiyat = value; } } OleDbConnection baglanti; OleDbCommand komut; public void ListeyeEkle() { DateTime dt = DateTime.Now; string format = "yyyy-MM-dd HH:mm:ss"; string zaman = dt.ToString(format); baglanti = new OleDbConnection("Provider=Microsoft.ACE.Oledb.12.0;Data Source=C:/Users/marsl/OneDrive/Masaüstü/Dönem Projesi/YazılımProje.accdb"); komut = new OleDbCommand(); komut.Connection = baglanti; baglanti.Open(); komut.CommandText = "insert into IstekListesi(IsteyenAd,UrunAd,Miktar,Tur,Fiyat,IstekTarih) values('" + almakisteyen + "','" + urunad + "'," + miktar + ",'" + tur + "'," + fiyat + ",'" + zaman + "')"; komut.ExecuteNonQuery(); baglanti.Close(); System.Windows.Forms.MessageBox.Show("\nSatın alma isteğiniz listeye eklendi istediğiniz fiyattan ürün satılırsa otomatik olarak satış işlemi gerçekleşecek.\n"); } } }
using System; using System.Collections.Generic; public class Gerenciamento_de_Quartos { private static Gerenciamento_de_Quartos _instancia; private List<IQuarto> _quartos_disponiveis; private List<IQuarto> _quartos_ocupados; private Gerenciamento_de_Quartos(){ _quartos_disponiveis = new List<IQuarto>(); _quartos_ocupados = new List<IQuarto>(); Adicionar_quartos_a_lista(); } public static Gerenciamento_de_Quartos GetInstancia(){ if(_instancia == null) { _instancia = new Gerenciamento_de_Quartos(); } return _instancia; } private void Adicionar_quartos_a_lista(){ for (int i = 0; i < 20; i++) { /*Tipo de quarto: 1 - Simples, 2 - Dupla, 3 - Tripla*/ int type = 1; IQuarto quarto = Registrar_Quarto(type); _quartos_disponiveis.Add(quarto); } for (int i = 0; i < 20; i++) { /*Tipo de quarto: 1 - Simples, 2 - Dupla, 3 - Tripla*/ int type = 2; IQuarto quarto = Registrar_Quarto(type); _quartos_disponiveis.Add(quarto); } for (int i = 0; i < 20; i++) { /*Tipo de quarto: 1 - Simples, 2 - Dupla, 3 - Tripla*/ int type = 3; IQuarto quarto = Registrar_Quarto(type); _quartos_disponiveis.Add(quarto); } } private IQuarto Registrar_Quarto(int type){ IQuarto quarto = null; switch (type) { case 1:{ quarto = new Quartos_simples(); break; } case 2:{ quarto = new Quartos_dupla(); break; } case 3:{ quarto = new Quartos_tripla(); break; } default: Console.WriteLine("Ocorreu um erro no gerenciamento de quartos(Registro de quartos)"); break; } bool check = true; while (check) { if(_quartos_disponiveis.Count == 0){ check = false; } foreach (var item in _quartos_disponiveis) { if (quarto.Num_quarto == item.Num_quarto) { check = true; quarto.Reroll_Number(); }else{ check = false; } } } return quarto; } public void Listar_Quartos_Disponiveis(int i){ Console.WriteLine("\nQuartos disponiveis:"); string Tipo_quarto; if (i == 1) { Tipo_quarto = "Simples"; }else if(i == 2){ Tipo_quarto = "Dupla"; }else{ Tipo_quarto = "Tripla"; } foreach (var item in _quartos_disponiveis) { if(Tipo_quarto == item.Tipo_quarto) Console.WriteLine("Quarto Nº{0} - Tipo: {1}",item.Num_quarto, item.Tipo_quarto); } } public IQuarto Ocupar_Quarto(int i){ Listar_Quartos_Disponiveis((int) i); Console.WriteLine("Digite o quarto que deseja: "); int number = int.Parse(Console.ReadLine()); IQuarto quarto = Verificiar_Quarto(number); if (quarto == null) { Console.WriteLine("\nNúmero do quarto inválido.\n"); return null; } _quartos_disponiveis.Remove(quarto); _quartos_ocupados.Add(quarto); return quarto; } public void Desocupar_Quarto(IQuarto quarto){ quarto.reset_serviço(); _quartos_ocupados.Remove(quarto); _quartos_disponiveis.Add(quarto); } private IQuarto Verificiar_Quarto(int i){ foreach (var item in _quartos_disponiveis) { if(item.Num_quarto == i){ return item; } } return null; } }
using DBStore.DataAccess.Data.Repository.IRepository; using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace DBStore.Components { public class SearchComponentViewComponent : ViewComponent { private readonly IUnitOfWorkRepository _unitOfWork; public SearchComponentViewComponent(IUnitOfWorkRepository unitOfWork) { _unitOfWork = unitOfWork; } public async Task<IViewComponentResult> InvokeAsync(int productid) { return View(); } } }
// // Copyright 2014, 2016 Carbonfrost Systems, Inc. (http://carbonfrost.com) // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // using System; using System.Linq; using System.Collections.Generic; using System.Collections.ObjectModel; using Carbonfrost.Commons.PropertyTrees; using Carbonfrost.Commons.Core; using Carbonfrost.Commons.Spec; namespace Carbonfrost.UnitTests.PropertyTrees { public class ListConverterTests { [Fact] public void ConvertFromString_should_parse_closed_generic_type_collection_interface() { var conv = TypeHelper.GetConverter(null, typeof(IList<Glob>)); Assert.IsInstanceOf<ListConverter>(conv); var items = (IEnumerable<Glob>) conv.ConvertFromString("**/*.* abc/**/*.txt \t\t\r\n */.cs", typeof(IList<Glob>), null); // TODO Should the return type be Collection<Glob> rather than List? (Currently, // we only use converters for aggregation - not directly) Assert.IsInstanceOf<List<Glob>>(items); Assert.Equal(3, items.ToList().Count); Assert.Contains(Glob.Anything, items); } [Fact] public void ConvertFromString_should_parse_closed_generic_type_derived_collection() { var conv = TypeHelper.GetConverter(null, typeof(Collection<Glob>)); Assert.IsInstanceOf<ListConverter>(conv); var items = (IEnumerable<Glob>) conv.ConvertFromString("**/*.* abc/**/*.txt \t\t\r\n */.cs", typeof(Collection<Glob>), null); Assert.Equal(3, items.ToList().Count); Assert.Contains(Glob.Anything, items); } [Theory] [InlineData("")] [InlineData(" ")] public void ConvertFromString_should_parse_empty_string_or_whitespace(string text) { var conv = TypeHelper.GetConverter(null, typeof(Collection<Glob>)); Assert.IsInstanceOf<ListConverter>(conv); var items = (IEnumerable<Glob>) conv.ConvertFromString(text, typeof(Collection<Glob>), null); Assert.Equal(0, items.ToList().Count); } class Int32List : List<Int32> {} [Fact] public void ConvertFromString_should_apply_specific_list_derived_type() { var conv = TypeHelper.GetConverter(null, typeof(Int32List)); Assert.IsInstanceOf<ListConverter>(conv); var items = (IEnumerable<int>) conv.ConvertFromString(" 2 3 ", typeof(Int32List), null); Assert.IsInstanceOf<Int32List>(items); Assert.Equal(2, items.ToList().Count); Assert.Equal(new[] { 2, 3 }, items); } } }
using System; using System.Drawing; using System.Windows.Forms; using WindowsCuotasApp.Clases; using WindowsCuotasApp.Clases.DTO; namespace WindowsCuotasApp { public partial class FormParametroPago : MetroFramework.Forms.MetroForm { private GestorAfiliados gestorAfiliados; private AfiliadoDTO a; public FormParametroPago() { InitializeComponent(); gestorAfiliados = new GestorAfiliados(); } private void FormParametroPago_Load(object sender, EventArgs e) { } private void soloNumeros(object sender, KeyPressEventArgs e) { if (!(char.IsNumber(e.KeyChar)) && (e.KeyChar != (char)Keys.Back)) { MessageBox.Show("Solo números", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); e.Handled = true; return; } } void inicio() { txtParametro.Focus(); } private void txtParametro_KeyPress(object sender, KeyPressEventArgs e) { soloNumeros(sender,e); } private void btnValidar_Click(object sender, EventArgs e) { try { int parametro = Convert.ToInt32(txtParametro.Text); int parametroDos = 1;/*debito*/ if(!string.IsNullOrEmpty(txtParametro.Text)) { a = gestorAfiliados.GetAfiliado(parametro,parametroDos); if(a != null) { btnContinuar.Enabled = true; lblCheck.ForeColor = Color.Green; } else { btnContinuar.Enabled = false; lblCheck.ForeColor = Color.Red; } } } catch (Exception error) { MetroFramework.MetroMessageBox.Show(this, "Error en la transacción: " + error.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); txtParametro.Focus(); } } private void btnContinuar_Click(object sender, EventArgs e) { if (MetroFramework.MetroMessageBox.Show(this,"Desea proseguir con el cobro al afiliado: " + a.nombreCompleto.ToUpper() + " documento número: " + a.nroDocumento + " ?", "Cobro Cuotas", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { FormPagoCuota nuevo = new FormPagoCuota(a); this.Dispose(); nuevo.ShowDialog(); } } } }
using System; using System.Collections.Generic; using Xamarin.Forms; namespace Weather { public class App : Application { WeatherService service; Label cityName; Label dayName; Label temperature; Label pressure; Label precipitation; RelativeLayout footerLayout; public App () { this.service = new WeatherService(); // The root page of your application MainPage = this.GetMainPage (); } public Page GetMainPage () { RelativeLayout mainLayout = new RelativeLayout (); mainLayout.Children.Add (new Image() { Source = ImageSource.FromResource("Weather.Images.bg.png"), Aspect = Aspect.AspectFill }, Constraint.Constant (0), Constraint.Constant (0), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.RelativeToParent ((parent) => { return parent.Height; }) ); // Header layout RelativeLayout headerLayout = new RelativeLayout (); mainLayout.Children.Add (headerLayout, Constraint.Constant (0), Constraint.Constant (20), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.Constant (100)); headerLayout.Children.Add (new Image() { Source = ImageSource.FromResource("Weather.Images.cloud.png"), }, Constraint.RelativeToParent ((parent) => { return parent.Width / 2 - 80; }), Constraint.RelativeToParent ((parent) => { return parent.Height / 2 - 22; }), Constraint.Constant (57), Constraint.Constant (44)); this.cityName = new Label () { Text = "WARSZAWA", FontSize = 16, TextColor = Color.White }; headerLayout.Children.Add (this.cityName, Constraint.RelativeToParent ((parent) => { return parent.Width / 2 - 10; }), Constraint.RelativeToParent ((parent) => { return parent.Height / 2 - 11; }), Constraint.Constant (100), Constraint.Constant (18)); this.dayName = new Label () { Text = "ŚRODA, 4 MAJ", FontSize = 8, TextColor = Color.White }; headerLayout.Children.Add (this.dayName, Constraint.RelativeToParent ((parent) => { return parent.Width / 2 - 10; }), Constraint.RelativeToParent ((parent) => { return parent.Height / 2 + 7; }), Constraint.Constant (100), Constraint.Constant (10)); // > // Footer layout this.footerLayout = new RelativeLayout (); mainLayout.Children.Add (this.footerLayout, Constraint.Constant (0), Constraint.RelativeToParent ((parent) => { return parent.Height - 120; }), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.Constant (120)); // > // Degrees and central area layout this.temperature = new Label () { Text = "--°", FontSize = 200, TextColor = Color.White, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center }; RelativeLayout degreesLayout = new RelativeLayout (); mainLayout.Children.Add (degreesLayout, Constraint.Constant (0), Constraint.RelativeToView(headerLayout, (parent, sibling) => { return sibling.Y + sibling.Height; }), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.RelativeToView(footerLayout, (parent, sibling) => { return sibling.Y - sibling.Height; })); degreesLayout.Children.Add (this.temperature, Constraint.Constant (0), Constraint.Constant (0), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.RelativeToParent ((parent) => { return parent.Height / 1.5; })); // > // Platform specific actions Device.OnPlatform ( iOS: () => { this.temperature.FontFamily = "HelveticaNeue-UltraLight"; this.cityName.FontFamily = "HelveticaNeue-Light"; }, Android: () => { this.temperature.FontFamily = "Sans-Serif-Thin"; this.cityName.FontFamily = "Sans-Serif-Light"; } ); // > return new ContentPage { Content = mainLayout, }; } private async void refreshForecast() { var today = DateTime.Now; var dayOfWeekName = today.DayOfWeek.ToString ().ToUpper (); var monthName = today.ToString("MMMM").ToUpper (); this.dayName.Text = $"{dayOfWeekName}, {today.Day} {monthName}"; // Currently, as an example, we're using hardcoded Warsaw location var forecast = await this.service.Fetch ("https://api.o2.pl/weather/api/o2/weather?cid=1201290&days=4"); var currentForecast = forecast.Details [0].Current; this.temperature.Text = $"{currentForecast.Temperature}°"; this.cityName.Text = forecast.Name.ToUpper (); // Forecast for coming days var offset = 0; List<string> cellColors = new List<string>(new string[] { "#d9a9ce", "#d29cc7", "#c586ba", "ba75b1" }); var iterationOffset = (int)this.footerLayout.Width / cellColors.Count; for (int i = 0; i < cellColors.Count; i++) { var dayForecast = forecast.Details [i]; var cellLayout = new RelativeLayout (); cellLayout.BackgroundColor = Color.FromHex (cellColors [i]); this.footerLayout.Children.Add (cellLayout, Constraint.Constant (offset), Constraint.Constant (0), Constraint.Constant (iterationOffset), Constraint.RelativeToParent ((parent) => { return parent.Height; })); var dayName = new Label () { Text = dayForecast.Date.DayOfWeek.ToString ().ToUpper (), FontSize = 8, TextColor = Color.White, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center }; cellLayout.Children.Add (dayName, Constraint.Constant (0), Constraint.Constant (18), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.Constant (10)); var dayTemperature = new Label () { Text = $"{dayForecast.Forecast.Temperature}°", FontSize = 22, TextColor = Color.White, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center }; cellLayout.Children.Add (dayTemperature, Constraint.Constant (3), Constraint.RelativeToParent ((parent) => { return parent.Height - 37; }), Constraint.RelativeToParent ((parent) => { return parent.Width; }), Constraint.Constant (18)); cellLayout.Children.Add (new Image() { Source = ImageSource.FromResource("Weather.Images.small_cloud.png"), }, Constraint.RelativeToParent ((parent) => { return parent.Width / 2 - 12; }), Constraint.RelativeToParent ((parent) => { return parent.Height / 2 - 15; }), Constraint.Constant (24), Constraint.Constant (22)); // Platform specific actions Device.OnPlatform ( iOS: () => { dayTemperature.FontFamily = "HelveticaNeue-UltraLight"; dayName.FontFamily = "HelveticaNeue-Light"; }, Android: () => { dayTemperature.FontFamily = "Sans-Serif-Thin"; dayName.FontFamily = "Sans-Serif-Light"; } ); // > offset += iterationOffset; } // > } protected override void OnStart () { this.refreshForecast (); } protected override void OnSleep () { // Handle when your app sleeps } protected override void OnResume () { // Handle when your app resumes this.refreshForecast (); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DecimalToBinary { class Program { static int Main(string[] args) { Console.WriteLine("Введите двоичное число"); string st = Console.ReadLine(); char[] arrCh = st.ToCharArray();//new[] {'1', '2'}; int znach = gluing_number(arrCh); Console.WriteLine(convertToBinnary(znach)); Console.ReadKey(); return 0; } public static int gluing_number(char[] str) { int res = 0; //значение результата //склейка чисел for (int i = 0; i < str.Length; i++) //str[i] != '\0' { res = res * 10 + str[i] - '0'; } return res; } public static string convertToBinnary(int n) { int k = 0; string arr = ""; while (n > 0) { //5%2 = 5-2=3-2=1, 1 < 2. Ответ 1. int znach = n; //проверка на остатток от деления while (znach > 1) znach = znach - 2; arr += znach.ToString(); n = n / 2; } return arr; } } }
namespace Key { using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; public class Hook { private int hHookKey = 0; private HookKeyProc hookKeyDeleg; private const int WH_KEYBOARD_LL = 20; public event KeyEventHandler KeyEvent; public Hook() { this.Start(); } [DllImport("coredll.dll")] private static extern int CallNextHookEx(HookKeyProc hhk, int nCode, IntPtr wParam, IntPtr lParam); ~Hook() { this.Stop(); } [DllImport("coredll.dll")] private static extern int GetCurrentThreadId(); [DllImport("coredll.dll")] private static extern IntPtr GetModuleHandle(string mod); private int HookKeyProcedure(int code, IntPtr wParam, IntPtr lParam) { switch (((int)wParam)) { case 0x101: { KBDLLHOOKSTRUCT kbdllhookstruct = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT)); if (code >= 0) { this.KeyEvent(kbdllhookstruct.scanCode, kbdllhookstruct.vkCode); break; } return CallNextHookEx(this.hookKeyDeleg, code, wParam, lParam); } } return CallNextHookEx(this.hookKeyDeleg, code, wParam, lParam); } [DllImport("coredll.dll")] private static extern int SetWindowsHookEx(int type, HookKeyProc HookKeyProc, IntPtr hInstance, int m); private void Start() { if (this.hHookKey != 0) { this.Stop(); } this.hookKeyDeleg = new HookKeyProc(this.HookKeyProcedure); this.hHookKey = SetWindowsHookEx(20, this.hookKeyDeleg, GetModuleHandle(null), 0); if (this.hHookKey == 0) { } } private void Stop() { UnhookWindowsHookEx(this.hHookKey); } [DllImport("coredll.dll", SetLastError = true)] private static extern int UnhookWindowsHookEx(int idHook); public delegate int HookKeyProc(int code, IntPtr wParam, IntPtr lParam); [StructLayout(LayoutKind.Sequential)] private struct KBDLLHOOKSTRUCT { public int vkCode; public int scanCode; public int flags; public int time; public IntPtr dwExtraInfo; } public class KeyBoardInfo { public int flags; public int scanCode; public int time; public int vkCode; } public delegate void KeyEventHandler(int scan, int KeyValue); } }
namespace DemoApp.Common { public class Result { public string Message { get; set; } public bool Success { get; set; } public void SetSuccess() { this.Success = true; } } public class Result<T> { public T Data { get; set; } public string Message { get; set; } public bool Success { get; set; } public void SetSuccessData(T data) { this.Data = data; this.Success = true; } } }
namespace App03 { using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.OptionsModel; using System.Linq; public class Startup { public IConfigurationRoot Config { get; set; } public Startup(IHostingEnvironment env) { Config = new ConfigurationBuilder().AddJsonFile("myoptions.json").Build(); } public void ConfigureServices(IServiceCollection services) { services.AddOptions(); services.Configure<MyOptions>(Config); } public void Configure(IApplicationBuilder app, IOptions<MyOptions> opts) { app.Run(async (context) => { var message = string.Join(",", opts.Value.MyObj.Select(a => a.Name)); await context.Response.WriteAsync(message); }); } } }
using System; namespace CelsiusToFahrenheit { class CelsiusToFahrenheit { static void Main(string[] args) { double celsius, farenheit; celsius = double.Parse(Console.ReadLine()); farenheit = 1.8 * celsius + 32; Console.WriteLine(farenheit); } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace EmplayeeRegistry { public class InvalidSsnExeption : Exception { } }
// TestOf_SymbolsTable.cs // Author: // Stephen Shaw <sshaw@decriptor.com> // Copyright (c) 2012 sshaw using System; using System.Collections.Generic; using NUnit.Framework; using Compiler.Symbols; namespace CompilerTests { [TestFixture] public class TestOf_SymbolsTable { SymbolsTable table = SymbolsTable.Table; [Test] public void SymbolTableOneAndOnlyOne () { var table2 = SymbolsTable.Table; Assert.AreEqual (table, table2); } [Test] [ExpectedException(typeof(ArgumentException))] public void SymbolTableAddsOnlyUniqueSymbols () { table.NunitOnlyClear(); Symbol one = new Symbol("C100", "g.", "Cat", "Class"); Symbol two = new Symbol("C101", "g.", "Cat", "Class"); table.Add(one); table.Add(two); } [Test] public void SymbolTableAddGlobalVariableGetCorrectSymbolId () { table.NunitOnlyClear (); Symbol global = new Symbol ("G101", "g.", "1", "int"); string createdId = table.AddGlobal (global); Assert.That (createdId, Is.EqualTo ("G101")); } [Test] public void SymbolTableAddSameGlobalVariable() { table.NunitOnlyClear(); Symbol global = new Symbol("G102", "g.", "2", "int"); Symbol global2 = new Symbol("G103", "g.", "2", "int"); string gId = table.AddGlobal (global); string gId2 = table.AddGlobal (global2); Assert.That (gId2, Is.EqualTo(gId)); } [Test] public void SymbolTableCountAfterAddingTwoSimilarGlobals() { table.NunitOnlyClear(); Symbol global = new Symbol("G104", "g.", "3", "int"); Symbol global2 = new Symbol("G105", "g.", "3", "int"); table.AddGlobal (global); table.AddGlobal (global2); Assert.That (table.NunitOnlyCount(), Is.EqualTo(1)); } [Test] public void SymbolTableContainsTwoClasses () { table.NunitOnlyClear(); Symbol one = new Symbol("C102", "g.", "Cat", "Class"); Symbol two = new Symbol("C103", "g.", "Dog", "Class"); table.Add(one); table.Add(two); List<Symbol> classes = SymbolsTable.Table.GetClasses(); Assert.That(classes.Count, Is.EqualTo(2)); } [Test] public void SymbolTableContainsTwoMethods () { table.NunitOnlyClear(); Symbol method1 = new Symbol("M100", "g.", "method1", "Method"); Symbol method2 = new Symbol("M101", "g.", "method2", "Method"); table.Add(method1); table.Add(method2); List<Symbol> methods = table.GetMethods(); Assert.That(methods.Count, Is.EqualTo(2)); } [Test] [ExpectedException(typeof(ArgumentException))] public void SymbolTableFailsWithTwoVariablesWithTheSameNameAndTheSameScope () { table.NunitOnlyClear (); Symbol variable1 = new Symbol ("V100", "g.main", "x", "Variable"); Symbol variable2 = new Symbol ("V104", "g.main", "x", "Variable"); table.Add (variable1); table.Add (variable2); } } }
#region Copyright Syncfusion Inc. 2001-2015. // Copyright Syncfusion Inc. 2001-2015. All rights reserved. // Use of this code is subject to the terms of our license. // A copy of the current license can be obtained at any time by e-mailing // licensing@syncfusion.com. Any infringement will be prosecuted under // applicable laws. #endregion using System; using Xamarin.Forms; using Syncfusion.SfNumericTextBox.XForms; namespace SampleBrowser { public class NumericTextBox :SamplePage { Label label1,label2,label3,label4,label5,label6,label7; Label label11,label12; PickerExt picker; Switch toggle1; SfNumericTextBox numericTextBox1,numericTextBox2,numericTextBox3,numericTextBox4; public NumericTextBox () { double height = Bounds.Height; double width = App.ScreenWidth; if (Device.Idiom == TargetIdiom.Tablet) { width /= 2; } label1 = new Label() { Text = "Simple Interest Calculator", HeightRequest = 40, HorizontalOptions = LayoutOptions.Center, TextColor = Color.Black }; label2 = new Label() { Text = "The formula for finding simple interest is :", HeightRequest = 45, HorizontalOptions = LayoutOptions.Center, TextColor = Color.Black }; label3 = new Label() { Text = "Interest = Principal * Rate * Time", HeightRequest = 40, HorizontalOptions = LayoutOptions.Center, TextColor = Color.Black }; label4 = new Label() { Text = "Principal", HeightRequest = 40, WidthRequest = width / 2, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black }; label5 = new Label() { Text = "Interest Rate", HeightRequest = 40, WidthRequest = width / 2, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black }; label6 = new Label() { Text = "Term", HeightRequest = 40, WidthRequest = width / 2, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black }; label7 = new Label() { Text = "Interest", HeightRequest = 40, WidthRequest = width / 2, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Black }; label11 = new Label() { Text = " " + "Culture", HeightRequest = 40, WidthRequest = width / 2, HorizontalOptions = LayoutOptions.Start, TextColor = Color.Gray }; label12 = new Label() { Text = " " + "AllowNull", HeightRequest = 40, WidthRequest = width / 2, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.Center, TextColor = Color.Gray }; label1.FontAttributes = FontAttributes.None; label1.FontSize = 22; label2.FontAttributes = FontAttributes.None; label2.FontSize = 20; label3.FontAttributes = FontAttributes.None; label3.FontSize = 20; label4.FontAttributes = FontAttributes.None; label4.FontSize = 18; label5.FontAttributes = FontAttributes.None; label5.FontSize = 18; label6.FontAttributes = FontAttributes.None; label6.FontSize = 18; label7.FontAttributes = FontAttributes.None; label7.FontSize = 18; label11.FontAttributes = FontAttributes.None; label11.FontSize = 20; label12.FontAttributes = FontAttributes.None; label12.FontSize = 20; label12.YAlign = TextAlignment.Center; toggle1 = new Switch(); toggle1.IsToggled = true; toggle1.HorizontalOptions = LayoutOptions.Start; toggle1.VerticalOptions = LayoutOptions.Center; toggle1.Toggled += (object sender, ToggledEventArgs e) => { numericTextBox1.AllowNull = e.Value; numericTextBox2.AllowNull = e.Value; numericTextBox3.AllowNull = e.Value; numericTextBox4.AllowNull = e.Value; }; picker = new PickerExt(); picker.VerticalOptions = LayoutOptions.Start; picker.Items.Add("United States"); picker.Items.Add("United Kingdom"); picker.Items.Add("Japan"); picker.Items.Add("France"); picker.Items.Add("Italy"); picker.SelectedIndexChanged+= (object sender, EventArgs e) => { switch (picker.SelectedIndex) { case 0: { numericTextBox1.Culture = new System.Globalization.CultureInfo("en-US"); numericTextBox2.Culture = new System.Globalization.CultureInfo("en-US"); numericTextBox4.Culture = new System.Globalization.CultureInfo("en-US"); numericTextBox3.Culture = new System.Globalization.CultureInfo("en-US"); } break; case 1: { numericTextBox1.Culture = new System.Globalization.CultureInfo("en-GB"); numericTextBox2.Culture = new System.Globalization.CultureInfo("en-GB"); numericTextBox3.Culture = new System.Globalization.CultureInfo("en-GB"); numericTextBox4.Culture = new System.Globalization.CultureInfo("en-GB"); } break; case 2: { numericTextBox1.Culture = new System.Globalization.CultureInfo("ja-JP"); numericTextBox2.Culture = new System.Globalization.CultureInfo("ja-JP"); numericTextBox3.Culture = new System.Globalization.CultureInfo("ja-JP"); numericTextBox4.Culture = new System.Globalization.CultureInfo("ja-JP"); } break; case 3: { numericTextBox1.Culture = new System.Globalization.CultureInfo("fr-FR"); numericTextBox2.Culture = new System.Globalization.CultureInfo("fr-FR"); numericTextBox3.Culture = new System.Globalization.CultureInfo("fr-FR"); numericTextBox4.Culture = new System.Globalization.CultureInfo("fr-FR"); } break; case 4: { numericTextBox1.Culture = new System.Globalization.CultureInfo("it-IT"); numericTextBox2.Culture = new System.Globalization.CultureInfo("it-IT"); numericTextBox3.Culture = new System.Globalization.CultureInfo("it-IT"); numericTextBox4.Culture = new System.Globalization.CultureInfo("it-IT"); } break; } }; numericTextBox1 = new SfNumericTextBox(); numericTextBox1.Watermark = "Enter Principal"; numericTextBox1.AllowNull = true; numericTextBox1.MaximumNumberDecimalDigits = 2; numericTextBox1.ValueChangeMode = ValueChangeMode.OnKeyFocus; numericTextBox1.FormatString = "c"; numericTextBox1.Value = 1000; numericTextBox1.HorizontalOptions = LayoutOptions.End; numericTextBox1.VerticalOptions = LayoutOptions.Center; numericTextBox1.ValueChanged+= (object sender, ValueEventArgs e) => { numericTextBox4.Value = numericTextBox2.Value*e.Value*numericTextBox3.Value; }; numericTextBox1.Culture = new System.Globalization.CultureInfo("en-US"); numericTextBox2 = new SfNumericTextBox(); numericTextBox2.Watermark = "Enter RI"; numericTextBox2.AllowNull = true; numericTextBox2.MaximumNumberDecimalDigits = 0; numericTextBox2.PercentDisplayMode = PercentDisplayMode.Compute; numericTextBox2.ValueChangeMode = ValueChangeMode.OnKeyFocus; numericTextBox2.FormatString = "p"; numericTextBox2.Value = 0.1f; numericTextBox2.HorizontalOptions = LayoutOptions.End; numericTextBox2.VerticalOptions = LayoutOptions.Center; numericTextBox2.Culture = new System.Globalization.CultureInfo("en-US"); numericTextBox2.ValueChanged+= (object sender, ValueEventArgs e) => { numericTextBox4.Value = numericTextBox1.Value*e.Value*numericTextBox3.Value; }; numericTextBox3 = new SfNumericTextBox(); numericTextBox3.Watermark = "Enter Years"; numericTextBox3.AllowNull = true; numericTextBox3.MaximumNumberDecimalDigits = 0; numericTextBox3.ValueChangeMode = ValueChangeMode.OnKeyFocus; numericTextBox3.FormatString = "years"; numericTextBox3.Value = 20; numericTextBox3.HorizontalOptions = LayoutOptions.End; numericTextBox3.VerticalOptions = LayoutOptions.Center; numericTextBox3.ValueChanged+= (object sender, ValueEventArgs e) => { numericTextBox4.Value = numericTextBox1.Value*numericTextBox2.Value*e.Value; }; numericTextBox3.Culture = new System.Globalization.CultureInfo("en-US"); numericTextBox4 = new SfNumericTextBox(); numericTextBox4.Watermark = "Enter a number"; numericTextBox4.AllowNull = true; numericTextBox4.MaximumNumberDecimalDigits = 0; numericTextBox4.ValueChangeMode = ValueChangeMode.OnKeyFocus; numericTextBox4.HorizontalOptions = LayoutOptions.End; numericTextBox4.FormatString = "c"; numericTextBox4.Value = (float)1000*0.1*20; numericTextBox4.VerticalOptions = LayoutOptions.Center; numericTextBox4.Culture = new System.Globalization.CultureInfo("en-US"); numericTextBox4.IsEnabled = false; this.BackgroundColor = Color.White; if (Device.OS == TargetPlatform.iOS) { numericTextBox1.WidthRequest = width / 2; numericTextBox2.WidthRequest = width / 2; numericTextBox3.WidthRequest = width / 2; numericTextBox4.WidthRequest = width / 2; toggle1.WidthRequest = width / 2; } else if (Device.OS == TargetPlatform.WinPhone) { numericTextBox1.WidthRequest = width / 2; numericTextBox2.WidthRequest = width / 2; numericTextBox3.WidthRequest = width / 2; numericTextBox4.WidthRequest = width / 2; toggle1.WidthRequest = width / 2; toggle1.HorizontalOptions = LayoutOptions.End; label1.TextColor = Color.White; label2.TextColor = Color.White; label3.TextColor = Color.White; label4.TextColor = Color.White; label5.TextColor = Color.White; label6.TextColor = Color.White; label7.TextColor = Color.White; numericTextBox1.BackgroundColor = Color.White; numericTextBox2.BackgroundColor = Color.White; numericTextBox3.BackgroundColor = Color.White; numericTextBox4.BackgroundColor = Color.White; numericTextBox2.FormatString = "0 %"; numericTextBox3.FormatString = "0 years"; this.BackgroundColor = Color.Black; } else { numericTextBox1.WidthRequest = width / 3; numericTextBox2.WidthRequest = width / 3; numericTextBox3.WidthRequest = width / 3; numericTextBox4.WidthRequest = width / 3; } if (Device.OS == TargetPlatform.Windows) { label1.TextColor = Color.Gray; label2.TextColor = Color.Gray; label3.TextColor = Color.Gray; label4.TextColor = Color.Gray; label5.TextColor = Color.Gray; label6.TextColor = Color.Gray; label7.TextColor = Color.Gray; numericTextBox1.BackgroundColor = Color.White; numericTextBox2.BackgroundColor = Color.White; numericTextBox3.BackgroundColor = Color.White; numericTextBox4.BackgroundColor = Color.White; this.BackgroundColor = Color.Black; numericTextBox2.FormatString = "0 %"; numericTextBox3.FormatString = "0 years"; if (Device.Idiom != TargetIdiom.Tablet) { numericTextBox4.IsEnabled = true; } } this.ContentView = GetNumeric(); PropertyView = GetOptionPage(); } private StackLayout GetNumeric() { picker.SelectedIndex = 0; var row1 = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { label4, numericTextBox1 } }; var row2 = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { label5, numericTextBox2 } }; var row3 = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { label6, numericTextBox3 } }; var row4 = new StackLayout { Orientation = StackOrientation.Horizontal, Children = { label7, numericTextBox4 } }; if (Device.Idiom == TargetIdiom.Tablet) { row1.HorizontalOptions = row2.HorizontalOptions = row3.HorizontalOptions = row4.HorizontalOptions = LayoutOptions.Center; } var mainStack = new StackLayout { Spacing = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 30), Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 20), Children = { label1, label2, label3, row1, row2, row3, row4 } }; return mainStack; } private StackLayout GetOptionPage() { var row1 = new StackLayout { Children = { label12, toggle1 } }; if (Device.OS == TargetPlatform.Windows) row1.Orientation = StackOrientation.Vertical; else row1.Orientation = StackOrientation.Horizontal; var row2 = new StackLayout { Orientation = StackOrientation.Vertical, Children = { label11, picker } }; var mainStack = new StackLayout { Spacing = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 50), Padding = Device.OnPlatform(iOS: 10, Android: 10, WinPhone: 10), Children = { row2, row1 } }; return mainStack; } } }
using System; using System.Collections.Generic; using System.Text; using Xunit; using DinoDiner.Menu; using System.Collections.ObjectModel; namespace MenuTest { public class OrderClassTest { class NegativeMockEntree: Entree { public NegativeMockEntree() { this.Price = -2.50; } public override string ToString() { return "Entree"; } } class MockEntree: Entree { public MockEntree() { this.Price = 15.50; } public override string ToString() { return "Entree"; } } class MockDrink: Drink { public MockDrink() { this.Price = 5.55; } public override string ToString() { return "Drink"; } } class MockSide: Side { public MockSide() { this.Price = 7.77; } public override string ToString() { return "Side"; } } [Fact] public void ShouldNotAllowNegativeSubTotalForNegativeMockEntree() { Order o = new Order(); o.Add(new NegativeMockEntree()); Assert.Equal<double>(0, Math.Round(o.SubTotalCost, 2)); } [Fact] public void ShouldHaveCorrectSubTotalCostForMockDrink() { Order o = new Order(); o.Add(new MockDrink()); Assert.Equal<double>(5.55,o.SubTotalCost); } [Fact] public void ShouldHaveCorrectSubTotalCostForMockEntree() { Order o = new Order(); o.Add(new MockEntree()); Assert.Equal<double>(15.50, Math.Round(o.SubTotalCost, 2)); } [Fact] public void ShouldHaveCorrectSubTotalCostForMockSide() { Order o = new Order(); o.Add(new MockSide()); Assert.Equal<double>(7.77, Math.Round(o.SubTotalCost, 2)); } [Fact] public void ShouldHaveCorrectSubTotalCostForAllItems() { Order o = new Order(); o.Add(new MockDrink()); o.Add(new MockSide()); o.Add(new MockEntree()); Assert.Equal<double>(28.82, o.SubTotalCost); } [Fact] public void TestThatTotalCostCantBeNegative() { Order o = new Order(); o.Add(new NegativeMockEntree()); Assert.Equal<double>(0, Math.Round(o.SalesTaxCost, 2)); } [Fact] public void ShouldHaveCorrectSalesTaxCostForMockDrink() { Order o = new Order(); o.Add(new MockDrink()); Assert.Equal<double>(2.78, Math.Round(o.SalesTaxCost,2)); } [Fact] public void ShouldHaveCorrectSalesTaxCostForMockEntree() { Order o = new Order(); o.Add(new MockEntree()); Assert.Equal<double>(7.75, Math.Round(o.SalesTaxCost, 2)); } [Fact] public void ShouldHaveCorrectSalesTaxCostForNegativeMockEntree() { Order o = new Order(); o.Add(new NegativeMockEntree()); Assert.Equal<double>(0, o.SalesTaxCost); } [Fact] public void ShouldHaveCorrectSalesTaxCostForMockSide() { Order o = new Order(); o.Add(new MockSide()); Assert.Equal<double>(3.88, Math.Round(o.SalesTaxCost, 2)); } [Fact] public void ShouldHaveCorrectTotalCostForMockDrink() { Order o = new Order(); o.Add(new MockDrink()); Assert.Equal<double>(8.32, Math.Round(o.TotalCost,2)); } [Fact] public void ShouldHaveCorrectTotalCostForMockEntree() { Order o = new Order(); o.Add(new MockEntree()); Assert.Equal<double>(23.25, Math.Round(o.TotalCost, 2)); } [Fact] public void ShouldHaveCorrectTotalCostForNegativeMockEntree() { Order o = new Order(); o.Add(new NegativeMockEntree()); Assert.Equal<double>(0, o.TotalCost); } [Fact] public void ShouldHaveCorrectTotalCostForMockSide() { Order o = new Order(); o.Add(new MockSide()); Assert.Equal<double>(11.66, Math.Round(o.TotalCost,2)); } } }
using System; using UnityEngine.Video; namespace Ads.Promo.Data { [Serializable] public class Videos { public VideoClip video480; public VideoClip GetForSize(VideoSize size) { switch (size) { case VideoSize.Video480: default: return video480; } } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace GestDep.Entities { public partial class Activity { public Activity() { Has = new List<Enrollment>(); Alocates = new List<Room>(); this.Manages = instructor; } public Activity(Days activityDays, Boolean cancelled, string description, TimeSpan duration, DateTime finishDate, int id, int maximumEnrollments, int minimumEnrollments, double price, DateTime startDate, DateTime startHour){ ActivityDays = activityDays; Cancelled = cancelled; Description = description; Duration = duration; FinishDate = finishDate; Id = id; MaximumEnrollments = maximumEnrollments; MinimumEnrollments = minimumEnrollments; Price = price; StartDate = startDate; StartHour = startHour; Has = new List<Enrollment>(); Alocates = new List<Room>(); this.Manages = instructor; } } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Forms; using System.Linq.Expressions; namespace Relocation.Com { public static partial class Expend { /// <summary> /// 返回异常信息的描述文本(如果有内部异常,则返回内部异常的描述文本) /// </summary> /// <param name="source"></param> /// <returns></returns> public static string GetInnerExceptionMessage(this Exception source) { return source.InnerException == null ? source.Message : source.InnerException.Message; } public static int ToInt(this int? source) { return source==null?0:(int)source; } /// <summary> /// 是否大于0 /// </summary> static public bool IsGreaterThanZero(this int? source) { return source.HasValue ? (source.Value > 0) : false; } public static decimal ToDecimal(this decimal? source) { return source == null ? 0 : (decimal)source; } public static string ToDecimalString(this decimal? source) { return source.ToDecimal().ToString("0.00"); } public static string ToString(this DateTime? source,string formatString) { if (string.IsNullOrEmpty(formatString)) formatString = "yyyy年MM月dd日"; return source.HasValue ? source.Value.ToString(formatString) : string.Empty; } /// <summary> /// 判断当前decimal?是否为空或者0 /// </summary> public static bool IsNullOrZero(this decimal? source) { return source.HasValue || source.Value==0; } /// <summary> /// 将单引号转换成两个单引号 /// </summary> /// <param name="source"></param> /// <returns></returns> static public string GetSQLSafe(this string source) { return source.Replace("'", "''"); } /// <summary> /// 比较两个字符串是否相等,不同的是此比较将null和""(string.Empty)视为相等 /// </summary> /// <param name="source"></param> /// <param name="tagString"></param> /// <returns></returns> static public bool EqualsNullable(this string source,string tagString) { if (string.IsNullOrEmpty(source) && string.IsNullOrEmpty(tagString)) return true; return source.Equals(tagString); } /// <summary> /// 在拥有此控件的基础窗口句柄的线程上执行指定的委托。 /// </summary> /// <param name="source"></param> /// <param name="methodInvoker"></param> static public void ExecInvoke(this Control source, MethodInvoker methodInvoker) { if (methodInvoker == null) return; if (source.Created && source.InvokeRequired) { source.Invoke(methodInvoker); } else { methodInvoker(); } } static public bool IsOK(this DialogResult source) { return DialogResult.OK.Equals(source); } static public bool IsYes(this DialogResult source) { return DialogResult.Yes.Equals(source); } } }
using MISA.Core.Interfaces; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MISA.Infrastructure.Repository { public class UnitOfWork : IUnitOfWork { public ICountryRepository Country { get; } public IProvinceRepository Province { get; } public IDistrictRepository District { get; } public IWardRepository Ward { get; } public IStoreRepository Store { get; } public UnitOfWork (IStoreRepository storeRepository, ICountryRepository countryRepository, IProvinceRepository provinceRepository, IDistrictRepository districtRepository, IWardRepository wardRepository) { Country = countryRepository; Province = provinceRepository; District = districtRepository; Ward = wardRepository; Store = storeRepository; } } }
// <copyright file="ReadersQuery.cs" company="PlaceholderCompany"> // Copyright (c) PlaceholderCompany. All rights reserved. // </copyright> namespace Library.Models { /// <summary> /// /// </summary> public class ReadersQuery : Query { /// <summary> /// /// </summary> public string Name { get; set; } /// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="page"></param> /// <param name="itemsPerPage"></param> public ReadersQuery(string name, int page, int itemsPerPage) : base(page, itemsPerPage) { Name = name; } } }
using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Diagnostics; using System.Linq; using System.Net; using System.Text; namespace LD30 { class Message { public int Id = -1; public string[] Text = new string[3]; public string Regards = "Regards "; public DateTime Time = DateTime.Now; public long Views; public void NetSend() { using (var client = new WebClient()) { client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; var values = new NameValueCollection(); values.Add("id", Id.ToString()); values.Add("message", Text[0] + "\n" + Text[1] + "\n" + Text[2]); values.Add("regards", Regards); var response = client.UploadValues("http://37.139.17.207/LD30_Server/index.php", "POST", values); Debug.WriteLine("Response: " + Encoding.UTF8.GetString(response)); } } public static Message ReceiveRandom() { var msg = new Message(); string response = null; using (var client = new WebClient()) { client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded"; var values = new NameValueCollection(); values.Add("MessageRequest", Game.MessageRequest); var raw = client.UploadValues("http://37.139.17.207/LD30_Server/index.php", "POST", values); response = Encoding.UTF8.GetString(raw); Debug.WriteLine("Response: " + response); } var split = response.Split(new string[] { Game.NetSeparator }, StringSplitOptions.None); msg.Id = int.Parse(split[0]); msg.Text = split[1].Split('\n'); msg.Regards = split[2]; msg.Time = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc).AddSeconds(double.Parse(split[3])).ToLocalTime(); msg.Views = int.Parse(split[4]); return msg; } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; public class lrHeuristicScript : HueristicScript { public override float Hueristic(int x, int y, Vector3 start, Vector3 goal, GridScript gridScript){ // return 0; float heur; float currentHeur; heur = (Mathf.Abs (goal.x - x) + Mathf.Abs (goal.y - y)) * gridScript.costs [0]; // Debug.Log (heur); return heur; } }
// <copyright file="StatusViewModel.cs" company="Soloplan GmbH"> // Copyright (c) Soloplan GmbH. All rights reserved. // Licensed under the MIT License. See License-file in the project root for license information. // </copyright> namespace Soloplan.WhatsON.GUI.Common.ConnectorTreeView { using System; using NLog; using Soloplan.WhatsON.Model; /// <summary> /// Base ViewModel used for any kind of <see cref="Soloplan.WhatsON.Connector"/>. /// </summary> public class StatusViewModel : NotifyPropertyChanged { /// <summary> /// The logger. /// </summary> private static readonly Logger log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType?.ToString()); private string name; private string details; private DateTime time; private ObservationState state; private bool failure; private bool unknown; private bool succees; private bool unstable; private bool first; private string label; private string errorMessage; public StatusViewModel(ConnectorViewModel connector) { this.Parent = connector; } public bool First { get => this.first; set { if (this.first != value) { this.first = value; this.OnPropertyChanged(); } } } public int Size { get { return this.First ? 6 : 4; } } public string Name { get { return this.name; } protected set { if (this.name != value) { this.name = value; this.OnPropertyChanged(); } } } public virtual string Label { get { return this.label; } protected set { if (this.label != value) { this.label = value; this.OnPropertyChanged(); } } } public string Details { get { return this.details; } protected set { if (this.details != value) { this.details = value; this.OnPropertyChanged(); } } } public ObservationState State { get => this.state; set { if (this.state != value) { this.state = value; this.OnPropertyChanged(); } } } public virtual DateTime Time { get { return this.time; } protected set { this.time = value; this.OnPropertyChanged(); } } public bool Failure { get => this.failure; set { this.failure = value; this.OnPropertyChanged(); } } public bool Unknown { get => this.unknown; set { this.unknown = value; this.OnPropertyChanged(); } } public bool Succees { get => this.succees; set { this.succees = value; this.OnPropertyChanged(); } } public bool Unstable { get => this.unstable; set { this.unstable = value; this.OnPropertyChanged(); } } public string ErrorMessage { get => this.errorMessage; set { this.errorMessage = value; this.OnPropertyChanged(); } } public ConnectorViewModel Parent { get; } public virtual void Update(Status newStatus) { log.Trace("Updating status model {model}", new { this.Name, Details = this.Details }); if (newStatus == null) { this.Name = "Loading..."; this.Details = "Loading..."; this.state = ObservationState.Unknown; return; } this.Name = newStatus.Name; this.Details = newStatus.Details; this.Time = newStatus.Time; this.State = newStatus.State; } /// <summary> /// Updates flags used to control visibility of controls based on <see cref="State"/>. /// </summary> protected virtual void UpdateStateFlags() { this.Succees = false; this.Failure = false; this.Unknown = false; this.Unstable = false; switch (this.State) { case ObservationState.Unknown: this.Unknown = true; break; case ObservationState.Unstable: this.Unstable = true; break; case ObservationState.Failure: this.Failure = true; break; case ObservationState.Success: this.Succees = true; break; } } } }
namespace Triton.Bot { using System; public enum PracticeDifficulty { Normal, Expert } }
using System; using static System.Console; using static System.Convert; namespace CastingConverting { class Program { static void Main(string[] args) { double g = 9.8; int h = ToInt32(g); WriteLine($"g is {g} and h is {h}"); byte[] binaryObject = new byte[128]; (new Random()).NextBytes(binaryObject); WriteLine("Binary Object as bytes:"); for (int index = 0; index < binaryObject.Length; index++) { Write($"{binaryObject[index]:X} "); } WriteLine(); string encoded = Convert.ToBase64String(binaryObject); WriteLine($"Binary Object as Base64: {encoded}"); } } }