Beispiel #1
0
 public Prescription(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
Beispiel #2
0
 public Statistics(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
 public PrescriptionController(DbContext.CHISEntitiesSqlServer db,
                               Services.PrescriptionService presSvr
                               ) : base(db)
 {
     _presSvr = presSvr;
 }
Beispiel #4
0
 public UtilsController(DbContext.CHISEntitiesSqlServer db
                        , Services.JKWebNetService jkSvr
                        ) : base(db)
 {
     _jkSvr = jkSvr;
 }
Beispiel #5
0
 public MyPanelController(DbContext.CHISEntitiesSqlServer db
                          , Services.DoctorService docSvr) : base(db)
 {
     _docSvr = docSvr;
 }
Beispiel #6
0
 public VCode(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
Beispiel #7
0
 public BaseCBL(DbContext.CHISEntitiesSqlServer dbcontext, Models.UserSelf currentOper = null)
 {
     this._db         = dbcontext;
     this.CurrentOper = currentOper;
 }
 public SysController(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
Beispiel #9
0
 public P3Tools(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
Beispiel #10
0
 public BaseCBL(BaseController c)
 {
     this.controller = c;
     this._db        = c._db;
 }
Beispiel #11
0
 public DispensingController(DbContext.CHISEntitiesSqlServer db
                             , Services.DispensingService dispSvr
                             ) : base(db)
 {
     _dispSvr = dispSvr;
 }
Beispiel #12
0
 public MedicalLib(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
Beispiel #13
0
 public MyClinic(DrugService drugSrv, DbContext.CHISEntitiesSqlServer db) : base(db)
 {
     _drugSrv = drugSrv;
 }
Beispiel #14
0
 public BaseController(DbContext.CHISEntitiesSqlServer db)
 {
     _db = db;
 }
Beispiel #15
0
 public DrugSuppleController(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
Beispiel #16
0
 public FunctionController(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
Beispiel #17
0
 public syshis(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
Beispiel #18
0
 public MyStationSettings(DbContext.CHISEntitiesSqlServer db) : base(db)
 {
 }
Beispiel #19
0
        public async Task <bool> UpdateCustomerTrans(CHIS.Models.CHIS_Code_Customer customer, Models.CHIS_Code_Customer_HealthInfo health, DbContext.CHISEntitiesSqlServer db = null)
        {
            db = db ?? _db;
            db.BeginTransaction();
            try
            {
                var aCust = db.CHIS_Code_Customer.AsNoTracking().First(m => m.CustomerID == customer.CustomerID);
                //添加患者需要更新的属性
                aCust.Address           = customer.Address;
                aCust.AddressAreaId     = customer.AddressAreaId;
                aCust.Birthday          = customer.Birthday;
                aCust.CertificateNo     = customer.CertificateNo;
                aCust.CertificateTypeId = customer.CertificateTypeId;
                aCust.ContactMan        = customer.ContactMan;
                aCust.ContactPhone      = customer.ContactPhone;
                aCust.CustomerName      = customer.CustomerName;
                aCust.EduLevel          = customer.EduLevel;
                aCust.Email             = customer.Email;
                aCust.CustomerPic       = customer.CustomerPic;
                aCust.NamePY            = Ass.Data.Chinese2Spell.GetFstAndFullLettersLower(customer.CustomerName); //搜索码

                //aCust.Explain = customer.Explain;
                //aCust.FeeType = customer.FeeType;
                aCust.IDcard      = customer.IDcard;
                aCust.InsuranceNo = customer.InsuranceNo;

                //aCust.LeftAmount = customer.LeftAmount;

                aCust.Marriage = customer.Marriage;
                //aCust.Nation = customer.Nation;

                aCust.Presfession = customer.Presfession;
                //aCust.PriceType = customer.PriceType;
                //aCust.Relation = customer.Relation;
                aCust.Remark = customer.Remark;
                //aCust.SaveAmount = customer.SaveAmount;
                aCust.Gender = customer.Gender;
                //aCust.Special = customer.Special;
                //aCust.Status = customer.Status;

                aCust.LoginName      = customer.LoginName;
                aCust.Telephone      = customer.Telephone;
                aCust.CustomerMobile = customer.CustomerMobile;
                // aCust.UserPWD = customer.UserPWD;
                aCust.IsVIP   = customer.IsVIP == true;
                aCust.VIPcode = customer.VIPcode;
                //aCust.VisitCard = customer.VisitCard;
                //aCust.WorkCode = customer.WorkCode;
                aCust.ContactMan   = customer.ContactMan;
                aCust.ContactPhone = customer.ContactPhone;
                aCust.WorkUnit     = customer.WorkUnit;
                aCust.WXCode       = customer.WXCode;
                //aCust.ZipCode = customer.ZipCode;
                //附加信息
                // aCust.sysSource = "WEB";
                // aCust.StationID = user.StationId;
                aCust.OpID  = controller.UserSelf.OpId;
                aCust.OpMan = controller.UserSelf.OpMan;
                aCust.sysLatestActiveTime = aCust.OpTime = DateTime.Now;


                var hm = db.CHIS_Code_Customer_HealthInfo.AsNoTracking().First(m => m.CustomerId == customer.CustomerID);
                //添加患者健康基本属性
                hm.Allergic                 = health.Allergic;                 //过敏史
                hm.BirthChildrenNum         = health.BirthChildrenNum;         //生孩子数量
                hm.BloodType                = health.BloodType;                //血型
                hm.Height                   = health.Height;                   //身高
                hm.MenstruationEndOldYear   = health.MenstruationEndOldYear;   //月经初潮时期
                hm.MenstruationStartOldYear = health.MenstruationStartOldYear; //绝经日期
                hm.PastMedicalHistory       = health.PastMedicalHistory;       //既往史
                hm.PregnancyNum             = health.PregnancyNum;             //怀孕次数
                hm.Weight                   = health.Weight;                   //体重

                db.CHIS_Code_Customer.Update(aCust);
                db.CHIS_Code_Customer_HealthInfo.Update(hm);
                await db.SaveChangesAsync();


                //如果 关键登陆信息改了,则登陆信息也改变
                //手机和邮箱 //身份证不进行调整
                var login = db.CHIS_Sys_Login.AsNoTracking().FirstOrDefault(m => m.CustomerId == customer.CustomerID);
                if (login == null)
                {
                    await db.CHIS_Sys_Login.AddAsync(new Models.CHIS_Sys_Login
                    {
                        CustomerId    = customer.CustomerID,
                        Mobile        = customer.CustomerMobile,
                        IdCardNumber  = customer.IDcard,
                        Email         = customer.Email,
                        IsLock        = false,
                        LoginPassword = "******"
                    });
                }
                else
                {
                    if (login.Mobile != customer.CustomerMobile && customer.CustomerMobile.GetStringType().IsMobile)
                    {
                        login.Mobile = customer.CustomerMobile;
                    }
                    if (login.Email != customer.Email && customer.Email.GetStringType().IsEmail)
                    {
                        login.Email = customer.Email;
                    }
                    if (login.IdCardNumber.IsEmpty() && customer.IDcard.GetStringType().IsIdCardNumber)
                    {
                        login.IdCardNumber = customer.IDcard;
                    }
                    db.CHIS_Sys_Login.Update(login);
                }
                await db.SaveChangesAsync();

                db.CommitTran();

                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTran();
                if (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }
                throw ex;
            }
        }