static void Main() { Corp crp1 = new Corp(); crp1.Display(); Corp crp2; WriteLine("enter id: "); int Id = ToInt32(ReadLine()); WriteLine("enter name: "); string N = ReadLine(); WriteLine("enter marks in web basics: "); decimal WebBscMarks = ToDecimal(ReadLine()); WriteLine("enter marks in .NET: "); decimal DotNetMarks = ToDecimal(ReadLine()); WriteLine("enter marks in foundation courses: "); decimal FoundMarks = ToDecimal(ReadLine()); decimal TMarks = 300; //given in question crp2 = new Corp(Id, N, WebBscMarks, DotNetMarks, TMarks, FoundMarks); crp2.Display(); }
private void button1_Click(object sender, EventArgs e) { Corp = DrawCorp(Graphics.FromHwnd(pictureBox1.Handle)); Roof = DrawRoof(Graphics.FromHwnd(pictureBox1.Handle)); BackWheel = DrawWheel(Graphics.FromHwnd(pictureBox1.Handle)); FrontWheel = DrawWheel(Graphics.FromHwnd(pictureBox1.Handle), 240); Lamp = DrawLamp(Graphics.FromHwnd(pictureBox1.Handle)); RoofDecor = DrawRoofDecor(Graphics.FromHwnd(pictureBox1.Handle)); for (var i = 0; i < 400; i++) { Thread.Sleep(12); Corp.Clear(BackColor); Roof.Clear(BackColor); BackWheel.Clear(BackColor); FrontWheel.Clear(BackColor); Corp = DrawCorp(Corp, 0 + i); Roof = DrawRoof(Roof, 75 + i); BackWheel = DrawWheel(BackWheel, 50 + i, 190, i / 3); FrontWheel = DrawWheel(FrontWheel, 240 + i, 190, i / 3); Lamp = DrawLamp(Lamp, 340 + i); RoofDecor = DrawRoofDecor(RoofDecor, i); } }
public void TestGetCorpId() { DataSourceContext dsContext = new DataSourceContext(); string ss = "{'CorpList':[{'CorpName':'','CorpId':''}]}"; var ss111 = JsonConvert.DeserializeObject <CorpsResult>(ss); var result = Corp.GetCorpId(); }
void Start() { advance = 0; complete = false; corp = GameObject.FindObjectOfType(typeof(Corp)) as Corp; gameController = GameObject.FindObjectOfType<GameController>() as GameController; }
void Start() { advance = 0; complete = false; corp = GameObject.FindObjectOfType(typeof(Corp)) as Corp; gameController = GameObject.FindObjectOfType <GameController>() as GameController; }
public override void effect() { Debug.Log("Beanstalk!"); timer(1); Corp corp = findCorp(); corp.credits += 3; }
public ActionResult List(DeptListVM listvm) { if (corp == null) { corp = GetLoginCorp(); } listvm.ResultList = corp.Depts.View <DeptListVM.ListRow>(listvm.Input.Pager, null, listvm.Input.OrderExpression); return(ForView("List", listvm)); }
private void ValidateCorp(string corpStr) { Corp corp; bool valid = Enum.TryParse <Corp>(corpStr, out corp); if (valid) { this.Corp = corp; } }
public ActionResult Delete(DeptListVM listvm) { throw new Exception("eee"); corp = GetLoginCorp(); foreach (var id in listvm.Input.SelectedValues) { DeptBD.Delete(id); } return(List(listvm)); }
private void ParseCorps(string corpsStr) { Corp corps; bool parsed = Enum.TryParse <Corp>(corpsStr, out corps); if (!parsed) { throw new InvalidCorpException(); } this.Corps = corps; }
private void ParseCorps(Corp corp) { bool isParseCorp = Enum.TryParse <Corp>(corps, out corp); if (!isParseCorp) { throw new InvalidCorpsException(); } this.Corps = corp; }
public List<Ability> deal() { List<Ability> temp = new List<Ability>(); corp = GameObject.FindObjectOfType (typeof(Corp)) as Corp; deck = corp.deck; for (int i = 1; i <= corp.handSize; i++) { temp.Add (draw (ref deck)); //Debug.Log("Added card to hand"); } return temp; }
public override void effect() { //TODO Upgrade for only HQ // Has HQ been upgraded? // yes, popup error and return // no, place at HQ Debug.Log("Research Station"); Corp corp = findCorp(); corp.handSize += 2; }
public List <Ability> deal() { List <Ability> temp = new List <Ability>(); corp = GameObject.FindObjectOfType(typeof(Corp)) as Corp; deck = corp.deck; for (int i = 1; i <= corp.handSize; i++) { temp.Add(draw(ref deck)); //Debug.Log("Added card to hand"); } return(temp); }
public override void effect() { Debug.Log("Hedge Fund"); Corp corp = findCorp(); if (corp.credits >= cost) { corp.credits += 4; timer(1); } else { // Tell the player that they can't afford it (popup?) Debug.Log("You can't afford that Initiative right now"); } }
private void Save(CorpEditVM.EditInput input) { Corp corp; if (input.Id == 0) { corp = new Corp(); } else { corp = CorpBD.Get(input.Id); } corp.Name = input.Name; corp.Phone = input.Phone; CorpBD.Save(corp); }
public async Task <IActionResult> TicketViews(int id, string accion) { try { String token = HttpContext.Session.GetString("TOKEN"); if (accion == "pdf") { DateTime fecha = DateTime.Now; List <FacturaDetalle> factList = await this.ServiceApi.GetFacturasDetailByClientAsync(token, id, fecha.Date); Corp corp = await this.ServiceApi.GetCorpAsync(token); Helpers.PdfService.PDFFormat(factList, factList.First().emision, corp); } } catch (Exception e) { Console.WriteLine($"Error in TicketView Post with message {e.Message}"); } return(RedirectToAction("TicketView", "Caja", new { id = id })); }
private bool CreateCorp(PlexingFleetDataContext context) { Rule rule = context.Rules.FirstOrDefault(x => x.Id.Value == CorpId); if (rule == null) { rule = new Rule() { Id = CorpId, RuleName = CorpName, Allowed = true, }; context.Rules.InsertOnSubmit(rule); } else { if (rule.Allowed.HasValue && !rule.Allowed.Value) { return(false); } } Corp corp = new Corp() { CorpId = this.CorpId, CorpName = this.CorpName, CorpTag = this.CorpTickerTextBox.Text, AllianceId = this.AllianceId == 0 ? -1 : this.AllianceId, AllianceName = this.AllianceName, AllianceTag = this.AllianceTickerTextBox.Text, Enabled = true }; context.Corps.InsertOnSubmit(corp); context.SubmitChanges(); return(true); }
public Engineer(string id, string firstName, string lastName, decimal salary, Corp corp) : base(id, firstName, lastName, salary, corps) { this._repears = new List <IRepair>(); }
public Commando(string id, string firstName, string lastName, decimal salary, Corp corp) : base(id, firstName, lastName, salary, corp) { this.missions = new List <IMission>(); }
public Engineer(int id, string firstName, string lastName, decimal salary, Corp corp) : base(id, firstName, lastName, salary) { this.Corp = corp; this.Repairs = new List <Repair>(); }
public void Run() { string inputLine; while ((inputLine = Console.ReadLine()) != "End") { string[] soldierInfo = inputLine.Split(); string soldierType = soldierInfo[0]; int id = int.Parse(soldierInfo[1]); string firstName = soldierInfo[2]; string lastName = soldierInfo[3]; if (soldierType == "Private") { decimal salary = decimal.Parse(soldierInfo[4]); Private @private = null; @private = new Private(id, firstName, lastName, salary); privates.Add(@private); Console.WriteLine(@private.ToString()); } if (soldierType == "LieutenantGeneral") { decimal salary = decimal.Parse(soldierInfo[4]); LieutenantGeneral lieutenantGeneral = new LieutenantGeneral(id, firstName, lastName, salary); for (int i = 5; i < soldierInfo.Length; i++) { int currentId = int.Parse(soldierInfo[i]); Soldier currentPrivate = privates.FirstOrDefault(p => p.Id == currentId); lieutenantGeneral.Privates.Add(currentPrivate); } privates.Add(lieutenantGeneral); Console.WriteLine(lieutenantGeneral.ToString()); } if (soldierType == "Engineer") { decimal salary = decimal.Parse(soldierInfo[4]); if (soldierInfo[5] != "Airforces" && soldierInfo[5] != "Marines") { continue; } Corp corp = (Corp)Enum.Parse(typeof(Corp), soldierInfo[5]); Engineer engineer = new Engineer(id, firstName, lastName, salary, corp); for (int i = 6; i < soldierInfo.Length - 1; i = i + 2) { string currentPart = soldierInfo[i]; int currentHours = int.Parse(soldierInfo[i + 1]); Repair repair = new Repair(currentPart, currentHours); engineer.Repairs.Add(repair); } privates.Add(engineer); Console.WriteLine(engineer.ToString()); } else if (soldierType == "Commando") { decimal salary = decimal.Parse(soldierInfo[4]); if (soldierInfo[5] != "Airforces" && soldierInfo[5] != "Marines") { continue; } Corp corp = (Corp)Enum.Parse(typeof(Corp), soldierInfo[5]); Commando commando = new Commando(id, firstName, lastName, salary, corp); for (int i = 6; i < soldierInfo.Length - 1; i = i + 2) { string codeName = soldierInfo[i]; string state = soldierInfo[i + 1]; if (state == "inProgress" || state == "Finished") { Mission mission = new Mission(codeName, state); commando.Missions.Add(mission); } } privates.Add(commando); Console.WriteLine(commando.ToString()); } else if (soldierType == "Spy") { int codeNumber = int.Parse(soldierInfo[4]); Spy spy = new Spy(id, firstName, lastName, codeNumber); privates.Add(spy); Console.WriteLine(spy.ToString()); } } }
void Start() { name = "payment"; description = "This is the payment subroutine!"; corp = this.gameObject.GetComponent<Corp>(); }
protected void RegisterLinkButton_Click(object sender, EventArgs e) { PasswordMismatchLabel.Visible = false; if (PasswordTextBox.Text != ConfirmPasswordTextBox.Text || PasswordTextBox.Text.Trim().Length < 6) { PasswordMismatchLabel.Visible = true; return; } else { using (PlexingFleetDataContext context = new PlexingFleetDataContext(WebConfigurationManager.ConnectionStrings["PlexManagerConnectionString"].ConnectionString)) { PlexUser plexUser = context.PlexUsers.FirstOrDefault(x => x.CharacterId == CharacterId); if (plexUser != null) { ShowRegistryInformation(false, "Your character have already been registered."); //User already exists, dont register again return; } else { plexUser = new PlexUser(); }; plexUser.CharacterId = CharacterId; plexUser.CharacterName = CharacterName; plexUser.CorpId = CorpId; plexUser.CorpName = CorpName; plexUser.AllianceId = AllianceId; plexUser.AllianceName = AllianceName; plexUser.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(PasswordTextBox.Text, "md5"); plexUser.Enabled = true; context.PlexUsers.InsertOnSubmit(plexUser); Corp corp = context.Corps.FirstOrDefault(x => x.CorpId == CorpId); //Check to see if the person registring belongs to a corp that have not previously been added if (corp == null) { corp = new Corp() { CorpId = CorpId, CorpName = CorpName, AllianceId = AllianceId, AllianceName = AllianceName, Enabled = false }; context.Corps.InsertOnSubmit(corp); } context.SubmitChanges(); Response.Redirect(PageReferrer.Page_Login); } } }
public Engineer(int id, string firstName, string lastName, decimal salary, Corp corp) : base(id, firstName, lastName, salary, corp) { Repairs = new List <IRepair>(); }
public Commando(int id, string firstName, string lastName, decimal salary, Corp corp, List <IMission> missions) : base(id, firstName, lastName, salary, corp) { this.Missions = missions; }
void Awake() { mouseClick = GameObject.FindObjectOfType <MouseClick>() as MouseClick; corp = GameObject.FindObjectOfType <Corp>() as Corp; gameController = GameObject.FindObjectOfType <GameController>() as GameController; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoginButton.Style.Add(HtmlTextWriterStyle.Visibility, "hidden"); if (EveTrusted) { using (PlexingFleetDataContext context = new PlexingFleetDataContext(WebConfigurationManager.ConnectionStrings["PlexManagerConnectionString"].ConnectionString)) { var user = context.PlexUsers.FirstOrDefault(x => x.CharacterId == CharacterId); if (user != null) { UsernameTextBox.Text = CharacterName; if (user.AllianceId != AllianceId || user.CorpId != CorpId) { Corp corp = context.Corps.FirstOrDefault(x => x.CorpId == CorpId); if (corp == null) { Response.Redirect(PageReferrer.Page_Anonymous_AccessRequest); } //If the user have switched alliance and/or corporation update the database with the new information. user.AllianceId = AllianceId; user.AllianceName = AllianceName; user.CorpId = CorpId; user.CorpName = CorpName; //corp = context.Corps.FirstOrDefault(x => x.CorpId == CorpId); //The user have switched to a new corp that have not been registered yet if (corp == null) { corp = new Corp(); corp.CorpId = CorpId; corp.CorpName = CorpName; corp.AllianceId = AllianceId; corp.AllianceName = AllianceName; corp.CorpTag = CorpName.Length > 5 ? CorpName.Substring(0, 5) : CorpName; corp.AllianceTag = AllianceName.Length > 5 ? AllianceName.Substring(0, 5) : AllianceName; context.Corps.InsertOnSubmit(corp); } context.SubmitChanges(); } ShowLogin(true); return; } else { Response.Redirect(PageReferrer.Page_Register); } } } else { RememberMeCheckBox.Visible = false; RememberMeCheckBox.Checked = false; //ShowLogin(false); } } }
public Corp findCorp() { Corp corp = GameObject.FindObjectOfType(typeof(Corp)) as Corp; return(corp); }
public SpecialisedSoldier(int id, string firstName, string lastName, decimal salary, Corp corpSpecial) : base(id, firstName, lastName, salary) { CorpSpecial = corpSpecial; }
void Awake() { mouseClick = GameObject.FindObjectOfType<MouseClick>() as MouseClick; corp = GameObject.FindObjectOfType<Corp>() as Corp; gameController = GameObject.FindObjectOfType<GameController>() as GameController; }
public SpecialisedSoldier(int id, string firstName, string lastName, decimal salary, Corp corps) : base(id, firstName, lastName, salary) { this.Corps = corps; }
void Start() { name = "payment"; description = "This is the payment subroutine!"; corp = this.gameObject.GetComponent <Corp>(); }
/// <summary> /// 1.获取交叉数据绑定后台视图模型 /// -- 基本数据从Ticket表中获取 /// -- 再依据外键进行相应数据列匹配和选取(根据FORM请求进行数据筛选后再绑定) /// -- 取出所有数据后绑定报表文件展示 /// </summary> /// <returns></returns> public IActionResult CrossReport() { TDContext context = new TDContext(); List <Ticket> tickets = new List <Ticket>(); if (searchCondition.DateFrom != null && searchCondition.DateFrom.ToString() != "" && searchCondition.DateTo.ToString() != "" && searchCondition.DateTo != null) { tickets = context.Ticket.Where(t => t.TicketDate <searchCondition.DateTo && t.TicketDate> searchCondition.DateFrom).ToList(); } else { tickets = context.Ticket.FromSql("select * from Ticket").ToList(); } List <TicketView> tList = new List <TicketView>(); foreach (Ticket tic in tickets) { TicketView tView = new TicketView(); # region 产品过滤 Product product = new Product(); if (searchCondition.Product != null && searchCondition.Product != "") { product = context.Product.Where(p => p.ProductID == tic.ProductID && p.ProductName == searchCondition.Product).FirstOrDefault(); if (product == null) { continue; //问题 - 没有要不要显示? } } else { product = context.Product.Where(p => p.ProductID == tic.ProductID).FirstOrDefault(); } tView.Product = product; #endregion #region 区域过滤 办事处过滤 Corp issuer = context.Corp.Where(c => c.CorpID == tic.IssuerID).FirstOrDefault(); if (issuer.CorpLevel != "办事处") { //父企业 Corp parentCorp = context.Corp.Where(c => c.CorpID == issuer.ParentCorpID).FirstOrDefault(); if (searchCondition.Office != null && searchCondition.Office != "" && searchCondition.Office != parentCorp.CorpName) { continue; } //区域信息 Area areaInfo = context.Area.Where(a => a.AreaId == parentCorp.AreaID).FirstOrDefault(); if (searchCondition.Area != null && searchCondition.Area != "" && searchCondition.Area != areaInfo.AreaName) { continue; } //组合信息 IssuerArea i = new IssuerArea(); i.IssuerID = issuer.CorpID; i.IssuerParentArea = areaInfo.AreaName; i.IssuerParentName = parentCorp.CorpName; tView.IssuerArea = i; } else { //无父企业直接获得 IssuerArea i = new IssuerArea(); i.IssuerID = issuer.CorpID; i.IssuerParentArea = issuer.AreaName; if (searchCondition.Area != null && searchCondition.Area != "" && searchCondition.Area != issuer.AreaName) { continue; } i.IssuerParentName = issuer.CorpName; if (searchCondition.Office != null && searchCondition.Office != "" && searchCondition.Office != issuer.CorpName) { continue; } tView.IssuerArea = i; } #endregion #region 补全 var ParentType = typeof(Ticket); var Properties = ParentType.GetProperties(); foreach (var Propertie in Properties) { //循环遍历属性 if (Propertie.CanRead && Propertie.CanWrite) { //进行属性拷贝 Propertie.SetValue(tView, Propertie.GetValue(tic, null), null); } } #endregion tList.Add(tView); }