Example #1
0
        private void analyzeTendencyUnit(List <TendencyUnitModel> lt, string property1, string property2)
        {
            lt.Clear();
            TendencyUnitModel tum;
            TendencyAllModel  tm;
            AnalyzeTendencyUnit <TendencyAllModel> atu = new AnalyzeTendencyUnit <TendencyAllModel>();

            for (int i = 0; i < this.Tendency.Lt_Tendencys.Count; i++)
            {
                tm        = this.Tendency.Lt_Tendencys[i];
                tum       = new TendencyUnitModel();
                tum.Sno   = tm.Sno;
                tum.Num1  = atu.GetUnitValue(this.Tendency.Lt_Tendencys, i, property1, property2);
                tum.Dtime = tm.Dtime;
                lt.Add(tum);
            }
        }
Example #2
0
        private void getTendencyUnit(List <Tendency2Model> lt, List <TendencyType> lt_names)
        {
            TendencyUnitModel      tum;
            List <FieldValueModel> lt_fields;
            TendencyModel          curfm;
            TendencyModel          nextfm;
            PropertyInfo           propertyInfo;
            PropertyInfo           fieldInfo1;

            int value = -1;

            for (int i = 0; i < lt.Count; i++)
            {
                curfm     = lt[i];
                tum       = new TendencyUnitModel();
                lt_fields = new List <FieldValueModel>();
                for (int j = 0; j < lt_names.Count; j++)
                {
                    lt_fields.Add(new FieldValueModel()
                    {
                        FieldName = lt_names[j].EnName, FieldValue = Convert.ToInt16(Reflection.GetPropertyValue(type, curfm, lt_names[j].EnName))
                    });
                }

                var vs = lt_fields.OrderBy(l => l.FieldValue).ToList();

                for (int k = 0; k < lt_fields.Count; k++)
                {
                    fieldInfo1   = Reflection.GetPropertyInfo(typeof(TendencyUnitModel), "Num" + (k + 1).ToString());
                    propertyInfo = Reflection.GetPropertyInfo(type, vs[k].FieldName);
                    for (int l = i + 1; l < lt.Count; l++)
                    {
                        nextfm = lt[l];
                        value  = (int)Reflection.GetPropertyValue(type, nextfm, vs[k].FieldName);
                        if (value == 0)
                        {
                            fieldInfo1.SetValue(tum, l - i, null);
                            break;
                        }
                    }
                }
                tum.Sno   = lt[i].Sno;
                tum.Dtime = lt[i].Dtime;
                Lt_TendencyUnits.Add(tum);
            }
        }
Example #3
0
        private void find()
        {
            AnalyzeTendencyUnit atu = new AnalyzeTendencyUnit();

            atu.SetTendencyUnits(this.Tendency.Lt_Tendencys, enumNumberType, enumSelectType);
            if (atu.Lt_TendencyUnits.Count > 0)
            {
                DgvController.AddRows(this.dgv2, atu.Lt_TendencyUnits.Count);

                for (int j = atu.Lt_TendencyUnits.Count - 1, i = 0; j >= 0; j--)
                {
                    TendencyUnitModel tum = atu.Lt_TendencyUnits[j];
                    this.dgv2[0, i].Value = i + 1;
                    this.dgv2[1, i].Value = tum.Sno;
                    this.dgv2[2, i].Value = tum.Num1;
                    this.dgv2[3, i].Value = tum.Num2;
                    this.dgv2[4, i].Value = tum.Num3;
                    this.dgv2[5, i].Value = tum.Num4;
                    this.dgv2[6, i].Value = tum.Dtime;
                    i++;
                }
            }
        }