当前位置: 首页>>代码示例>>C#>>正文


C# Select.ExecuteSingle方法代码示例

本文整理汇总了C#中Select.ExecuteSingle方法的典型用法代码示例。如果您正苦于以下问题:C# Select.ExecuteSingle方法的具体用法?C# Select.ExecuteSingle怎么用?C# Select.ExecuteSingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Select的用法示例。


在下文中一共展示了Select.ExecuteSingle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: cmdValidate_Click

        private void cmdValidate_Click(object sender, EventArgs e)
        {
            try
            {
                var sqlQuery =
                    new Select().From(TResultDetail.Schema).Where(TResultDetail.Columns.PatientId).IsEqualTo(
                        Utility.sDbnull(grdPatients.GetValue("Patient_ID")));

                var testInfo = sqlQuery.ExecuteSingle<TTestInfo>();
                if (testInfo != null)
                {
                    if (Utility.AcceptQuestion(string.Format("Hoàn tất xét nghiệm của bệnh nhân {0} ",
                                                             Utility.sDbnull(grdPatients.GetValue("Patient_Name"))),
                                               "Thông báo", true))
                    {
                        new Update(LPatientInfo.Schema.Name).Set(LPatientInfo.Columns.IsFinal).EqualTo(1).
                            Where(LPatientInfo.Columns.PatientId).IsEqualTo(
                                Utility.Int32Dbnull(grdPatients.GetValue("Patient_ID"))).Execute();
                        grdPatients.SetValue("IsFinal", 1);
                        grdPatients.UpdateData();
                        mv_DTPatientInfor.AcceptChanges();
                        grdResultDetail.AllowEdit = InheritableBoolean.True;
                    }
                }
                else
                {
                    Utility.ShowMsg("Bệnh nhân chưa có kết quả nên chưa được hoàn thành", "Thông Báo",
                                    MessageBoxIcon.Warning);
                }
            }
            catch (Exception ex)
            {
                Utility.ShowMsg(ex.Message);
            }
        }
开发者ID:khaha2210,项目名称:CodeNewTeam,代码行数:35,代码来源:frm_DangKyTraCuu.cs

示例2: tsmDuyetChiDinh_Click

 private void tsmDuyetChiDinh_Click(object sender, EventArgs e)
 {
     try
     {
         if (grdTestInfo.CurrentRow.Cells["SentStatus"].Value.ToString() == "1")
         {
             var printStatus = Utility.sDbnull(grdPatients.GetValue("Print_Status"));
             if (printStatus == "1")
             {
                 if (globalVariables.UserName == "ADMIN" || globalVariables.UserName == "TRUC" ||
                     globalVariables.UserName == "TRUONGKHOA" || globalVariables.UserName == "PHOKHOA")
                 {
                     if (Utility.AcceptQuestion(
                         string.Format("Cho phép xử lý kết quả xét nghiệm {0} của bệnh nhân {1}",
                                       Utility.sDbnull(grdTestInfo.GetValue("TestType_Name")),
                                       Utility.sDbnull(grdPatients.GetValue("Patient_Name"))), "Thông Báo", true))
                     {
                         new Update(TTestInfo.Schema.Name).Set(TTestInfo.Columns.SentStatus).EqualTo(0).Where(
                             TTestInfo.Columns.TestId).IsEqualTo(
                                 Utility.Int32Dbnull(grdTestInfo.GetValue("Test_ID")))
                             .And(
                                 TTestInfo.Columns.PatientId).IsEqualTo(
                                     Utility.Int32Dbnull(grdPatients.GetValue("Patient_ID"))).Execute();
                         grdTestInfo.SetValue("SentStatus", 0);
                         grdTestInfo.UpdateData();
                         m_dtTestInfo.AcceptChanges();
                         grdResultDetail.AllowEdit = InheritableBoolean.True;
                     }
                     HoanTatBenhNhan();
                 }
                 else
                 {
                     Utility.ShowMsg(
                         "Bệnh nhân này đã được in nên không hủy duyệt được" + "\n" +
                         "Vui lòng liên hệ với ADMIN để được hủy duyệt! Thanks", "Thông Báo",
                         MessageBoxIcon.Error);
                 }
             }
             else
             {
                 if (Utility.AcceptQuestion(
                     string.Format("Cho phép xử lý kết quả xét nghiệm {0} của bệnh nhân {1}",
                                   Utility.sDbnull(grdTestInfo.GetValue("TestType_Name")),
                                   Utility.sDbnull(grdPatients.GetValue("Patient_Name"))), "Thông Báo", true))
                 {
                     new Update(TTestInfo.Schema.Name).Set(TTestInfo.Columns.SentStatus).EqualTo(0).Where(
                         TTestInfo.Columns.TestId).IsEqualTo(Utility.Int32Dbnull(grdTestInfo.GetValue("Test_ID")))
                         .
                         And(
                             TTestInfo.Columns.PatientId).IsEqualTo(
                                 Utility.Int32Dbnull(grdPatients.GetValue("Patient_ID"))).Execute();
                     grdTestInfo.SetValue("SentStatus", 0);
                     grdTestInfo.UpdateData();
                     m_dtTestInfo.AcceptChanges();
                     grdResultDetail.AllowEdit = InheritableBoolean.True;
                 }
                 HoanTatBenhNhan();
             }
         }
         else
         {
             SqlQuery sqlQuery =
                 new Select().From(TResultDetail.Schema).Where(TResultDetail.Columns.TestId).IsEqualTo(
                     Utility.sDbnull(grdTestInfo.GetValue("Test_ID")));
             var testInfo = sqlQuery.ExecuteSingle<TTestInfo>();
             if (testInfo != null)
             {
                 if (Utility.AcceptQuestion(string.Format("Hoàn tất xét nghiệm {0} của bện nhân {1} ",
                                                          Utility.sDbnull(grdTestInfo.GetValue("TestType_Name")),
                                                          Utility.sDbnull(grdPatients.GetValue("Patient_Name"))),
                                            "Thông Báo", true))
                 {
                     new Update(TTestInfo.Schema.Name).Set(TTestInfo.Columns.SentStatus).EqualTo(1).Where(
                         TTestInfo.Columns.PatientId).IsEqualTo(
                             Utility.Int32Dbnull(grdPatients.GetValue("Patient_ID"))).And(
                                 TTestInfo.Columns.TestId).
                         IsEqualTo(Utility.sDbnull(grdTestInfo.GetValue("Test_ID"))).Execute();
                     grdTestInfo.SetValue("SentStatus", 1);
                     grdTestInfo.UpdateData();
                     m_dtTestInfo.AcceptChanges();
                     grdResultDetail.AllowEdit = InheritableBoolean.True;
                 }
                 HoanTatBenhNhan();
             }
             else
             {
                 Utility.ShowMsg(
                     string.Format(" Xét nghiệm {0} của bệnh nhân {1} chưa có kết quả",
                                   Utility.sDbnull(grdTestInfo.GetValue("TestType_Name")),
                                   Utility.sDbnull(grdPatients.GetValue("Patient_Name"))), "Thông Báo",
                     MessageBoxIcon.Warning);
             }
         }
     }
     catch (Exception ex)
     {
         Utility.ShowMsg("Duyệt kết quả thất bại" + "\n" + ex, "Thông Báo", MessageBoxIcon.Error);
     }
 }
开发者ID:khaha2210,项目名称:CodeNewTeam,代码行数:99,代码来源:frm_DangKyTraCuu.cs

示例3: PtramBHYTDacBiet

        /// <summary>
        /// hàm thực hiện viec tính toán giá đặc biệt cho bệnh nhân
        /// </summary>
        /// <param name="objChidinhChitiet"></param>
        /// <param name="objLuotkham"></param>
        /// <param name="PaymentType_ID"></param>
        public static void PtramBHYTDacBiet(KcbChidinhclsChitiet objChidinhChitiet,KcbLuotkham objLuotkham,int PaymentType_ID,ref bool b_Exist)
        {
            b_Exist = false;
               string IsDungTuyen = "DT";
               DmucDoituongkcb objectType = DmucDoituongkcb.FetchByID(objLuotkham.IdDoituongKcb);
               if (objectType != null)
               {
               switch (objectType.MaDoituongKcb)
               {
                   case "BHYT":
                       if (Utility.Int32Dbnull(objLuotkham.DungTuyen, "0") == 1) IsDungTuyen = "DT";
                       else
                       {
                           IsDungTuyen = "TT";
                       }
                       break;
                   default:
                       IsDungTuyen = "KHAC";
                       break;
               }

               }
               SqlQuery sqlQuery = new Select().From(DmucBhytChitraDacbiet.Schema)
               .Where(DmucBhytChitraDacbiet.Columns.IdDichvuChitiet).IsEqualTo(objChidinhChitiet.IdChitietchidinh)
               .And(DmucBhytChitraDacbiet.Columns.MaLoaithanhtoan).IsEqualTo(PaymentType_ID)
               .And(DmucBhytChitraDacbiet.Columns.DungtuyenTraituyen).IsEqualTo(IsDungTuyen)
               .And(DmucBhytChitraDacbiet.Columns.MaDoituongKcb).IsEqualTo(objLuotkham.MaDoituongKcb);
               DmucBhytChitraDacbiet objDetailPtramBhyt = sqlQuery.ExecuteSingle<DmucBhytChitraDacbiet>();
               if(objDetailPtramBhyt!=null)
               {
               objChidinhChitiet.IdLoaichidinh = 1;
               objChidinhChitiet.BhytChitra = Gia_BHYT(objDetailPtramBhyt.TileGiam,Utility.DecimaltoDbnull(objChidinhChitiet.DonGia, 0));
               objChidinhChitiet.BnhanChitra = Utility.DecimaltoDbnull(objChidinhChitiet.DonGia, 0) -
                                         objChidinhChitiet.BhytChitra;
               objChidinhChitiet.PtramBhyt = Utility.DecimaltoDbnull(objDetailPtramBhyt.TileGiam, 0);
               objChidinhChitiet.LoaiChietkhau = 1;
               b_Exist = true;
               // objChidinhChitiet.DonGia =
               }
        }
开发者ID:vmshis2020,项目名称:VMSHISServer,代码行数:46,代码来源:TinhCLS.cs

示例4: ThemBenhNhan

     /// <summary>
     /// Thực hiện thêm mới thông tin không nhập qua phần tiếp đón
     /// </summary>
     /// <param name="TenBenhNhan">Tên bệnh nhân</param>
       /// <param name="StudyInstanseUid">StudyInstanseUid</param>
       /// <param name="SERIES_INSTANCE_UID">SERIES_INSTANCE_UID</param>
       /// <param name="SOP_INSTANCE_UID">SOP_INSTANCE_UID</param>
     /// <param name="IdDichVu">ID dịch vụ </param>
     /// <param name="PathImage">Đường dẫn ảnh</param>
     /// <returns></returns>
       public ActionResult ThemBenhNhan(string TenBenhNhan,string GTinh, string StudyInstanseUid, string SERIES_INSTANCE_UID, string SOP_INSTANCE_UID, string BodyPart,string Position, string PathImage,string PathImage_thumb)
       {
           try
           {
               
               Query _QuerySoPhieu = RisPhieuCdinh.CreateQuery();
               Query _QueryChiTiet = RisPhieuCdinhCtiet.CreateQuery();
               using (var scope = new TransactionScope())
               {
                   using (var sp = new SharedDbConnectionScope())
                   {
                       DateTime sysDateTime = BusinessHelper.GetSysDateTime();
                       RisBenhNhan objBenhNhan = new RisBenhNhan();
                       SqlQuery sqlQuery = new Select().From(RisPhieuCdinh.Schema)
                           .Where(RisPhieuCdinh.Columns.StudyInstanseUid).IsEqualTo(StudyInstanseUid);
                       RisPhieuCdinh objPhieuCdinh = new RisPhieuCdinh();
                     
                       if(sqlQuery.GetRecordCount()<=0)
                       {
                               objBenhNhan = ThemMoiBenhNhan(TenBenhNhan, GTinh);
                               objPhieuCdinh.StudyInstanseUid = StudyInstanseUid;
                               objPhieuCdinh.IdBnhan = objBenhNhan.IdBnhan;
                               objPhieuCdinh.MaPhieu = BusinessHelper.LayMaPhieu();
                               objPhieuCdinh.Pid = objBenhNhan.Pid;
                               objPhieuCdinh.LoaiPhieu = 1;
                              // objPhieuCdinh.IdKhoaThien = -1;
                               //objPhieuCdinh.MaTbi = String.Empty;
                               objPhieuCdinh.NgayDky = sysDateTime;
                               objPhieuCdinh.NgayTao = sysDateTime;
                               objPhieuCdinh.NguoiTao = globalVariables.UserName;
                               objPhieuCdinh.IsNew = true;
                               objPhieuCdinh.Save();
                               objPhieuCdinh.IdPhieu = Utility.Int32Dbnull(_QuerySoPhieu.GetMax(RisPhieuCdinh.Columns.IdPhieu));
                          
                       }
                       else
                       {
                           objPhieuCdinh = sqlQuery.ExecuteSingle<RisPhieuCdinh>();
                           new Update(RisBenhNhan.Schema)
                               .Set(RisBenhNhan.Columns.TenBnhan).EqualTo(TenBenhNhan)
                               .Set(RisBenhNhan.Columns.TenBnhanKdau).EqualTo(Utility.UnSignedCharacter(TenBenhNhan))
                               .Set(RisBenhNhan.Columns.Gtinh).EqualTo(GTinh)
                               .Where(RisBenhNhan.Columns.IdBnhan).IsEqualTo(objPhieuCdinh.IdBnhan).Execute();
                           
                       }
                       sqlQuery = new Select().From(RisPhieuCdinhCtiet.Schema)
                           .Where(RisPhieuCdinhCtiet.Columns.IdPhieu).IsEqualTo(objPhieuCdinh.IdPhieu)
                           .And(RisPhieuCdinhCtiet.Columns.SeriesInstanceUid).IsEqualTo(SERIES_INSTANCE_UID)
                           .And(RisPhieuCdinhCtiet.Columns.StudyInstanceUid).IsEqualTo(StudyInstanseUid)
                           .And(RisPhieuCdinhCtiet.Columns.SopInstanceUid).IsEqualTo(SOP_INSTANCE_UID);
                       RisPhieuCdinhCtiet objRisPhieuCdinhCtiet = new RisPhieuCdinhCtiet();
                       if(sqlQuery.GetRecordCount()<=0)
                       {

                           SqlQuery sqlQueryDV = new Select().From(DDichVu.Schema)
                               .Where(DDichVu.Columns.MaDvu).IsEqualTo(Position)
                               .And(DDichVu.Columns.IdLoaiDvu).In(
                                   new Select(DLoaiDvu.Columns.IdLoaiDvu).From(DLoaiDvu.Schema)
                                   .Where(DLoaiDvu.Columns.MaLoaiDvu).
                                       IsEqualTo(BodyPart));
                           DDichVu objDichVu = sqlQueryDV.ExecuteSingle<DDichVu>();
                           if (objDichVu != null)
                           {
                               objRisPhieuCdinhCtiet.IdDvu = Utility.Int32Dbnull(objDichVu.IdDvu, -1);
                               if (objDichVu != null)
                               {
                                   objRisPhieuCdinhCtiet.IdLoaiDvu = objDichVu.IdLoaiDvu;
                                   objRisPhieuCdinhCtiet.GhiChu = Utility.sDbnull(objDichVu.MoTa, "");
                                   SqlQuery sqlQueryVungKS = new Select().From(DVungKsat.Schema)
                                       .Where(DVungKsat.Columns.IdVungKs).IsEqualTo(objDichVu.IdVungKs);
                                   DVungKsat objDVungKsat = sqlQueryVungKS.ExecuteSingle<DVungKsat>();
                                   if (objDVungKsat != null)
                                   {
                                       objRisPhieuCdinhCtiet.VungKs = Utility.sDbnull(objDVungKsat.TenVungKs, "");
                                       objRisPhieuCdinhCtiet.KetLuan = Utility.sDbnull(objDVungKsat.KetLuan, "");
                                       objRisPhieuCdinhCtiet.DeNghi = Utility.sDbnull(objDVungKsat.DeNghi, "");
                                       objRisPhieuCdinhCtiet.KyThuat = Utility.sDbnull(objDVungKsat.KyThuat, "");
                                       objRisPhieuCdinhCtiet.MoTa = Utility.sDbnull(objDVungKsat.MoTa, "");
                                   }
                               }
                           }
                           objRisPhieuCdinhCtiet.Sluong = 1;
                           objRisPhieuCdinhCtiet.DaIn = 0;
                           objRisPhieuCdinhCtiet.SeriesInstanceUid = SERIES_INSTANCE_UID;
                           objRisPhieuCdinhCtiet.SopInstanceUid = SOP_INSTANCE_UID;
                           objRisPhieuCdinhCtiet.StudyInstanceUid = objPhieuCdinh.StudyInstanseUid;
                           // objRisPhieuCdinhCtiet.DdanAnh = PathImage;
                           objRisPhieuCdinhCtiet.MaDvu = Position;
                           objRisPhieuCdinhCtiet.MaLoaiDvu = BodyPart;
                           objRisPhieuCdinhCtiet.MaTbi = string.Empty;
//.........这里部分代码省略.........
开发者ID:khaha2210,项目名称:radio,代码行数:101,代码来源:ImportBenhNhan.cs

示例5: frm_SysUsers_Load

        private void frm_SysUsers_Load(object sender, EventArgs e)
        {
            SysUserCollection sysUserCollection = new Select().From(SysUser.Schema).ExecuteAsCollection<SysUserCollection>();
               // grdSysUser.DataSource = sysUserCollection.ToDataTable();
            Utility.SetDataSourceForDataGridEx(grdSysUser,sysUserCollection.ToDataTable(),true,true,"","");

            SqlQuery sqlQuery = new Select().From(SysTrinhky.Schema)
               .Where(SysTrinhky.Columns.ReportName).IsEqualTo(TenBaoCao)
               .And(SysTrinhky.Columns.ObjectName).IsEqualTo(globalVariables.UserName);
            SysTrinhky objSysTrinhky = sqlQuery.ExecuteSingle<SysTrinhky>();
            if(objSysTrinhky!=null)
            {
                NoiDung = Utility.sDbnull(objSysTrinhky.Trinhky);
            }
        }
开发者ID:khaha2210,项目名称:CodeNewHis,代码行数:15,代码来源:frm_SysUsers.cs

示例6: LayThongPtramBHYT

        /// <summary>
        /// hàm thục hiện tính toán thông tin 
        /// </summary>
        /// <param name="v_decTotalPrice"></param>
        /// <param name="objPatientExam"></param>
        /// <param name="PtramBHYT"></param>
        /// <returns></returns>
        public decimal LayThongPtramBHYT(decimal v_decTotalPrice, TPatientExam objPatientExam, ref  decimal PtramBHYT)
        {
            decimal decDiscountTotalMoney = 0;
            SqlQuery q;
            if (!string.IsNullOrEmpty(objPatientExam.InsClinicCode) && IsBaohiem(objPatientExam))
            {
                ///thực hiện xem có đúng tuyến không

                if (objPatientExam.CorrectLine == 1)
                {
                    if (objPatientExam.InsObjectCodeNumber.ToString() == "1" || objPatientExam.InsObjectCodeNumber.ToString() == "2")
                    {
                        decDiscountTotalMoney = 0;
                        PtramBHYT = 100;
                        log.Info("Benh nhan tuong ung voi muc =" + objPatientExam.InsObjectCodeNumber);
                    }
                    else
                    {
                        switch (globalVariables.gv_BenhVienTuyen)
                        {
                            case "TUYEN1":
                                if (v_decTotalPrice >= objPatientExam.SalaryBasic * 15 / 100)
                                {
                                    log.Info(string.Format("Neu ma benh nhan lon hon muc luong co ban={0} thi bat dau tinh gia", BusinessHelper.GetLuongCoBan()));
                                    q = new Select().From(LInsuranceObject.Schema)
                                       .Where(LInsuranceObject.Columns.ObjectTypeId).IsEqualTo(objPatientExam.ObjectTypeId)
                                       .And(LInsuranceObject.Columns.InsObjectCode).IsEqualTo(objPatientExam.InsObjectCode);
                                    LInsuranceObject objInsuranceObject = q.ExecuteSingle<LInsuranceObject>();
                                    if (objInsuranceObject != null)
                                    {
                                        PtramBHYT = Utility.DecimaltoDbnull(objInsuranceObject.Percent, 0);
                                        decDiscountTotalMoney = v_decTotalPrice * (100 - Utility.DecimaltoDbnull(objInsuranceObject.Percent, 0)) / 100;
                                        log.Info("bat dau chi khau theo doi tuong muc tien =" + decDiscountTotalMoney + " cua benh nhan co ma Patient_Code=" + objPatientExam.PatientCode);
                                    }

                                }
                                else
                                {

                                    PtramBHYT = 100;
                                    decDiscountTotalMoney = 0;
                                    log.Info("Benh nhan dc mien phi hoan toan, voi muc chiet khau =0 tuong ung voi Patient_Code=" + objPatientExam.PatientCode);
                                }
                                break;
                            case "TW":
                                log.Info("Lấy thông tin của tuyến trung ương");
                                log.Info(string.Format("Neu ma benh nhan lon hon muc luong co ban={0} thi bat dau tinh gia", BusinessHelper.GetLuongCoBan()));
                                q = new Select().From(LInsuranceObject.Schema)
                                   .Where(LInsuranceObject.Columns.ObjectTypeId).IsEqualTo(objPatientExam.ObjectTypeId)
                                   .And(LInsuranceObject.Columns.InsObjectCode).IsEqualTo(objPatientExam.InsObjectCode);
                                LInsuranceObject objInsuranceObjectTW = q.ExecuteSingle<LInsuranceObject>();
                                if (objInsuranceObjectTW != null)
                                {
                                    PtramBHYT = Utility.DecimaltoDbnull(objInsuranceObjectTW.Percent, 0);
                                    decDiscountTotalMoney = v_decTotalPrice * (100 - Utility.DecimaltoDbnull(objInsuranceObjectTW.Percent, 0)) / 100;
                                    log.Info("bat dau chi khau theo doi tuong muc tien =" + decDiscountTotalMoney + " cua benh nhan co ma Patient_Code=" + objPatientExam.PatientCode);
                                }
                                break;
                            default:
                                if (v_decTotalPrice >= objPatientExam.SalaryBasic * 15 / 100)
                                {
                                    log.Info(string.Format("Neu ma benh nhan lon hon muc luong co ban={0} thi bat dau tinh gia", BusinessHelper.GetLuongCoBan()));
                                    q = new Select().From(LInsuranceObject.Schema)
                                       .Where(LInsuranceObject.Columns.ObjectTypeId).IsEqualTo(objPatientExam.ObjectTypeId)
                                       .And(LInsuranceObject.Columns.InsObjectCode).IsEqualTo(objPatientExam.InsObjectCode);
                                    LInsuranceObject objInsuranceObject = q.ExecuteSingle<LInsuranceObject>();
                                    if (objInsuranceObject != null)
                                    {
                                        PtramBHYT = Utility.DecimaltoDbnull(objInsuranceObject.Percent, 0);
                                        decDiscountTotalMoney = v_decTotalPrice * (100 - Utility.DecimaltoDbnull(objInsuranceObject.Percent, 0)) / 100;
                                        log.Info("bat dau chi khau theo doi tuong muc tien =" + decDiscountTotalMoney + " cua benh nhan co ma Patient_Code=" + objPatientExam.PatientCode);
                                    }

                                }
                                else
                                {

                                    PtramBHYT = 100;
                                    decDiscountTotalMoney = 0;
                                    log.Info("Benh nhan dc mien phi hoan toan, voi muc chiet khau =0 tuong ung voi Patient_Code=" + objPatientExam.PatientCode);
                                }
                                break;

                        }

                    }

                }
                else
                {
                    ///Nếu là đối tượng trái tuyến thực hiện lấy % của trái tuyến
                    LObjectType objObjectType = LObjectType.FetchByID(objPatientExam.ObjectTypeId);
                    if (objObjectType != null)
//.........这里部分代码省略.........
开发者ID:khaha2210,项目名称:VXIS,代码行数:101,代码来源:ThanhToanTaiQuay.cs


注:本文中的Select.ExecuteSingle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。