public KnownMeasurementsAggregator()
 {
     segments = new List<KeyValuePair<Segment, double>>();
     angles = new List<KeyValuePair<Angle, double>>();
     arcs = new List<KeyValuePair<Arc, double>>();
     units = UNITS.CM;
 }
 public KnownMeasurementsAggregator()
 {
     segments = new List <KeyValuePair <Segment, double> >();
     angles   = new List <KeyValuePair <Angle, double> >();
     arcs     = new List <KeyValuePair <Arc, double> >();
     units    = UNITS.CM;
 }
예제 #3
0
 public Medication(int id, String name, String brand, DateTime start, DateTime end, double quantity, String reasonToStop,
                   FREQUENCY frequency, UNITS units)
 {
     this.id               = id;
     this.drugName         = name;
     this.drugManufacturer = brand;
     this.startDate        = start;
     this.endDate          = end;
     this.dose             = quantity;
     this.reasonToStop     = reasonToStop;
     this.frequency        = frequency;
     this.units            = units;
 }
예제 #4
0
        // dung file get data
        // dung file get list( data source)
        public List <UNITS> getDataSource()
        {
            SqlConnection conn = MSSQLDBUtils.GetDBConnection();

            conn.Open();
            List <UNITS> list = new List <UNITS>();
            UNITS        obj  = null;
            String       sql  = "Use [rbi] " +
                                "SELECT [UnitID]" +
                                ",[UnitName]" +
                                ",[SelectedUnit]" +
                                "  FROM [rbi].[dbo].[UNITS]" +
                                " ";

            try
            {
                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = conn;
                cmd.CommandText = sql;
                using (DbDataReader reader = cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        if (reader.HasRows)
                        {
                            obj              = new UNITS();
                            obj.UnitID       = reader.GetInt32(0);
                            obj.UnitName     = reader.GetString(1);
                            obj.SelectedUnit = reader.GetString(2);
                            list.Add(obj);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString(), "GET DATA FAIL!");
            }
            finally
            {
                conn.Close();
                conn.Dispose();
            }
            return(list);
        }
예제 #5
0
        public string GetSetupParameterQuery(string key, object val, QUERY_TYPE type)
        {
            int    err     = -1;
            string strRes  = string.Empty;
            UNITS  id_unit = UNITS.UNKNOWN;

            id_unit = val.GetType().Equals(typeof(bool)) == true ? UNITS.BOOL
                : val.GetType().Equals(typeof(string)) == true ? UNITS.STRING
                    : val.GetType().Equals(typeof(int)) == true ? UNITS.INTEGER
                        : new List <Type> ()
            {
                typeof(double), typeof(float), typeof(decimal)
            }.Contains(val.GetType()) == true ? UNITS.FLOAT
                            : UNITS.UNKNOWN;

            if (type == QUERY_TYPE.UPDATE)
            {
                //query = @"UPDATE [dbo].[setup] SET [VALUE] = '" + val + @"' WHERE [KEY]='" + key + @"'";
                strRes = string.Format(@"UPDATE setup SET [VALUE]='{0}', [LAST_UPDATE]=GETDATE() WHERE [KEY]='{1}'", val, key);
            }
            else if (type == QUERY_TYPE.INSERT)
            {
                if (!(id_unit == UNITS.UNKNOWN))
                {
                    strRes = string.Format(@"INSERT INTO [setup] ([ID], [VALUE],[KEY],[LAST_UPDATE],[ID_UNIT]) VALUES (({0}),'{1}','{2}',GETDATE(),{3})"
                                           , "SELECT MAX([ID]) + 1 FROM [setup]"
                                           , val
                                           , key
                                           , (int)id_unit
                                           );
                }
                else
                {
                    ASUTP.Logging.Logg().Error($"FormParametersDB.getWriteStringRequest(KEY={key}, VALUE={val.ToString ()}) - не удалось определить тип значения ..."
                                               , ASUTP.Logging.INDEX_MESSAGE.NOT_SET);
                }
            }
            else
            {
                ;
            }

            return(strRes);
        }
예제 #6
0
        public bool Update(UNITSVM entity)
        {
            UNITS ig = new UNITS
            {
                UNIT_AR_NAME = entity.UNIT_AR_NAME,
                UNIT_CODE    = entity.UNIT_CODE,
                UNIT_EN_NAME = entity.UNIT_EN_NAME,
                UNIT_ID      = entity.UNIT_ID,
                UNIT_REMARKS = entity.UNIT_REMARKS,
                AddedBy      = entity.AddedBy,
                AddedOn      = entity.AddedOn,
                Disable      = entity.Disable,
                UpdatedBy    = entity.UpdatedBy,
                UpdatedOn    = entity.UpdatedOn
            };

            unitsRepo.Update(ig, ig.UNIT_ID);
            return(true);
        }
예제 #7
0
 public Task <bool> UpdateAsync(UNITSVM entity)
 {
     return(Task.Run <bool>(() =>
     {
         UNITS ig = new UNITS
         {
             UNIT_AR_NAME = entity.UNIT_AR_NAME,
             UNIT_CODE = entity.UNIT_CODE,
             UNIT_EN_NAME = entity.UNIT_EN_NAME,
             UNIT_ID = entity.UNIT_ID,
             UNIT_REMARKS = entity.UNIT_REMARKS,
             AddedBy = entity.AddedBy,
             AddedOn = entity.AddedOn,
             Disable = entity.Disable,
             UpdatedBy = entity.UpdatedBy,
             UpdatedOn = entity.UpdatedOn
         };
         unitsRepo.Update(ig, ig.UNIT_ID);
         return true;
     }));
 }
예제 #8
0
 public Task <int> InsertAsync(UNITSVM entity)
 {
     return(Task.Run <int>(() =>
     {
         UNITS ig = new UNITS
         {
             UNIT_AR_NAME = entity.UNIT_AR_NAME,
             UNIT_CODE = entity.UNIT_CODE,
             UNIT_EN_NAME = entity.UNIT_EN_NAME,
             UNIT_ID = entity.UNIT_ID,
             UNIT_REMARKS = entity.UNIT_REMARKS,
             AddedBy = entity.AddedBy,
             AddedOn = entity.AddedOn,
             Disable = entity.Disable,
             UpdatedBy = entity.UpdatedBy,
             UpdatedOn = entity.UpdatedOn
         };
         unitsRepo.Add(ig);
         return ig.UNIT_ID;
     }));
 }
 public void SetMeasurementType(UNITS u)
 {
     units = u;
 }
예제 #10
0
 public void delete(UNITS obj)
 {
     DAL.delete(obj.UnitID);
 }
예제 #11
0
 public void edit(UNITS obj)
 {
     DAL.edit(obj.UnitID, obj.UnitName, obj.SelectedUnit);
 }
예제 #12
0
 public void add(UNITS obj)
 {
     DAL.add(obj.UnitID, obj.UnitName, obj.SelectedUnit);
 }
 public void SetMeasurementType(UNITS u)
 {
     units = u;
 }