public override bool Collect(AbstractDataCollector <TEntity> collector)
        {
            if (collector == null)
            {
                return(false);
            }

            ActiveCollector = collector;

            ID = ((IDiagnosisCategory_Viewer)ActiveCollector.ActiveViewer).ID;

            if (ActiveDBItem == null)
            {
                return(false);
            }

            if (Name_P != null)
            {
                ((DiagnosisCategory_cu)ActiveDBItem).Name_P = Name_P.ToString();
            }

            if (Name_S != null)
            {
                ((DiagnosisCategory_cu)ActiveDBItem).Name_S = Name_S.ToString();
            }

            if (Abbreviation != null)
            {
                ((DiagnosisCategory_cu)ActiveDBItem).Abbreviation = Abbreviation.ToString();
            }

            if (IsDoctorRelated != null && Convert.ToBoolean(IsDoctorRelated))
            {
                if (DoctorID == null)
                {
                    MessageToView = "You should choose the Doctor";
                    return(false);
                }

                ((DiagnosisCategory_cu)ActiveDBItem).IsDoctorRelated = true;
            }

            if (UserID != null)
            {
                ((DiagnosisCategory_cu)ActiveDBItem).InsertedBy = Convert.ToInt32(UserID);
            }

            ((DiagnosisCategory_cu)ActiveDBItem).IsOnDuty = true;
            switch (((IDiagnosisCategory_Viewer)ActiveCollector.ActiveViewer).CommonTransactionType)
            {
            case DB_CommonTransactionType.DeleteExisting:
                ((DiagnosisCategory_cu)ActiveDBItem).IsOnDuty = false;
                break;
            }

            RelatedViewers = ((IDiagnosisCategory_Viewer)ActiveCollector.ActiveViewer).RelatedViewers;

            return(true);
        }
Exemple #2
0
        public override bool Equals(object obj)
        {
            var otherValue = obj as Enumeration;

            if (otherValue == null)
            {
                return(false);
            }

            var typeMatches  = GetType().Equals(obj.GetType());
            var valueMatches = Abbreviation.ToLower().Equals(otherValue.Abbreviation.ToLower());

            Console.WriteLine(Abbreviation.ToString());
            Console.WriteLine(otherValue.ToString());

            return((typeMatches && valueMatches) || Abbreviation.ToString().Equals(otherValue.Abbreviation.ToString()));
        }
Exemple #3
0
        public static List <Rate> GetRatesForPeriod(Abbreviation abb, DateTime from, DateTime to)
        {
            List <Rate> result = new List <Rate>();

            Client.Execute(client =>
            {
                var t = GetCurrenciesData().First(item => item.Abbreviation == abb.ToString()).ID;

                var dt = client.ExRatesDyn(t, from, to).Tables[0];
                foreach (DataRow row in dt.Rows)
                {
                    result.Add(new Rate()
                    {
                        OfficialRate = double.Parse(row["Cur_OfficialRate"].ToString()),
                        Date         = DateTime.Parse(row["Date"].ToString()),
                        Abbreviation = abb
                    });
                }
            });

            return(result);
        }
Exemple #4
0
        public static List<Rate> GetRatesForPeriod(Abbreviation abb, DateTime from, DateTime to)
        {
            List<Rate> result = new List<Rate>();

            Client.Execute(client =>
                {
                    var t = GetCurrenciesData().First(item => item.Abbreviation == abb.ToString()).ID;

                    var dt = client.ExRatesDyn(t, from, to).Tables[0];
                    foreach (DataRow row in dt.Rows)
                    {
                        result.Add(new Rate()
                        {
                            OfficialRate = double.Parse(row["Cur_OfficialRate"].ToString()),
                            Date = DateTime.Parse(row["Date"].ToString()),
                            Abbreviation = abb
                        });
                    }
                });

            return result;
        }
Exemple #5
0
 public LineOfBusiness(Abbreviation abbreviation)
 {
     _abbreviation = abbreviation.ToString();
     _name = EvaluateAbbreviation(abbreviation.ToString());
 }
Exemple #6
0
 public override string ToString()
 {
     return(Abbreviation.ToString());
 }