public static DAL.Indication FromBusinessToDataAccessMap(Indication indication) { var Indication = indication ?? throw new ArgumentNullException("indication"); var dataAccessIndication = new DAL.Indication() { Id = indication.Id, CurrentIndication = indication.CurrentIndication, LastIndication = indication.LastIndication, LoosesPercent = indication.LoosesPercent, Month = indication.Month, Year = indication.Year }; var dataAccessPayment = new DAL.Payment() { Id = indication.Payment.Id, DateOfPayment = indication.Payment.DateOfPayment, MemberId = indication.Payment.MemberId, PaidFor = indication.Payment.PaidFor, ToPay = indication.Payment.ToPay, RateId = indication.Payment.RateId }; dataAccessIndication.Payment = dataAccessPayment; return(dataAccessIndication); }
public ActionResult IndicationEdit(Indication model) { if (model.IndicationId == 0) { APBplDef.IndicationBpl.Insert(model); } else { APBplDef.IndicationBpl.UpdatePartial(model.IndicationId, new { IndicationName = model.IndicationName, LevelPKID = model.LevelPKID, TypePKID = model.TypePKID, Description = model.Description, Score = model.Score, ActiveId = model.ActiveId }); } return(Json(new { error = "none", msg = "编辑成功" })); }
public void IndicationAdd(int houseId, DateTime dateIndication, int newIndication) { var house = GetHousesById(houseId); if (house == null) { return; } var indication = new Indication { CurrentIndication = newIndication, FillingTime = dateIndication }; if (house.Counter.Indications.Any()) { indication.PreviousIndication = house.Counter.Indications.Last().CurrentIndication; } else { indication.PreviousIndication = 0; } _context.Add(indication); house.Counter.Indications.Add(indication); _context.SaveChanges(); }
// Token: 0x06000028 RID: 40 RVA: 0x00002B7C File Offset: 0x00000D7C private void PublishModificationOfAuditingEvents(AuditDatabaseDecoratedContainer auditDatabaseDecoratedContainer, int insertedId) { if (this.indicationPublisher == null) { this.indicationPublisher = IndicationPublisher.CreateV3(); } Dictionary <string, object> dictionary = new Dictionary <string, object> { { "ActionType", auditDatabaseDecoratedContainer.ActionType.ToString() }, { "AuditEventId", insertedId }, { "InstanceType", "Orion.AuditingEvents" }, { "OriginalAccountId", auditDatabaseDecoratedContainer.AccountId } }; Indication indication = new Indication { IndicationProperties = IndicationHelper.GetIndicationProperties(), IndicationType = "System.InstanceCreated", SourceInstanceProperties = new PropertyBag(dictionary) }; this.indicationPublisher.Publish(indication); }
public void SerializeDeserilize() { // setup indication const string s = "IBM"; const string e = "NYSE"; const int t = 092500; const decimal h = 128.08m; const decimal l = 126.25m; const int v = 1; Indication i = new IndicationImpl(s, e, t, v, h, l); // verify it's valid Assert.IsTrue(i.isValid); // serialize it string msg = IndicationImpl.Serialize(i); // deserialize it somewhere else Indication ni = IndicationImpl.Deserialize(msg); // make sure it's valid Assert.IsTrue(ni.isValid); // verify it's the same Assert.AreEqual(i.Symbol, ni.Symbol); Assert.AreEqual(i.Exchange, ni.Exchange); Assert.AreEqual(i.Time, ni.Time); Assert.AreEqual(i.High, ni.High); Assert.AreEqual(i.Low, ni.Low); }
public static Indication FromDataAccessToBusinessMap(DAL.Indication indication) { var Indication = indication ?? throw new ArgumentNullException("indication"); var dTOIndication = new Indication() { Id = indication.Id, CurrentIndication = indication.CurrentIndication, LastIndication = indication.LastIndication, Month = indication.Month, Year = indication.Year, LoosesPercent = indication.LoosesPercent }; var dTOPayment = new Payment() { Id = indication.Payment.Id, DateOfPayment = indication.Payment.DateOfPayment, MemberId = indication.Payment.MemberId, PaidFor = indication.Payment.PaidFor, ToPay = indication.Payment.ToPay, RateId = indication.Payment.RateId, Rate = new Rate() { Id = indication.Payment.Rate.Id, RateName = indication.Payment.Rate.RateName, RateValue = indication.Payment.Rate.RateValue, BankCollectionPercent = indication.Payment.Rate.BankCollectionPercent, Date = indication.Payment.Rate.Date, FinePercent = indication.Payment.Rate.FinePercent } }; dTOIndication.Payment = dTOPayment; return(dTOIndication); }
// GET: /Indication/ public ActionResult Index() { var topIndicationName = db.UserActivities.Where(c => c.IndicationId != null) .GroupBy(d => new { d.IndicationId, d.Indication.IndicationName }) .Select(e => new { e.Key.IndicationId, e.Key.IndicationName, Count = e.Count() }).OrderByDescending(e => e.Count).Take(10).ToList(); List <Indication> indication = new List <Indication>(); foreach (var item in topIndicationName) { Indication indications = new Indication() { IndicationName = item.IndicationName, IndicationId = item.IndicationId }; indication.Add(indications); } ViewBag.TopIndicationName = indication; return(View()); }
public void doWhileAuto() { do { try { if (label1.Text == firstHour || label1.Text == secondHour || label1.Text == thirdHour) { log("Starting to Send Email - " + DateTime.Now.ToString()); AutoEmail(); Indication.SafeInvoke(d => d.Text = "Done Sending Email"); } else if (label1.Text == resetHour) { log("Resetting - " + DateTime.Now.ToString()); Uri newUrl = new Uri(getBaseAddress().ToString() + "/resetTable"); Indication.SafeInvoke(d => d.Text = "Resetting"); string reset = sendRequest(newUrl); Indication.SafeInvoke(d => d.Text = "Done Reset"); Thread.Sleep(5000); Indication.SafeInvoke(d => d.Text = ""); } } catch (Exception ex) { Indication.SafeInvoke(d => d.Text = "Error Found"); log(ex.ToString()); } } while (state == true); }
//<text>info</text> returns (info, Indication.Text) public static (string, Indication) GetIndicationInfo(this string feed) { Indication i = feed.IndicationType(); int s = feed.IndexOf('>') + 1; int e = (feed.IndexOf('/') - 1) - s; string inf = feed.Substring(s, e); return(inf, i); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as DeviceUseStatement; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.DeviceUseStatement.DeviceUseStatementStatus>)StatusElement.DeepCopy(); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (WhenUsed != null) { dest.WhenUsed = (Hl7.Fhir.Model.Period)WhenUsed.DeepCopy(); } if (Timing != null) { dest.Timing = (Hl7.Fhir.Model.Element)Timing.DeepCopy(); } if (RecordedOnElement != null) { dest.RecordedOnElement = (Hl7.Fhir.Model.FhirDateTime)RecordedOnElement.DeepCopy(); } if (Source != null) { dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); } if (Device != null) { dest.Device = (Hl7.Fhir.Model.ResourceReference)Device.DeepCopy(); } if (Indication != null) { dest.Indication = new List <Hl7.Fhir.Model.CodeableConcept>(Indication.DeepCopy()); } if (BodySite != null) { dest.BodySite = (Hl7.Fhir.Model.CodeableConcept)BodySite.DeepCopy(); } if (Note != null) { dest.Note = new List <Hl7.Fhir.Model.Annotation>(Note.DeepCopy()); } return(dest); }
private Indication[] CopyAnswer() { Indication[] answer = new Indication [indications.Length]; for (int i = 0; i < indications.Length; i++) { answer[i] = new Indication(Translations, indications[i].type, indications[i].obj); } return(answer); }
public int AddIndication(Indication indication) { var Indication = indication ?? throw new ArgumentNullException("indication"); using (var db = new GardenCommunityContext()) { db.Indications.Add(indication); db.SaveChanges(); } return(indication.Id); }
void Awake() { if (!insrance) { insrance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
public void ShowIndication(Indication indicationType) { if (indicationType == Indication.Failure) { _indicatorImage.sprite = _failureSprite; } else { _indicatorImage.sprite = _successSprite; } _indicatorImage.fillAmount = 1; }
Badge FindBadgeWithId(EventInfo[] List, Indication indication) { foreach (var go in List) { if (go.Event_id == indication.IdOfIdicatorObject) { var badge = go.GetComponent <Badge> (); badge.thisIndication = indication; return(go.GetComponent <Badge> ()); } } return(null); }
public void Add([FromBody] IndicationsDeviceData indicationsDeviceData) { IndicationRepository indicationRepository = new IndicationRepository(); using (indicationRepository) { var newIndication = new Indication() { Temperature = indicationsDeviceData.Temperature, Humidity = indicationsDeviceData.Humidity, WorkDateTime = new DateTime() }; indicationRepository.Add(newIndication, indicationsDeviceData.MAC); } }
public Indication GetscriptEvent(int _lifetime, GameObject _object) { Indication data = Instantiate(insrance); data.lifetime = _lifetime; data.objec = _object; //Hide data.objec.SetActive(false); return(data); }
public void Validate() { Name.ValidateRequired("Name"); GenericName.ValidateOptional("GenericName"); Dose.ValidateOptional("Dose"); Strength.ValidateOptional("Strength"); Frequency.ValidateOptional("Frequency"); Route.ValidateOptional("Route"); Indication.ValidateOptional("Indication"); StartDate.ValidateOptional("StartDate"); StopDate.ValidateOptional("StopDate"); Prescribed.ValidateOptional("Prescribed"); Prescription.ValidateOptional("Prescription"); }
protected void OnIndication(IEnumerable <byte> indicationData) { ThrowIfDisposed(); ThrowIfNotConnected(); if (!LocalPeripheral.IsConnected) { return; } if (!IsIndicationsEnabled) { return; } Indication?.Invoke(this, indicationData.ToArray()); }
public Payment AddPayment(int indication, Payment payment) { PaymentUtil Util = new PaymentService(); if (indication == 0) { throw new BadRequestException("Indicação é null"); } payment.IndicationId = indication; Indication indicationCanPay = _indicationService.GetById(indication); if (Util.ObjectIsNull(indicationCanPay)) { throw new NotFoundException("Nenhum indicação encontrada"); } else if (!indicationCanPay.Status.Equals(IndicationStatus.SUCCESS)) { throw new BadRequestException("Esta indicação não tem status pra ser paga!"); } //string imageURI = null; //if (file != null) //{ // using (var stream = file.OpenReadStream()) // { // imageURI = await UploadToBlob(file.FileName, null, stream); // } //} //if (imageURI != null) //{ // payment.ImageURIOne = imageURI; //} try { _repository.Create(payment); } catch (Exception e) { throw new Exception($"Algo deu errado {e}"); } return(payment); }
public async Task SetIndicationAsync(int id, int value) { Indication indication = await _unit.RepIndication.GetAsync(f => f.Id == id); if (indication == null) { return; } if (indication.Value < value) { indication.Value = value; } _unit.RepIndication.Update(indication); }
public static Payment FromDataAccessToBusinessMap(DAL.Payment payment) { var Payment = payment ?? throw new ArgumentNullException("payment"); var dTOPayment = new Payment() { Id = payment.Id, DateOfPayment = payment.DateOfPayment, MemberId = payment.MemberId, PaidFor = payment.PaidFor, ToPay = payment.ToPay, RateId = payment.RateId }; var dTOIndication = new Indication() { Id = payment.Indication.Id, CurrentIndication = payment.Indication.CurrentIndication, LastIndication = payment.Indication.LastIndication, LoosesPercent = payment.Indication.LoosesPercent, Month = payment.Indication.Month, Year = payment.Indication.Year }; var dTORate = new Rate() { Id = payment.Rate.Id, RateName = payment.Rate.RateName, RateValue = payment.Rate.RateValue, BankCollectionPercent = payment.Rate.BankCollectionPercent, Date = payment.Rate.Date, FinePercent = payment.Rate.FinePercent }; var dTOMember = new Member() { Id = payment.Member.Id, FirstName = payment.Member.FirstName, LastName = payment.Member.LastName, MiddleName = payment.Member.MiddleName, AdditionalInfo = payment.Member.AdditionalInfo, Address = payment.Member.Address, Phone = payment.Member.Phone, IsActiveMember = payment.Member.IsActiveMember }; dTOPayment.Indication = dTOIndication; dTOPayment.Rate = dTORate; dTOPayment.Member = dTOMember; return(dTOPayment); }
public int UpdateIndication(Indication indication) { var Indication = indication ?? throw new ArgumentNullException("indication"); using (var db = new GardenCommunityContext()) { var updatableIndication = db.Indications.First(x => x.Id == indication.Id); updatableIndication.CurrentIndication = indication.CurrentIndication; updatableIndication.LastIndication = indication.LastIndication; updatableIndication.Month = indication.Month; updatableIndication.Year = indication.Year; updatableIndication.LoosesPercent = indication.LoosesPercent; updatableIndication.Payment = indication.Payment; db.SaveChanges(); return(indication.Id); } }
public static string Serialize(Indication i) { char d = ','; StringBuilder sb = new StringBuilder(); sb.Append(i.Symbol); sb.Append(d); sb.Append(i.Exchange); sb.Append(d); sb.Append(i.Time); sb.Append(d); sb.Append(i.isValid); sb.Append(d); sb.Append(i.High); sb.Append(d); sb.Append(i.Low); return sb.ToString(); }
// // 评审指标编辑 // GET: /EvalManage/IndicationEdit // POST: /EvalManage/IndicationEdit public ActionResult IndicationEdit(long?id) { Indication model = null; if (id == null) { model = new Indication(); } else { model = APBplDef.IndicationBpl.PrimaryGet(id.Value); } ViewBag.Actives = ResSettings.SettingsInSession.Actives; return(PartialView(model)); }
public Indication GetById(int id) { IndicationUtil Util = new IndicationService(); if (id == 0) { throw new BadRequestException("ID deve ser diferente de 0"); } Indication indication = _repository.GetById(id); if (Util.ObjectIsNull(indication)) { throw new NotFoundException("Nenhuma indicação encontrada!"); } return(indication); }
public static string Serialize(Indication i) { char d = ','; StringBuilder sb = new StringBuilder(); sb.Append(i.Symbol); sb.Append(d); sb.Append(i.Exchange); sb.Append(d); sb.Append(i.Time); sb.Append(d); sb.Append(i.isValid); sb.Append(d); sb.Append(i.High); sb.Append(d); sb.Append(i.Low); return(sb.ToString()); }
private void Form1_Load(object sender, EventArgs e) { eventManager = new UiEventManager(dataGridView1, this); indication = new Indication(this); InitializeAppProperties(); try { client = new ClientLauncher(eventManager, this); client.Launch(); eventManager.client = client; StatusesForOwner.Init(client.GetServerInstance()); eventManager.GetEventList(); eventManager.HideClosedEventsAccordingToConfigValue(); } catch (UserIsNullException) //user has not logged in { ExitApp(); } }
IEnumerator IsPartyGoingOn(Indication Indication) { var cd = new CoroutineWithData(SocietyPartyManager.Instance, SocietyPartyManager.Instance.IGetSocietyPartyForCheck(Indication.IdOfIdicatorObject)); yield return(cd.coroutine); bool boolean = false; if (cd.result != null) { if ((bool)cd.result) { ShowBadges(Indication, 1); } else { DeleteIndication(Indication.IdOfIdicatorObject, Indication.Name); } } }
public Indication ChangeIndicationStatus(int indicationId, IndicationStatus newStatus) { if (indicationId == 0) { throw new BadRequestException("Algo deu errado, atualize a página ou entre em contato com suporte!"); } Indication indication = new Indication(); try { indication = _repository.GetById(indicationId); } catch (Exception e) { throw new Exception($"Algo deu errado: {e}"); } if (indication == null) { throw new NotFoundException("Nenhuma indicação encontrada!"); } if (indication.Status.Equals(newStatus)) { throw new BadRequestException("Esta indicação já está nessa etapa!"); } indication.Status = newStatus; try { _repository.Update(indication); return(indication); } catch (Exception e) { throw new Exception($"Algo deu errado: {e}"); } }
public string EditIndication(DtoIndication dtoIndication) { var uniqueIndication = IndicationMethods.Instance.GetIndicationByCode(dtoIndication.Code); if (!dtoIndication.IsEdit) { var indication = new Indication() { Code = dtoIndication.Code, Name = dtoIndication.Name }; return(IndicationMethods.Instance.InsertIndication(indication)); } else { var indication = new Indication() { Id = uniqueIndication.Id, Code = dtoIndication.Code, Name = dtoIndication.Name }; return(IndicationMethods.Instance.UpdateIndication(indication)); } }
private Indication[] CopyAnswer() { Indication[] answer = new Indication [indications.Length]; for (int i = 0; i < indications.Length; i++) answer[i] = new Indication (Translations, indications[i].type, indications[i].obj); return answer; }
private static void DrawPossibleAnswers(CairoContextEx gr, double x, double y, Indication[] indications) { for (int i = 0; i < indications.Length - 1; i++) indications[i].Draw (gr, ref x, ref y, indications[i + 1]); indications[indications.Length - 1].Draw (gr, ref x, ref y, indications[indications.Length - 2]); }
public void Draw(CairoContextEx gr, ref double x, ref double y, Indication next_prev) { const double line_length = 0.045; const double points = 0.045; if (type == Indication.Type.Start) { gr.Rectangle (x, y, points, points); gr.DrawTextCentered (x + points /2 , y + points /2, ((int)obj).ToString ()); gr.Stroke (); switch ((TurnDirection) next_prev.obj) { case TurnDirection.Right: x += points; y += points / 2; break; case TurnDirection.Left: y += points / 2; break; case TurnDirection.Down: y += points; x += points / 2; break; case TurnDirection.Up: x += points / 2; break; } } else if (type == Indication.Type.Turn) { gr.MoveTo (x, y); switch ((TurnDirection) obj) { case TurnDirection.Right: x += line_length; break; case TurnDirection.Left: x -= line_length; break; case TurnDirection.Up: y -= line_length; break; case TurnDirection.Down: y += line_length; break; } gr.LineTo (x, y); gr.Stroke (); } else if (type == Indication.Type.End) { switch ((TurnDirection) next_prev.obj) { case TurnDirection.Right: y -= points / 2; break; case TurnDirection.Left: x -= points; y -= points / 2; break; case TurnDirection.Down: x -= points / 2; break; case TurnDirection.Up: x -= points / 2; y -= points; break; } gr.Rectangle (x, y, points, points); gr.Stroke (); gr.DrawTextCentered (x + points /2 , y + points /2, ((int)obj).ToString ()); } }
protected override void Initialize() { indications = new Indication [CurrentDifficulty == GameDifficulty.Easy ? 5 : 7]; Indication.TurnDirection second_turn = (Indication.TurnDirection) 2 + random.Next (2); indications[0] = new Indication (Translations, Indication.Type.Start, 0); indications[1] = new Indication (Translations, Indication.Type.Turn, random.Next (2)); // right or left indications[2] = new Indication (Translations, Indication.Type.Turn, second_turn); // up or down indications[3] = new Indication (Translations, Indication.Type.Turn, random.Next (2)); // right or left Answer.CheckAttributes |= GameAnswerCheckAttributes.MultiOption | GameAnswerCheckAttributes.IgnoreSpaces; if (CurrentDifficulty==GameDifficulty.Easy) { indications[4] = new Indication (Translations, Indication.Type.End, 1); } else { if (second_turn == Indication.TurnDirection.Up) indications[4] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Up); else indications[4] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Down); indications[5] = new Indication (Translations, Indication.Type.Turn, random.Next (2)); // right or left indications[6] = new Indication (Translations, Indication.Type.End, 1); } indications_wrongA = CopyAnswer (); indications_wrongB = CopyAnswer (); indications_wrongC = CopyAnswer (); if ((Indication.TurnDirection) indications[3].obj == Indication.TurnDirection.Right) { indications_wrongA[3] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Left); } else { indications_wrongA[3] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Right); } if (CurrentDifficulty == GameDifficulty.Easy) { if ((Indication.TurnDirection) indications[2].obj == Indication.TurnDirection.Up) { indications_wrongB[2] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Down); } else { indications_wrongB[2] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Up); } } else { if ((Indication.TurnDirection) indications[5].obj == Indication.TurnDirection.Right) { indications_wrongB[5] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Left); } else { indications_wrongB[5] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Right); } } if ((Indication.TurnDirection) indications[1].obj == Indication.TurnDirection.Right) { indications_wrongC[1] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Left); } else { indications_wrongC[1] = new Indication (Translations, Indication.Type.Turn, Indication.TurnDirection.Right); } base.Initialize (); answers = new ArrayListIndicesRandom (4); answers.Initialize (); for (int i = 0; i < answers.Count; i++) { if (answers [i] == 0) { Answer.SetMultiOptionAnswer (i, Answer.GetFigureName (i)); ans = i; break; } } // Draw row 1 HorizontalContainer container = new HorizontalContainer (0.05, 0.1, 0.9, 0.4); AddWidget (container); for (int i = 0; i < 2; i++) { DrawableArea drawable_area = new DrawableArea (0.45, 0.4); container.AddChild (drawable_area); drawable_area.SelectedArea = new Rectangle (0, 0, 0.45, 0.3); drawable_area.Data = i; drawable_area.DataEx = Answer.GetMultiOption (i); drawable_area.DrawEventHandler += delegate (object sender, DrawEventArgs e) { int n = (int) e.Data; DrawPossibleAnswers (e.Context, 0.2, 0.1, WhichAnswer (answers[n])); e.Context.MoveTo (0.2, 0.12 + 0.2); e.Context.ShowPangoText (Answer.GetFigureName (n)); }; } // Draw row 2 container = new HorizontalContainer (0.05, 0.5, 0.9, 0.4); AddWidget (container); for (int i = 2; i < 4; i++) { DrawableArea drawable_area = new DrawableArea (0.45, 0.4); container.AddChild (drawable_area); drawable_area.SelectedArea = new Rectangle (0, 0, 0.45, 0.3); drawable_area.Data = i; drawable_area.DataEx = Answer.GetMultiOption (i); drawable_area.DrawEventHandler += delegate (object sender, DrawEventArgs e) { int n = (int) e.Data; DrawPossibleAnswers (e.Context, 0.2, 0.1, WhichAnswer (answers[n])); e.Context.MoveTo (0.2, 0.12 + 0.2); e.Context.ShowPangoText (Answer.GetFigureName (n)); }; } }