Exemplo n.º 1
0
 public static void PopulateMedicine(Medicine input, System.Data.IDataReader reader)
 {
     PopulateRecord(input, reader);
     input.RecordId = input.MedicineId = Utilities.ToInt(reader[Medical.Apartment.Common.Medicine.ColumnNames.MedicineId]);
     input.OrganisationId = Utilities.ToInt(reader[Medical.Apartment.Common.Medicine.ColumnNames.OrganisationId]);
     input.Name = Utilities.ToString(reader[Medical.Apartment.Common.Medicine.ColumnNames.Name]);
     input.Description = Utilities.ToString(reader[Medical.Apartment.Common.Medicine.ColumnNames.Description]);
     input.IsLegacy = Utilities.ToBool(reader[Medical.Apartment.Common.Medicine.ColumnNames.IsLegacy]);
     input.Price = Utilities.ToNDecimal(reader[Medical.Apartment.Common.Medicine.ColumnNames.Price]);
     input.InputPrice = Utilities.ToNDecimal(reader[Medical.Apartment.Common.Medicine.ColumnNames.InputPrice]);
     input.Unit = Utilities.ToString(reader[Medical.Apartment.Common.Medicine.ColumnNames.Unit]);
     if (reader.ColumnExists(Medical.Apartment.Common.Medicine.ColumnNames.Quantity))
     {
         input.Quantity = Utilities.ToNDecimal(reader[Medical.Apartment.Common.Medicine.ColumnNames.Quantity]);
         input.SoldQuantity = Utilities.ToNDecimal(reader[Medical.Apartment.Common.Medicine.ColumnNames.SoldQuantity]);
         input.BeginPeriodQuantity = Utilities.ToNDecimal(reader[Medical.Apartment.Common.Medicine.ColumnNames.BeginPeriodQuantity]);
     }
 }
        void gvwMedicines_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            Medicine newItem = new Medicine();
            newItem.RecordId = null;
            newItem.CreatedBy = Globals.UserLogin.UserName;
            newItem.OrganisationId = Globals.UserLogin.UserOrganisationId;
            newItem.IsChanged = true;
            e.NewObject = newItem;

        }
Exemplo n.º 3
0
        public static Medicine Medicine(System.Data.IDataReader reader)
        {
            Medicine result = null;

            if (null != reader && reader.Read())
            {
                result = new Medicine();
                PopulateMedicine(result, reader);
            }

            return result;
        }