void HireButton_OnClicked() { List <Room> rooms = Faction.GetRooms(); bool hasBalloonPort = rooms.Any(room => room.RoomData.Name == "BalloonPort"); if (CurrentApplicant.Level.Pay * 4 > Faction.Economy.CurrentMoney) { Dialog.Popup(GUI, "Can't hire!", "We can't afford the signing bonus. Our treasury: " + Faction.Economy.CurrentMoney.ToString("C"), ButtonType.OK, 500, 300, this, LocalBounds.Width / 2 - 250, LocalBounds.Height / 2 - 150); } else if (!hasBalloonPort) { Dialog.Popup(GUI, "Can't hire!", "We can't hire anyone when there are no balloon ports.", ButtonType.OK, 500, 300, this, LocalBounds.Width / 2 - 250, LocalBounds.Height / 2 - 150); } else { Applicants.Remove(CurrentApplicant); Faction.Hire(CurrentApplicant); SoundManager.PlaySound(ContentPaths.Audio.cash); OnOnHired(CurrentApplicant); CurrentApplicant = Applicants.FirstOrDefault(); ApplicantSelector.ClearChildren(); ApplicantSelector.Items.Clear(); foreach (Applicant applicant in Applicants) { ApplicantSelector.AddItem(applicant.Level.Name + " - " + applicant.Name); } ApplicantPanel.SetApplicant(Applicants.FirstOrDefault()); WasSomeoneHired = true; } }
public void GetCaseInfo() { EnumsAll.CaseType caseType = EnumsAll.CaseType.Internal; var sOurNo = CommonFunction.GetOurNo(_sOurNo, ref caseType); if (string.IsNullOrEmpty(sOurNo)) { return; } s_OurNo = sOurNo; switch (caseType) { case EnumsAll.CaseType.Internal: { var dr = DbHelperOra.Query( $"select RECEIVED,CLIENT,CLIENT_NAME,APPL_CODE1,APPLICANT1,APPLICANT_CH1,APPL_CODE2,APPLICANT2,APPLICANT_CH2,APPL_CODE3,APPLICANT3,APPLICANT_CH3,APPL_CODE4,APPLICANT4,APPLICANT_CH4,APPL_CODE5,APPLICANT5,APPLICANT_CH5 from PATENTCASE where OURNO = '{_sOurNo}'").Tables[0].Rows[0]; if (!string.IsNullOrWhiteSpace(dr["RECEIVED"].ToString())) { dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString()); } if (!string.IsNullOrWhiteSpace(dr["CLIENT"].ToString())) { Client = Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dr["CLIENT"]}'")) ?? new Corporation(Session) { Code = dr["CLIENT"].ToString(), Name = dr["CLIENT_NAME"].ToString() } } ; Applicants.ToList().ForEach(a => Applicants.Remove(a)); for (int i = 1; i <= 5; i++) { if (!string.IsNullOrWhiteSpace(dr[$"APPL_CODE{i}"].ToString())) { Applicants.Add( Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dr[$"APPL_CODE{i}"]}'")) ?? new Corporation(Session) { Code = dr[$"APPL_CODE{i}"].ToString(), Name = string.IsNullOrWhiteSpace(dr[$"APPLICANT{i}"].ToString()) ? dr[$"APPLICANT_CH{i}"].ToString() : dr[$"APPLICANT{i}"].ToString() }); } } break; } case EnumsAll.CaseType.Foreign: { var dr = DbHelperOra.Query( $"select RECEIVED from FCASE where OURNO = '{_sOurNo}'") .Tables[0].Rows[0]; if (!string.IsNullOrWhiteSpace(dr["RECEIVED"].ToString())) { dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString()); } var dt = DbHelperOra.Query($"select EID,ROLE,ORIG_NAME,TRAN_NAME,ENT_ORDER from FCASE_ENT_REL where OURNO = '{_sOurNo}'").Tables[0]; var tempclient = dt.Select("ROLE = 'CLI' OR ROLE = 'APPCLI'"); if (tempclient.Length > 0) { Client = Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{tempclient[0]["EID"]}'")) ?? new Corporation(Session) { Code = tempclient[0]["EID"].ToString(), Name = !string.IsNullOrWhiteSpace(tempclient[0]["ORIG_NAME"].ToString()) ? tempclient[0]["ORIG_NAME"].ToString() : tempclient[0]["TRAN_NAME"].ToString() } } ; var tempagency = dt.Select("ROLE = 'AGT'"); if (tempagency.Length > 0) { Agency = Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{tempagency[0]["EID"]}'")) ?? new Corporation(Session) { Code = tempagency[0]["EID"].ToString(), Name = !string.IsNullOrWhiteSpace(tempagency[0]["ORIG_NAME"].ToString()) ? tempagency[0]["ORIG_NAME"].ToString() : tempagency[0]["TRAN_NAME"].ToString() } } ; Applicants.ToList().ForEach(a => Applicants.Remove(a)); foreach (var dataRow in dt.Select("ROLE = 'APP' OR ROLE = 'APPCLI'", "ENT_ORDER ASC")) { Applicants.Add( Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dataRow["EID"]}'")) ?? new Corporation(Session) { Code = dataRow["EID"].ToString(), Name = !string.IsNullOrWhiteSpace(dataRow["ORIG_NAME"].ToString()) ? dataRow["ORIG_NAME"].ToString() : dataRow["TRAN_NAME"].ToString() }); } break; } case EnumsAll.CaseType.Hongkong: { var dr = DbHelperOra.Query($"select cn_app_ref,RECEIVED from ex_hkcase where hk_app_ref = '{_sOurNo}'").Tables[0].Rows[0]; if (!string.IsNullOrWhiteSpace(dr["RECEIVED"]?.ToString())) { dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString()); } if (!string.IsNullOrWhiteSpace(dr["cn_app_ref"]?.ToString())) { var drCN = DbHelperOra.Query( $"select RECEIVED,CLIENT,CLIENT_NAME,APPL_CODE1,APPLICANT1,APPLICANT_CH1,APPL_CODE2,APPLICANT2,APPLICANT_CH2,APPL_CODE3,APPLICANT3,APPLICANT_CH3,APPL_CODE4,APPLICANT4,APPLICANT_CH4,APPL_CODE5,APPLICANT5,APPLICANT_CH5 from PATENTCASE where OURNO = '{dr["cn_app_ref"]?.ToString()}'").Tables[0].Rows[0]; if (!string.IsNullOrWhiteSpace(drCN["CLIENT"].ToString())) { Client = Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{drCN["CLIENT"]}'")) ?? new Corporation(Session) { Code = drCN["CLIENT"].ToString(), Name = drCN["CLIENT_NAME"].ToString() } } ; Applicants.ToList().ForEach(a => Applicants.Remove(a)); for (int i = 1; i <= 5; i++) { if (!string.IsNullOrWhiteSpace(drCN[$"APPL_CODE{i}"].ToString())) { Applicants.Add( Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{drCN[$"APPL_CODE{i}"]}'")) ?? new Corporation(Session) { Code = drCN[$"APPL_CODE{i}"].ToString(), Name = string.IsNullOrWhiteSpace(drCN[$"APPLICANT{i}"].ToString()) ? drCN[$"APPLICANT_CH{i}"].ToString() : drCN[$"APPLICANT{i}"].ToString() }); } } } break; } } Save(); } }
public void GetPatentInfo() { EnumsAll.CaseType caseType = EnumsAll.CaseType.Internal; var sOurNo = CommonFunction.GetOurNo(_sOurNo, ref caseType); if (string.IsNullOrEmpty(sOurNo)) { return; } s_OurNo = sOurNo; switch (caseType) { case EnumsAll.CaseType.Internal: { var dr = DbHelperOra.Query( $"select RECEIVED,CLIENT,CLIENT_NAME,APPL_CODE1,APPLICANT1,APPLICANT_CH1,APPL_CODE2,APPLICANT2,APPLICANT_CH2,APPL_CODE3,APPLICANT3,APPLICANT_CH3,APPL_CODE4,APPLICANT4,APPLICANT_CH4,APPL_CODE5,APPLICANT5,APPLICANT_CH5,TITLE_CHINESE,CLIENT_NUMBER,FILING_DUE,TITLE from PATENTCASE where OURNO = '{_sOurNo}'").Tables[0].Rows[0]; s_Name = dr["TITLE_CHINESE"].ToString(); if (string.IsNullOrWhiteSpace(s_Name)) { s_Name = dr["TITLE"].ToString(); } s_ClientRef = dr["CLIENT_NUMBER"].ToString(); if (!string.IsNullOrWhiteSpace(dr["RECEIVED"].ToString())) { dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString()); } if (!string.IsNullOrWhiteSpace(dr["FILING_DUE"].ToString())) { dt_FilingDeadline = Convert.ToDateTime(dr["FILING_DUE"].ToString()); } if (!string.IsNullOrWhiteSpace(dr["CLIENT"].ToString())) { Client = Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dr["CLIENT"]}'")) ?? new Corporation(Session) { Code = dr["CLIENT"].ToString(), Name = dr["CLIENT_NAME"].ToString() } } ; Applicants.ToList().ForEach(a => Applicants.Remove(a)); for (int i = 1; i <= 5; i++) { if (!string.IsNullOrWhiteSpace(dr[$"APPL_CODE{i}"].ToString())) { Applicants.Add( Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dr[$"APPL_CODE{i}"]}'")) ?? new Corporation(Session) { Code = dr[$"APPL_CODE{i}"].ToString(), Name = string.IsNullOrWhiteSpace(dr[$"APPLICANT{i}"].ToString()) ? dr[$"APPLICANT_CH{i}"].ToString() : dr[$"APPLICANT{i}"].ToString() }); } } var objDate = DbHelperOra.GetSingle( $"select duedate from generalalert where typeid = 'tohandle_presubmit' and comments like '%返稿发明人%' and ourno = '{s_OurNo}'"); if (objDate != null) { dt_ReturnInventorDate = Convert.ToDateTime(objDate); } objDate = DbHelperOra.GetSingle( $"select duedate from generalalert where typeid = 'tohandle_presubmit' and comments like '%返稿工程师%' and ourno = '{s_OurNo}'"); if (objDate != null) { dt_ReturnIPRDate = Convert.ToDateTime(objDate); } break; } case EnumsAll.CaseType.Foreign: { var dr = DbHelperOra.Query( $"select RECEIVED,CTITLE,TITLE from FCASE where OURNO = '{_sOurNo}'") .Tables[0].Rows[0]; if (!string.IsNullOrWhiteSpace(dr["RECEIVED"].ToString())) { dt_ReceiveDate = Convert.ToDateTime(dr["RECEIVED"].ToString()); } s_Name = dr["CTITLE"].ToString(); if (string.IsNullOrWhiteSpace(s_Name)) { s_Name = dr["TITLE"].ToString(); } var dt = DbHelperOra.Query($"select EID,ROLE,ORIG_NAME,TRAN_NAME,ENT_ORDER from FCASE_ENT_REL where OURNO = '{_sOurNo}'").Tables[0]; var tempclient = dt.Select("ROLE = 'CLI' OR ROLE = 'APPCLI'"); if (tempclient.Length > 0) { Client = Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{tempclient[0]["EID"]}'")) ?? new Corporation(Session) { Code = tempclient[0]["EID"].ToString(), Name = !string.IsNullOrWhiteSpace(tempclient[0]["ORIG_NAME"].ToString()) ? tempclient[0]["ORIG_NAME"].ToString() : tempclient[0]["TRAN_NAME"].ToString() } } ; Applicants.ToList().ForEach(a => Applicants.Remove(a)); foreach (var dataRow in dt.Select("ROLE = 'APP' OR ROLE = 'APPCLI'", "ENT_ORDER ASC")) { Applicants.Add( Session.FindObject <Corporation>(CriteriaOperator.Parse($"Code = '{dataRow["EID"]}'")) ?? new Corporation(Session) { Code = dataRow["EID"].ToString(), Name = !string.IsNullOrWhiteSpace(dataRow["ORIG_NAME"].ToString()) ? dataRow["ORIG_NAME"].ToString() : dataRow["TRAN_NAME"].ToString() }); } break; } } var sOurNoShort = s_OurNo.Substring(0, s_OurNo.IndexOf("-", StringComparison.Ordinal)); if (sOurNoShort.Contains("I")) { s_PatentType = EnumsAll.PatentType.发明; } else if (sOurNoShort.Contains("U")) { s_PatentType = EnumsAll.PatentType.实用新型; } else if (sOurNoShort.Contains("D")) { s_PatentType = EnumsAll.PatentType.外观设计; } else if (sOurNoShort.Contains("CR")) { s_PatentType = EnumsAll.PatentType.软件著作权; } Save(); } }