/*查询处方单在特定药房的花费*/
        public PrescriptionCost GetPrescriptionCost(string sPrescriptionID, string password) {

            PrescriptionCostEntity prescriptionCostEntity = null;

            if (sPrescriptionID == null) {
                prescriptionCostEntity = new PrescriptionCostEntity();
                prescriptionCostEntity.ErrorMessage = "211 Empty PrescriptionID! @Service";
            }
            else if (password == null) {
                prescriptionCostEntity = new PrescriptionCostEntity();
                prescriptionCostEntity.ErrorMessage = "212 Empty User Password! @Service";
            }
            else {
                prescriptionCostEntity = pharmacyLogic.GetPrescriptionCost(sPrescriptionID, password);
            }

            PrescriptionCost prescriptionCost = new PrescriptionCost();
            TranslatePrescriptionCostEntityToPrescriptionCostContractData(prescriptionCostEntity, prescriptionCost);

            return prescriptionCost;
        }
Exemplo n.º 2
0
 /*查询处方单在特定药房的花费,供User调用。*/
 public PrescriptionCost GetPrescriptionCost(string userID, string password, string sPrescriptionID, string pharmacyID) {
     UserService userService = new UserService();
     UserInfo userInfo = userService.Login(userID, password);
     if (userInfo.ErrorMessage == null) {
         return userService.GetPrescriptionCost(sPrescriptionID, pharmacyID);
     }
     else {
         PrescriptionCost prescriptionCost = new PrescriptionCost();
         prescriptionCost.ErrorMessage = userInfo.ErrorMessage;
         return prescriptionCost;
     }
 }
 /*将PrescriptionCost对应的Entity翻译为数据契约*/
 private void TranslatePrescriptionCostEntityToPrescriptionCostContractData(
     PrescriptionCostEntity  prescriptionCostEntity,
     PrescriptionCost        prescriptionCost) {
         prescriptionCost.ErrorMessage   = prescriptionCostEntity.ErrorMessage;
         prescriptionCost.Count          = prescriptionCostEntity.Count;
         prescriptionCost.LastName       = prescriptionCostEntity.LastName;
         prescriptionCost.FirstName      = prescriptionCostEntity.FirstName;
         prescriptionCost.UserBalance    = prescriptionCostEntity.UserBalance;
         prescriptionCost.Amount           = prescriptionCostEntity.Amount;
         prescriptionCost.PharmacyID     = prescriptionCostEntity.PharmacyID;
         prescriptionCost.physicID       = new string[prescriptionCost.Count];
         prescriptionCost.number         = new int[prescriptionCost.Count];
         prescriptionCost.price          = new Decimal?[prescriptionCost.Count];
         for (int i = 0; i < prescriptionCost.Count; i++) {
             prescriptionCost.physicID[i]    = prescriptionCostEntity.physicID[i];
             prescriptionCost.number[i]      = prescriptionCostEntity.number[i];
             prescriptionCost.price[i]       = prescriptionCostEntity.price[i];
         }
 }
Exemplo n.º 4
0
        /*查询处方单在特定药房的花费,供User调用。*/
        public PrescriptionCost GetPrescriptionCost(string sPrescriptionID, string pharmacyID) {
            PrescriptionCost prescriptionCost = new PrescriptionCost();
            Guid gPrescriptionID = Guid.Empty;
            try {
                gPrescriptionID = new Guid(sPrescriptionID);
            }
            catch {
                prescriptionCost.ErrorMessage = "Invalid ID! @Service";
                return prescriptionCost;
            }
            PrescriptionCostEntity prescriptionCostEntity = userLogic.GetPrescriptionCost(gPrescriptionID, pharmacyID);
            TranslatePrescriptionCostEntityToPrescriptionCostContractData(prescriptionCostEntity, prescriptionCost);

            return prescriptionCost;
        }