Пример #1
0
        public static DrugViewModel Load(MobileHis.Data.Drug drug, DrugCost cost)
        {
            var v = new DrugViewModel();

            v.GID       = drug.GID;
            v.Title     = drug.Title;
            v.DrugCode  = drug.DrugCode;
            v.OrderCode = drug.OrderCode;
            //v.Form = drug.Form;
            v.DrugType = drug.DrugType;
            v.Unit     = drug.Unit;
            //v.Price = cost == null || !cost.Price.HasValue ? 0 : Convert.ToDecimal(cost.Price);
            v.Price        = cost == null ? 0 : Convert.ToDecimal(cost.Price);
            v.IsHighRisk   = drug.IsHighRisk;
            v.IsPediatrics = drug.IsPediatrics;
            if (drug.DrugAppearance != null)
            {
                v.Shape     = drug.DrugAppearance.Shape;
                v.MajorType = drug.DrugAppearance.MajorType;
                v.Color     = drug.DrugAppearance.Color;
            }
            v.InitialFee      = cost == null ? 0 : cost.InitialFee;
            v.DailyFee        = cost == null ? 0 : cost.DailyFee;
            v.PatientFrom     = drug.PatientFromType;
            v.Formulation     = drug.Formulation;
            v.SubCategory     = drug.SubCategory;
            v.DrugStockAmount = drug.DrugStock.Sum(a => a.CurrentStock);
            return(v);
        }
 public DrugRestictionDetail()
 {
     Drugmodel = new DrugViewModel();
 }
 public DrugRestictionMasterViewModel()
 {
     Restiction = new List <DrugRestictionDetail>();
     Drugmodel  = new DrugViewModel();
 }