コード例 #1
0
        private void neuSpread1_CellClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            if (e.Button != MouseButtons.Right)
            {
                return;
            }
            if (this.neuSpread1.ActiveSheet != spPatient)
            {
                return;
            }

            if (this.spPatient.ActiveRow.Tag == null)
            {
                this.menuItem2.Enabled = false;
            }
            else
            {
                AccountCard tempAccountCard = this.spPatient.ActiveRow.Tag as AccountCard;
                //1为条码卡
                if (tempAccountCard != null && tempAccountCard.MarkType.ID == "1")
                {
                    this.menuItem2.Enabled = true;
                }
                else
                {
                    this.menuItem2.Enabled = false;
                }
            }
            this.menu.Show(neuSpread1 as Control, new Point(e.X, e.Y));
        }
コード例 #2
0
        /// <summary>
        /// 显示信息
        /// </summary>
        /// <param name="accountCard"></param>
        /// <returns></returns>
        private int SetInfo(AccountCard accountCard, Account account)
        {
            SetPatientInfo(accountCard);
            Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在加载数据请等待.....");
            Application.DoEvents();

            #region 预交金信息
            List <Neusoft.HISFC.Models.Account.PrePay> list = accountManager.GetPrepayByAccountNO(account.ID, "ALL");
            if (list == null)
            {
                MessageBox.Show("查询患者预交金信息失败!" + accountManager.Err);
                this.Clear();
                return(-1);
            }
            decimal prePayCost = 0m;
            SetAccountRecordToFp(list, fpFee_PrePay, ref prePayCost);
            this.txtPrePay.Text  = prePayCost.ToString();
            this.txtVacancy.Text = account.Vacancy.ToString();
            this.txtCost.Text    = (prePayCost - account.Vacancy).ToString();
            #endregion

            #region 显示费用信息
            alFee = this.outpatientManager.GetAccountNoPrintFeeItemList(accountCard.Patient.PID.CardNO, Neusoft.HISFC.Models.Base.PayTypes.Balanced, true);
            if (alFee == null)
            {
                Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                MessageBox.Show("查询患者费用明细失败!" + outpatientManager.Err);
                return(-1);
            }

            this.SetFeeFp();
            Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
            #endregion
            return(1);
        }
コード例 #3
0
        /// <summary>
        /// 打印条码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuItem2_Click(object sender, EventArgs e)
        {
            if (this.neuSpread1.ActiveSheet != this.spPatient)
            {
                return;
            }
            if (this.spPatient.ActiveRow.Tag == null)
            {
                return;
            }
            //{63F68506-F49D-4ed5-92BD-28A52AF54626}
            AccountCard tempaccontCard = this.spPatient.ActiveRow.Tag as AccountCard;

            if (tempaccontCard == null)
            {
                return;
            }
            PictureBox picBox = new PictureBox();

            picBox.Size      = new Size(400, 30);
            picBox.Visible   = true;
            picBox.BackColor = System.Drawing.Color.White;
            picBox.SizeMode  = PictureBoxSizeMode.AutoSize;
            Panel panel = new Panel();

            panel.Controls.Add(picBox);
            panel.Visible = true;
            Class.Code39 code39 = new Neusoft.HISFC.Components.Account.Class.Code39();
            code39.ShowCodeString = true;
            Bitmap bitmap = code39.GenerateBarcode(tempaccontCard.MarkNO);

            picBox.Image = bitmap as Image;
            Neusoft.FrameWork.WinForms.Classes.Print print = new Neusoft.FrameWork.WinForms.Classes.Print();
            print.PrintPage(0, 0, panel);
        }
コード例 #4
0
 /// <summary>
 /// 建立新的病理卡号
 /// </summary>
 private int BulidCard(AccountCard tempAccountCard)
 {
     try
     {
         if (accountManager.InsertAccountCard(tempAccountCard) == -1)
         {
             MessageBox.Show("保存卡记录失败!" + accountManager.Err, "错误");
             return(-1);
         }
         accountCardRecord = new Neusoft.HISFC.Models.Account.AccountCardRecord();
         //插入卡的操作记录
         accountCardRecord.MarkNO          = tempAccountCard.MarkNO;
         accountCardRecord.MarkType.ID     = tempAccountCard.MarkType.ID;
         accountCardRecord.CardNO          = tempAccountCard.Patient.PID.CardNO;
         accountCardRecord.OperateTypes.ID = (int)Neusoft.HISFC.Models.Account.MarkOperateTypes.Begin;
         accountCardRecord.Oper.ID         = (this.accountManager.Operator as Neusoft.HISFC.Models.Base.Employee).ID;
         //是否收取卡成本费
         bool bl = controlParamIntegrate.GetControlParam <bool>(Neusoft.HISFC.BizProcess.Integrate.AccountConstant.IsAcceptCardFee, true, false);
         if (bl)
         {
             accountCardRecord.CardMoney = controlParamIntegrate.GetControlParam <decimal>(Neusoft.HISFC.BizProcess.Integrate.AccountConstant.AcceptCardFee, true, 0);
         }
         if (accountManager.InsertAccountCardRecord(accountCardRecord) == -1)
         {
             MessageBox.Show("保存卡操作记录失败!" + accountManager.Err);
             return(-1);
         }
         return(1);
     }
     catch (Exception ex)
     {
         MessageBox.Show("保存失败!" + ex.Message);
         return(-1);
     }
 }
コード例 #5
0
        /// <summary>
        /// 验证数据
        /// </summary>
        /// <returns>true:成功 false失败</returns>
        private bool Valid()
        {
            if (this.txtMarkNo.Text.Trim() == string.Empty)
            {
                MessageBox.Show("请输入卡号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtMarkNo.Focus();
                return(false);
            }
            if (this.cmbMarkType.Tag == null || this.cmbMarkType.Tag.ToString() == string.Empty)
            {
                MessageBox.Show("请输入卡号后回车确认!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtMarkNo.Focus();
                this.txtMarkNo.SelectAll();
                return(false);
            }

            if (!Neusoft.FrameWork.Public.String.ValidMaxLengh(txtMarkNo.Text.Trim(), 20))
            {
                MessageBox.Show("就诊卡号过长,请重新输入就诊卡号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.txtMarkNo.Focus();
                this.txtMarkNo.SelectAll();
                return(false);
            }

            AccountCard card = this.accountManager.GetAccountCard(txtMarkNo.Text.Trim(), this.cmbMarkType.Tag.ToString());

            if (card != null)
            {
                MessageBox.Show("该卡已被其他患者使用,请换卡!", "错误");
                this.txtMarkNo.Focus();
                this.txtMarkNo.SelectAll();
                return(false);
            }
            return(true);
        }
コード例 #6
0
        public async Task <int> PullCard(IExternalAccount card)
        {
            var accountCard = await _accountCards.Queryable()
                              .Include(x => x.StripeCard).Where(x => x.Id == card.Id).FirstOrDefaultAsync();

            if (accountCard == null)
            {
                accountCard = new AccountCard()
                {
                    Id          = card.Id,
                    ObjectState = ObjectState.Added,
                    StripeCard  = new StripeCard()
                    {
                        Id          = card.Id,
                        ObjectState = ObjectState.Added
                    }
                };
            }
            else
            {
                accountCard.ObjectState            = ObjectState.Modified;
                accountCard.StripeCard.ObjectState = ObjectState.Modified;
            }


            accountCard.Id        = card.Id;
            accountCard.AccountId = card.AccountId;

            accountCard.StripeCard.InjectFrom(card);

            return(_accountCards.InsertOrUpdateGraph(accountCard, true));
        }
コード例 #7
0
 /// <summary>
 /// 显示患者信息
 /// </summary>
 /// <param name="accountCard"></param>
 /// <returns></returns>
 private void SetPatientInfo(AccountCard accountCard)
 {
     this.txtMarkNO.Text   = accountCard.MarkNO;
     this.txtName.Text     = accountCard.Patient.Name;
     this.txtSex.Text      = accountCard.Patient.Sex.Name;
     this.txtBirthDay.Text = accountCard.Patient.Birthday.ToString("yyyy-MM-dd");
     this.txtAge.Text      = outpatientManager.GetAge(accountCard.Patient.Birthday);
     this.txtIdeNO.Text    = accountCard.Patient.IDCard;
 }
コード例 #8
0
ファイル: ucEmpower.cs プロジェクト: ewin66/Management-System
        private void txtMarkNO_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                //获取就诊卡信息
                accountCard = new Neusoft.HISFC.Models.Account.AccountCard();
                int resultValue = accountManager.GetCardByRule(this.txtMarkNO.Text.Trim(), ref accountCard);
                if (resultValue <= 0)
                {
                    MessageBox.Show(accountManager.Err);
                    accountCard         = null;
                    this.txtMarkNO.Text = string.Empty;
                    this.txtMarkNO.Focus();
                    return;
                }
                //校验
                if (!Valid())
                {
                    this.txtMarkNO.Text = string.Empty;
                    this.txtMarkNO.Focus();
                    accountCard = null;
                    return;
                }

                this.txtMarkNO.Text   = accountCard.MarkNO;                                      //就诊卡号
                this.cmbMarkType.Tag  = accountCard.MarkType.ID;                                 //卡类型
                this.txtName.Text     = accountCard.Patient.Name;                                //患者姓名
                this.txtSex.Text      = accountCard.Patient.Sex.Name;                            //性别
                this.txtAge.Text      = accountManager.GetAge(accountCard.Patient.Birthday);     //年龄
                this.txtIdCardNO.Text = accountCard.Patient.IDCard;                              //证件号

                this.txtIdCardType.Text = IdtypeHelp.GetName(accountCard.Patient.IDCardType.ID); //证件类型
                Neusoft.FrameWork.Models.NeuObject tempObj = null;
                tempObj = managerIntegrate.GetConstansObj("NATION", accountCard.Patient.Nationality.ID);
                if (tempObj != null)
                {
                    this.txtNation.Text = tempObj.Name;//民族
                }
                tempObj = managerIntegrate.GetConstansObj("COUNTRY", accountCard.Patient.Country.ID);
                if (tempObj != null)
                {
                    this.txtCountry.Text = tempObj.Name;//国家
                }
                tempObj           = null;
                this.txtsiNo.Text = accountCard.Patient.SSN;
                this.txtepMarkNO.Focus();
                GetEmpowerList(account.ID);
            }
        }
コード例 #9
0
ファイル: ucEmpower.cs プロジェクト: ewin66/Management-System
 /// <summary>
 /// 清除授权信息
 /// </summary>
 private void ClearEmpower()
 {
     this.txtepMarkNO.Text    = string.Empty;
     this.cmbepMarkType.Tag   = string.Empty;
     this.txtepName.Text      = string.Empty;
     this.txtepSex.Text       = string.Empty;
     this.txtepAge.Text       = string.Empty;
     this.txtIdCardNO.Text    = string.Empty;
     this.txtIdCardType.Text  = string.Empty;
     this.txtEpNation.Text    = string.Empty;
     this.txtCountry.Text     = string.Empty;
     this.txtsiNo.Text        = string.Empty;
     this.empowerAcccountcard = null;
     this.txtepMarkNO.Focus();
 }
コード例 #10
0
        /// <summary>
        /// 显示账户授权信息
        /// </summary>
        /// <param name="accountCard"></param>
        /// <param name="accountEmpower"></param>
        /// <returns></returns>
        private int SetInfo(AccountCard accountCard, AccountEmpower accountEmpower)
        {
            this.SetPatientInfo(accountCard);

            this.txtPrePay.Text  = accountEmpower.EmpowerLimit.ToString();
            this.txtVacancy.Text = accountEmpower.Vacancy.ToString();
            this.txtCost.Text    = (accountEmpower.EmpowerLimit - accountEmpower.Vacancy).ToString();

            alFee = this.outpatientManager.GetAccountNoPrintFeeItemList(accountCard.Patient.PID.CardNO, Neusoft.HISFC.Models.Base.PayTypes.Balanced, true);
            if (alFee == null)
            {
                Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                MessageBox.Show("查询患者费用明细失败!" + outpatientManager.Err);
                return(-1);
            }
            this.SetFeeFp();
            return(1);
        }
コード例 #11
0
        /// <summary>
        /// 根据openId 查询用户信息
        /// </summary>
        /// <param name="openId"></param>
        /// <returns></returns>
        public string FindPersonInfo(string openId)
        {
            var collectiion = new MongoDBTool().GetMongoCollection <AccountCard>("AccountCard");
            var filter      = Builders <AccountCard> .Filter.Eq(x => x.OpenId, openId);

            var         list        = collectiion.Find <AccountCard>(f => f.OpenId.Equals(openId));
            AccountCard accountCard = null;

            accountCard = list.FirstOrDefault();
            //驼峰
            //string jsonString = JsonConvert.SerializeObject(new BaseResponseModel<AccountCard>() { JsonData = accountCard, StatusCode = (int)ActionParams.code_ok },new JsonSerializerSettings { ContractResolver=new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver()});
            string jsonString = JsonConvert.SerializeObject(new BaseResponseModel <AccountCard>()
            {
                JsonData = accountCard, StatusCode = (int)ActionParams.code_ok
            });

            return(jsonString);
        }
コード例 #12
0
        /// <summary>
        /// 显示患者基本信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void menuItem1_Click(object sender, EventArgs e)
        {
            if (this.neuSpread1.ActiveSheet != this.spPatient)
            {
                return;
            }
            if (this.spPatient.ActiveRow.Tag == null)
            {
                return;
            }
            AccountCard tempCard = this.spPatient.ActiveRow.Tag as AccountCard;

            if (tempCard.Patient == null)
            {
                MessageBox.Show("查询患者信息失败!");
                return;
            }
            this.ucRegPatientInfo1.CardNO = tempCard.Patient.PID.CardNO;
            this.txtMarkNo.Focus();
        }
コード例 #13
0
        public string RequestLogin(string code, string iv, string encryptedData)
        {
            AccountCard accountCard = null;

            WXSmallAppCommon.Models.WXAccountInfo wXAccount = WXSmallAppCommon.WXInteractions.WXLoginAction.ProcessRequest(code, iv, encryptedData);
            if (wXAccount.openId != null)
            {
                var filter = Builders <AccountCard> .Filter.And(Builders <AccountCard> .Filter.Eq(x => x.OpenId, wXAccount.openId));

                var collection = new MongoDBTool().GetMongoCollection <AccountCard>("AccountCard");
                var update     = Builders <AccountCard> .Update.Set(x => x.LastLoginTime, DateTime.Now);

                accountCard = collection.FindOneAndUpdate <AccountCard>(filter, update);

                if (accountCard == null)
                {
                    accountCard = new AccountCard()
                    {
                        OpenId = wXAccount.openId, AccountName = wXAccount.nickName, Gender = wXAccount.gender, AvatarUrl = wXAccount.avatarUrl, City = wXAccount.city, Province = wXAccount.province, CreateTime = DateTime.Now, LastLoginTime = DateTime.Now
                    };
                    collection.InsertOne(accountCard);
                }
            }
            BaseResponseModel <AccountCard> responseModel = new BaseResponseModel <AccountCard>();
            int stautsCode = (int)(ActionParams.code_error);

            if (accountCard != null)
            {
                responseModel.JsonData = accountCard;
                stautsCode             = (int)(ActionParams.code_ok);
            }
            responseModel.StatusCode = stautsCode;
            string jsonString = JsonConvert.SerializeObject(responseModel);

            Console.WriteLine("json**3:" + jsonString);
            return(jsonString);
        }
コード例 #14
0
        private void CardControl_Saving(Object sender, CancelEventArgs e)
        {
            try
            {
                /* Переформирование файлов */
                for (Int32 i = 0; i < Table_Service.RowCount; i++)
                {
                    BaseCardProperty   Row    = Table_Service[i];
                    ServiceTableChange Change = Dic_Changes.Find(Row[RefApplicationCard.Service.Id].ToGuid());
                    if (Change.FileIsChanged || Row[RefApplicationCard.Service.PackedListID].ToGuid().IsEmpty())
                    {
                        Guid FileId = Row[RefApplicationCard.Service.PackedListID].ToGuid();
                        AccountCard.FillPackFile(Context, UniversalCard.GetItemName(Row[RefApplicationCard.Service.DeviceID].ToGuid()), Row[RefApplicationCard.Service.PackedListData] as String, ref FileId);
                        Row[RefApplicationCard.Service.PackedListID] = FileId;
                        Table_Service.RefreshRow(i);
                    }
                    if (Change.DeviceNumberId.IsChanged)
                    {
                        if (!Change.DeviceNumberId.OldValue.IsEmpty())
                        {
                            UniversalCard.GetItemRow(Change.DeviceNumberId.OldValue).SetDeviceState(DeviceState.Operating);
                        }
                        if (!Change.DeviceNumberId.NewValue.IsEmpty())
                        {
                            UniversalCard.GetItemRow(Change.DeviceNumberId.NewValue).SetDeviceState(DeviceState.OnTheWay);
                        }
                    }
                    if (Change.Sensors.IsChanged)
                    {
                        if (!String.IsNullOrEmpty(Change.Sensors.OldValue))
                        {
                            foreach (String Sensor in Change.Sensors.OldValue.Split(';'))
                            {
                                UniversalCard.GetSensorRow(Sensor).SetDeviceState(DeviceState.Operating);
                            }
                        }
                        if (!String.IsNullOrEmpty(Change.Sensors.NewValue))
                        {
                            foreach (String Sensor in Change.Sensors.NewValue.Split(';'))
                            {
                                UniversalCard.GetSensorRow(Sensor).SetDeviceState(DeviceState.OnTheWay);
                            }
                        }
                    }
                }

                /* Синхронизация */
                if (Dic_Changes.IsChanged())
                {
                    ReferenceList   RefList      = Context.GetObject <ReferenceList>(GetControlValue(RefApplicationCard.MainInfo.Links).ToGuid());
                    List <CardData> AccountCards = new List <CardData>();
                    /* Получение карточек */
                    foreach (ReferenceListReference Link in RefList.References)
                    {
                        if (Link.CardType.Equals(RefAccountCard.ID))
                        {
                            CardData AccountCard = CardScript.Session.CardManager.GetCardData(Link.Card);
                            CardLock CardLock    = CardScript.GetCardLock(AccountCard);
                            if (!CardLock.IsFree)
                            {
                                throw new MyException("Договор/счет «" + CardLock.CardDescription + "» заблокирован " + (CardLock.IsMine ? "вами!" : "пользователем «" + CardLock.AccountName + "»!"));
                            }
                            AccountCards.Add(AccountCard);
                        }
                    }
                    for (Int32 i = 0; i < AccountCards.Count; i++)
                    {
                        RefList = Context.GetObject <ReferenceList>(AccountCards[i].Sections[RefAccountCard.MainInfo.ID].FirstRow.GetGuid(RefAccountCard.MainInfo.LinkListId));

                        List <CardData> ShipmentTasks = new List <CardData>(),
                                        CompleteTasks = new List <CardData>();

                        /* Получение карточек */
                        foreach (ReferenceListReference Link in RefList.References)
                        {
                            if (Link.CardType.Equals(RefShipmentCard.ID))
                            {
                                CardData ShipmentTask = CardScript.Session.CardManager.GetCardData(Link.Card);
                                CardLock CardLock     = CardScript.GetCardLock(ShipmentTask);
                                if (!CardLock.IsFree)
                                {
                                    throw new MyException("Задание на отгрузку «" + CardLock.CardDescription + "» заблокировано " + (CardLock.IsMine ? "вами!" : "пользователем «" + CardLock.AccountName + "»!"));
                                }
                                ShipmentTasks.Add(ShipmentTask);
                                CardData CompleteTask = CardScript.Session.CardManager.GetCardData(ShipmentTask.Sections[RefShipmentCard.MainInfo.ID].FirstRow.GetGuid(RefShipmentCard.MainInfo.CompleteTaskId).ToGuid());
                                CardLock = CardScript.GetCardLock(CompleteTask);
                                if (!CardLock.IsFree)
                                {
                                    throw new MyException("Задание на комплектацию «" + CardLock.CardDescription + "» заблокировано " + (CardLock.IsMine ? "вами!" : "пользователем «" + CardLock.AccountName + "»!"));
                                }
                                CompleteTasks.Add(CompleteTask);
                            }
                        }

                        if (AccountCards[i].InUpdate)
                        {
                            AccountCards[i].CancelUpdate();
                        }

                        RowDataCollection AccountServiceRows     = AccountCards[i].Sections[RefAccountCard.Service.ID].Rows;
                        RowDataCollection AccountAddCompleteRows = AccountCards[i].Sections[RefAccountCard.AddComplete.ID].Rows;

                        for (Int32 j = 0; j < Table_Service.RowCount; j++)
                        {
                            BaseCardProperty   Row        = Table_Service[i];
                            ServiceTableChange Change     = Dic_Changes.Find(Row[RefApplicationCard.Service.Id].ToGuid());
                            RowData            ServiceRow = AccountServiceRows.Find(RefAccountCard.Service.Id, Change.RowId);
                            if (Change.IsChanged && !ServiceRow.IsNull())
                            {
                                if (Change.Warranty.IsChanged)
                                {
                                    ServiceRow.SetBoolean(RefAccountCard.Service.Warranty, Change.Warranty.NewValue);
                                }
                                if (Change.DeviceId.IsChanged)
                                {
                                    ServiceRow.SetGuid(RefAccountCard.Service.DeviceId, Change.DeviceId.NewValue);
                                }
                                if (Change.AC.IsChanged)
                                {
                                    ServiceRow.SetBoolean(RefAccountCard.Service.AC, Change.AC.NewValue);
                                }
                                if (Change.FileIsChanged)
                                {
                                    ServiceRow.SetString(RefAccountCard.Service.ACList, Row[RefApplicationCard.Service.ACList] as String);
                                    ServiceRow.SetString(RefAccountCard.Service.PackedListData, Row[RefApplicationCard.Service.PackedListData] as String);
                                    ServiceRow.SetGuid(RefAccountCard.Service.PackedListId, Row[RefApplicationCard.Service.PackedListData].ToGuid());

                                    RowDataCollection AddCompleteRows    = AccountAddCompleteRows.Filter("@" + RefAccountCard.AddComplete.ParentTableRowId + " = '" + Change.RowId.ToString().ToUpper() + "'");
                                    List <String>     AccountComlete     = AddCompleteRows.Select(r => r.GetString(RefAccountCard.AddComplete.Name)).ToList();
                                    List <String>     ApplicationComlete = new List <String>();
                                    for (Int32 k = 0; k < Table_AddComplete.RowCount; k++)
                                    {
                                        if (Table_AddComplete[k][RefApplicationCard.AddComplete.ParentTableRowId].ToGuid().Equals(Change.RowId))
                                        {
                                            ApplicationComlete.Add(Table_AddComplete[k][RefApplicationCard.AddComplete.Name] as String);
                                        }
                                    }

                                    for (Int32 k = 0; k < AddCompleteRows.Count; k++)
                                    {
                                        if (!ApplicationComlete.Contains(AddCompleteRows[k].GetString(RefAccountCard.AddComplete.Name)))
                                        {
                                            AccountCards[i].Sections[RefAccountCard.AddComplete.ID].DeleteRow(AddCompleteRows[k].Id);
                                        }
                                    }

                                    for (Int32 k = 0; k < Table_AddComplete.RowCount; k++)
                                    {
                                        if (Table_AddComplete[k][RefApplicationCard.AddComplete.ParentTableRowId].ToGuid().Equals(Change.RowId))
                                        {
                                            RowData AddCompleteRow = AddCompleteRows.Find(RefAccountCard.AddComplete.Name, Table_AddComplete[k][RefApplicationCard.AddComplete.Name] as String);
                                            if (AddCompleteRow.IsNull())
                                            {
                                                AddCompleteRow = AccountCards[i].Sections[RefAccountCard.AddComplete.ID].Rows.AddNew();
                                                AddCompleteRow.SetInt32(RefAccountCard.AddComplete.Ordered, 0);
                                            }
                                            AddCompleteRow.SetInt32(RefAccountCard.AddComplete.Count, (Int32?)Table_AddComplete[k][RefApplicationCard.AddComplete.Count]);
                                            AddCompleteRow.SetGuid(RefAccountCard.AddComplete.Id, Table_AddComplete[k][RefApplicationCard.AddComplete.Id].ToGuid());
                                            AddCompleteRow.SetString(RefAccountCard.AddComplete.Name, Table_AddComplete[k][RefApplicationCard.AddComplete.Name] as String);
                                            AddCompleteRow.SetString(RefAccountCard.AddComplete.Code, Table_AddComplete[k][RefApplicationCard.AddComplete.Code] as String);
                                        }
                                    }
                                }
                            }
                        }

                        for (Int32 j = 0; j < ShipmentTasks.Count; j++)
                        {
                            if (ShipmentTasks[j].LockStatus == LockStatus.Free && CompleteTasks[j].LockStatus == LockStatus.Free)
                            {
                                if (ShipmentTasks[j].InUpdate)
                                {
                                    ShipmentTasks[j].CancelUpdate();
                                }
                                if (CompleteTasks[j].InUpdate)
                                {
                                    CompleteTasks[j].CancelUpdate();
                                }

                                RowDataCollection ShipmentDevicesRows = ShipmentTasks[j].Sections[RefShipmentCard.Devices.ID].Rows;
                                RowDataCollection CompleteDevicesRows = CompleteTasks[j].Sections[RefCompleteCard.Devices.ID].Rows;

                                foreach (RowData DevicesRow in ShipmentDevicesRows)
                                {
                                    ServiceTableChange Change = Dic_Changes.Find(DevicesRow.GetGuid(RefShipmentCard.Devices.AccountCardRowId).ToGuid());
                                    if (!Change.IsNull() && Change.IsChanged)
                                    {
                                        RowDataCollection CompleteRows = CompleteDevicesRows.Filter("@" + RefCompleteCard.Devices.ShipmentTaskRowId + " = '" + DevicesRow.GetGuid(RefShipmentCard.Devices.Id).ToString().ToUpper() + "'");
                                        /* Изменение связных полей */
                                        if (Change.Warranty.IsChanged)
                                        {
                                            DevicesRow.SetBoolean(RefShipmentCard.Devices.Warranty, Change.Warranty.NewValue);
                                            foreach (RowData CompleteRow in CompleteRows)
                                            {
                                                CompleteRow.SetBoolean(RefCompleteCard.Devices.Warranty, Change.Warranty.NewValue);
                                            }
                                        }
                                        if (Change.AC.IsChanged)
                                        {
                                            DevicesRow.SetBoolean(RefShipmentCard.Devices.AC, Change.AC.NewValue);
                                            foreach (RowData CompleteRow in CompleteRows)
                                            {
                                                CompleteRow.SetBoolean(RefCompleteCard.Devices.AC, Change.AC.NewValue);
                                            }
                                        }
                                        if (Change.DeviceId.IsChanged)
                                        {
                                            DevicesRow.SetGuid(RefShipmentCard.Devices.DeviceId, Change.DeviceId.NewValue);
                                            foreach (RowData CompleteRow in CompleteRows)
                                            {
                                                CompleteRow.SetGuid(RefCompleteCard.Devices.DeviceId, Change.DeviceId.NewValue);
                                            }
                                        }
                                        if (Change.FileIsChanged)
                                        {
                                            DevicesRow.SetBoolean(RefShipmentCard.Devices.IsChanged, Change.FileIsChanged);
                                            for (Int32 k = 0; k < Table_Service.RowCount; k++)
                                            {
                                                if (Table_Service[k][RefApplicationCard.Service.Id].ToGuid().Equals(Change.RowId))
                                                {
                                                    DevicesRow.SetGuid(RefShipmentCard.Devices.TemplatePackListId, Table_Service[k][RefApplicationCard.Service.PackedListID].ToGuid());
                                                }
                                            }
                                        }

                                        /* Очистка связных полей */
                                        if (Change.DeviceId.IsChanged || Change.AC.IsChanged)
                                        {
                                            DevicesRow.SetString(RefShipmentCard.Devices.DeviceNumbers, null);
                                            DevicesRow.SetString(RefShipmentCard.Devices.PartyNumbers, null);
                                            DevicesRow.SetString(RefShipmentCard.Devices.Coupons, null);

                                            foreach (RowData CompleteRow in CompleteRows)
                                            {
                                                try
                                                {
                                                    Guid DeviceNumberId = CompleteRow.GetObject(RefCompleteCard.Devices.DeviceNumberId).ToGuid();
                                                    /* Очистка приборов */
                                                    if (!DeviceNumberId.IsEmpty())
                                                    {
                                                        try { UniversalCard.GetItemRow(DeviceNumberId).UpdateDeviceInformation(UniversalCard, CompleteRow.GetBoolean(RefCompleteCard.Devices.AS)); }
                                                        catch (MyException Ex)
                                                        {
                                                            switch (Ex.ErrorCode)
                                                            {
                                                            case -1:
                                                                WriteLog("Ошибка: предвиденное исключение" + "\r\n" + Ex.Message + "\r\n" + Ex.StackTrace);
                                                                WriteLog("Ошибка: предвиденное исключение" + "\r\n" + Ex.InnerException.Message + "\r\n" + Ex.InnerException.StackTrace);
                                                                break;

                                                            case 0:
                                                                WriteLog("Ошибка: предвиденное исключение" + "\r\n" + Ex.Message + "\r\n" + Ex.StackTrace);
                                                                break;

                                                            case 1:
                                                                String[] ss = Ex.Message.Split('\t');
                                                                WriteLog("Ошибка: предвиденное исключение" + "\r\n" + (ss.Length >= 2 ? "В карточке " + ss[1] + " отсутствует поле: " + ss[0] : Ex.Message) + "\r\n" + Ex.StackTrace);
                                                                WriteLog("Ошибка: предвиденное исключение" + "\r\n" + Ex.InnerException.Message + "\r\n" + Ex.InnerException.StackTrace);
                                                                break;
                                                            }
                                                        }
                                                    }

                                                    CompleteRow.SetGuid(RefCompleteCard.Devices.DeviceNumberId, Guid.Empty);
                                                    CompleteRow.SetString(RefCompleteCard.Devices.DeviceNumber, null);
                                                    CompleteRow.SetGuid(RefCompleteCard.Devices.CouponId, Guid.Empty);
                                                }
                                                catch (Exception Ex) { WriteLog("Ошибка: непредвиденное исключение" + "\r\n" + Ex.Message + "\r\n" + Ex.StackTrace); }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (ArgumentNullException Ex)
            {
                MyMessageBox.Show("Поле \"" + Ex.ParamName + "\" обязательно к заполнению!", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                e.Cancel = true;
            }
            catch (MyException Ex)
            {
                MyMessageBox.Show(Ex.Message + Environment.NewLine + "Синхронизация связных карточек не произойдет.", "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                e.Cancel = true;
            }
            catch (Exception Ex) { CallError(Ex); }
        }
コード例 #15
0
        /// <summary>
        /// 查询患者信息
        /// </summary>
        protected virtual int QueryPatientInfo()
        {
            Neusoft.HISFC.Models.RADT.PatientInfo patient = this.ucRegPatientInfo1.GetPatientInfomation();
            if (string.IsNullOrEmpty(patient.Name) && string.IsNullOrEmpty(patient.Sex.ID.ToString()) && string.IsNullOrEmpty(patient.Pact.ID) &&
                string.IsNullOrEmpty(patient.PID.CaseNO) && string.IsNullOrEmpty(patient.IDCardType.ID) && string.IsNullOrEmpty(patient.IDCard) &&
                string.IsNullOrEmpty(patient.SSN))
            {
                return(-1);
            }


            Neusoft.FrameWork.WinForms.Classes.Function.ShowWaitForm("正在查找患者信息,请稍后...");
            Application.DoEvents();
            //查找患者信息

            List <AccountCard> list = accountManager.GetAccountCard(patient.Name,
                                                                    patient.Sex.ID.ToString(),
                                                                    patient.Pact.ID,
                                                                    patient.PID.CaseNO,
                                                                    patient.IDCardType.ID,
                                                                    patient.IDCard,
                                                                    patient.SSN);

            if (list == null)
            {
                Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                MessageBox.Show(accountManager.Err);
                return(-1);
            }
            try
            {
                if (this.spPatient.Rows.Count > 0)
                {
                    this.spPatient.Rows.Remove(0, this.spPatient.Rows.Count);
                }
                this.spPatient.Rows.Count = list.Count;
                int count = 0, beginIndex = 0, rangCount = 1;
                count = list.Count;
                for (int i = 0; i < count; i++)
                {
                    AccountCard tempCard = list[i];
                    //姓名
                    this.spPatient.Cells[i, 0].Text = tempCard.Patient.Name;
                    //性别
                    this.spPatient.Cells[i, 1].Text = tempCard.Patient.Sex.Name;
                    //生日
                    this.spPatient.Cells[i, 2].Text = this.accountManager.GetAge(tempCard.Patient.Birthday);
                    //民族
                    this.spPatient.Cells[i, 3].Text = this.ucRegPatientInfo1.GetName(tempCard.Patient.Nationality.ID, 0);
                    //合同单位
                    this.spPatient.Cells[i, 4].Text = tempCard.Patient.Pact.Name;
                    //证件类型
                    this.spPatient.Cells[i, 5].Text = this.ucRegPatientInfo1.GetName(tempCard.Patient.IDCardType.ID, 1);
                    //证件号
                    this.spPatient.Cells[i, 6].Text  = tempCard.Patient.IDCard;
                    this.spPatient.Cells[i, 7].Text  = tempCard.Patient.CompanyName;
                    this.spPatient.Cells[i, 8].Text  = tempCard.Patient.AddressHome;
                    this.spPatient.Cells[i, 9].Text  = tempCard.MarkNO;
                    this.spPatient.Cells[i, 10].Text = markTypeHelp.GetName(tempCard.MarkType.ID);
                    this.spPatient.Rows[i].Tag       = tempCard;
                    //计算合并单元格
                    if (i < count - 1)
                    {
                        if (tempCard.Patient.PID.CardNO == list[i + 1].Patient.PID.CardNO)
                        {
                            rangCount += 1;
                            if (i == count - 2)
                            {
                                if (rangCount > 1)
                                {
                                    RangFpCell(beginIndex, rangCount);
                                }
                            }
                        }
                        else
                        {
                            if (rangCount > 1)
                            {
                                RangFpCell(beginIndex, rangCount);
                            }
                            beginIndex = i + 1;
                            rangCount  = 1;
                        }
                    }
                }
                this.neuSpread1.ActiveSheet = spPatient;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
                return(-1);
            }
            Neusoft.FrameWork.WinForms.Classes.Function.HideWaitForm();
            return(1);
        }