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


C# Database.Fetch方法代码示例

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


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

示例1: FrmNewCaseHis

        public FrmNewCaseHis(bool isAdd, Int64 base_id, Int64 reg_id)
        {
            InitializeComponent();

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");

            _reg_id = reg_id;
            _isAdd = isAdd;
            _baseID = base_id;

            //ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            //ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            //ruleNoEmpty.ErrorText = "该项不能为空。";
            //dxValidationProvider1.SetValidationRule(MEMOMemoEdit, ruleNoEmpty);
            //dxValidationProvider1.SetValidationRule(DOSE_MEMOMemoEdit, ruleNoEmpty);

            caseHis.REG_ID = _reg_id;
            caseHis.BASE_INFO_ID = _baseID;
            caseHis.OPERATOR = ClsFrmMng.WorkerID;
            cASEHISTORYBindingSource.DataSource = caseHis;

            lookUpEdit1.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 11 });
            lookUpEdit1.Properties.DisplayMember = "DSP_MEMBER";
            lookUpEdit1.Properties.ValueMember = "VALUE_MEMBER";

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 181 });
        }
开发者ID:hyblusea,项目名称:BloodInfo_MngPlatform,代码行数:28,代码来源:FrmNewCaseHis.cs

示例2: GetItem

 private void GetItem(string SuppBatchGuid)
 {
     List<V_ERP_SuppOrder> items = null;
     using (var db = new Database(SQLCONN.Conn))
     {
         if (!string.IsNullOrEmpty(UserName) && UserName != "admin")
         {
             items = db.Fetch<V_ERP_SuppOrder>("select * from V_ERP_SuppOrder where [email protected]  and SuppName [email protected]", SuppBatchGuid, UserName);
         }
         else
         {
             items = db.Fetch<V_ERP_SuppOrder>("select * from V_ERP_SuppOrder where [email protected]", SuppBatchGuid);
         }
         items.ForEach(j =>
         {
             j.Reserved2 = KyGYS.Controls.CommonUtil.GetItemImgFileName(j.Reserved2);
             j.CusSavedFileName = j.CusSavedFileName!=null?KyGYS.Controls.CommonUtil.GetItemImgFileName(j.CusSavedFileName):null;
             j.CtmSavedFileName = j.CtmSavedFileName != null ? KyGYS.Controls.CommonUtil.GetItemImgFileName(j.CtmSavedFileName) : null;
         });
         var grd = new EasyGridData<V_ERP_SuppOrder>();
         grd.total = items.Count().ToString();
         grd.rows = items;
         string data = Newtonsoft.Json.JsonConvert.SerializeObject(grd);
         Response.Write(data);
         Response.End();
     }
 }
开发者ID:Tyreezhang,项目名称:KSGYS,代码行数:27,代码来源:getItemList.aspx.cs

示例3: FrmNewDav

        /// <summary>
        /// 
        /// </summary>
        /// <param name="base_id"></param>
        /// <param name="reg_id"></param>
        /// <param name="isTemp">0:长期, 1:临时</param>
        public FrmNewDav(Int64 base_id, Int64 reg_id, int isTemp)
        {
            InitializeComponent();
            if (isTemp == 0)
                this.Text = "新建长期医嘱";
            else
                this.Text = "新建临时医嘱";

            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");

            _regID = reg_id;
            _baseID = base_id;
            _isTemp = isTemp;

            docAdv.REG_ID = _regID;
            docAdv.BASE_INFO_ID = _baseID;
            docAdv.OPERATOR = ClsFrmMng.WorkerID;
            docAdv.ADVICE_TYPE = _isTemp;
            docAdv.IS_DEL = 0;
            dOCADVICEBindingSource.DataSource = docAdv;

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("");

            M_UNITLookUpEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 14 });
            M_UNITLookUpEdit.Properties.DisplayMember = "DSP_MEMBER";
            M_UNITLookUpEdit.Properties.ValueMember = "VALUE_MEMBER";

            M_ACTIONLookUpEdit.Properties.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", new object[] { 13 });
            M_ACTIONLookUpEdit.Properties.DisplayMember = "DSP_MEMBER";
            M_ACTIONLookUpEdit.Properties.ValueMember = "VALUE_MEMBER";
        }
开发者ID:hyblusea,项目名称:BloodInfo_MngPlatform,代码行数:38,代码来源:FrmNewDav.cs

示例4: FrmNewRegist

        public FrmNewRegist()
        {
            InitializeComponent();
            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");

            //db.OpenSharedConnection();
            lstOutpatientCategory = db.Fetch<OUTPATIENT_CATEGORY>("");
            OUTPATIENT_CATEGORYTextEdit.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
            OUTPATIENT_CATEGORYTextEdit.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("CATEGORY_ID"));
            OUTPATIENT_CATEGORYTextEdit.Properties.Columns.Add(new DevExpress.XtraEditors.Controls.LookUpColumnInfo("CATEGORY_NAME"));
            OUTPATIENT_CATEGORYTextEdit.Properties.DataSource = lstOutpatientCategory;

            OUTPATIENT_CATEGORYTextEdit.Properties.ValueMember = "CATEGORY_ID";         // 对应ID
            OUTPATIENT_CATEGORYTextEdit.Properties.DisplayMember = "CATEGORY_NAME";     // 显示内容

            patientReg.STATUS = 0;
            patientReg.OPERATOR = ClsFrmMng.WorkerID;

            pATIENTREGISTBindingSource.DataSource = patientReg;
            //db.CloseSharedConnection();

            ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            ruleNoEmpty.ErrorText = "该项不能为空。";
            dxValidationProvider1.SetValidationRule(NAMETextEdit, ruleNoEmpty);
            dxValidationProvider1.SetValidationRule(OUTPATIENT_CATEGORYTextEdit, ruleNoEmpty);

            pATIENTBASEINFOBindingSource.DataSource = db.Fetch<PATIENT_BASEINFO>("");
            NAMETextEdit.Properties.EditValueChanged += Properties_EditValueChanged;
        }
开发者ID:hyblusea,项目名称:BloodInfo_MngPlatform,代码行数:31,代码来源:FrmNewRegist.cs

示例5: FrmEdtPath

        public FrmEdtPath(Int64 id)
        {
            InitializeComponent();
            //string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");
            _id = id;

            pathHis = db.Single<VASCULARPATH_HISTORY>("where ID = @0", _id);
            vASCULARPATHHISTORYBindingSource.DataSource = pathHis;

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where groupName = 193");
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where groupName = 194");
        }
开发者ID:hyblusea,项目名称:BloodInfo_MngPlatform,代码行数:13,代码来源:FrmEdtPath.cs

示例6: FrmNewBC_Consumable

        /// <summary>
        /// 
        /// </summary>
        /// <param name="base_id"></param>
        /// <param name="reg_id"></param>
        public FrmNewBC_Consumable(Int64 base_id, Int64 reg_id)
        {
            InitializeComponent();

            db = new Database("XE");

            _regID = reg_id;
            _baseID = base_id;

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("");
            vALUEGROUPBindingSource.DataSource = db.Fetch<VALUE_GROUP>("");
            LoadData();
        }
开发者ID:hyblusea,项目名称:BloodInfo_MngPlatform,代码行数:18,代码来源:FrmNewBC_Consumable.cs

示例7: FrmConsumOut_Comfirm

        List<CONSUMABLES_LOG1> _lst; // 日志表

        #endregion Fields

        #region Constructors

        public FrmConsumOut_Comfirm(List<CONSUMABLES_LOG1> lst, List<CONSUMABLES_LOG>  lst1)
        {
            InitializeComponent();

            ////string sPwd = Des.Decrypt(ClsFrmMng.KEY, ConfigurationManager.AppSettings["DbPwd"]);
            db = new Database("XE");

            _lst = lst;
            _consumLst = lst1;
            cONSUMABLESLOG1BindingSource.DataSource = lst;
            aCCOUNTBindingSource.DataSource = db.Fetch<ACCOUNT>("");
            vALUECODEBindingSource3.DataSource = db.Fetch<VALUE_CODE>("where groupName = @0", new object[] { 20 });     // 操作类型
        }
开发者ID:hyblusea,项目名称:BloodInfo_MngPlatform,代码行数:19,代码来源:FrmConsumOut_Comfirm.cs

示例8: barBtnRefresh_ItemClick

 void barBtnRefresh_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     using (var db = new Database()) {
         this.gridControlEx1.DataSource = db.Fetch<t_role>("select * from t_role where IsUsing=1");
         this.gridControlEx1.ReleaseFocusedRow();
     }
 }
开发者ID:MasterGao,项目名称:DevWinFormFrame,代码行数:7,代码来源:MainView.cs

示例9: getRides

        ////utility function to build the sql statement to perform the join
        //private static Sql sql()
        //{
        //    return Sql
        //        .Builder
        //        .Append("SELECT a.id, a.bike_id, a.rider_id, a.route_id, a.ride_date, a.notes,")
        //        .Append("a.reward, a.distance, a.paid, a.payment_id,")
        //        .Append("b.name AS route, c.name AS rider, d.name AS bike")
        //        .Append("FROM ride a, route b, rider c, bike d")
        //        .Append("WHERE a.route_id = b.id AND a.rider_id = c.id AND a.bike_id = d.id");
        //}

        public static List<Ride> getRides()
        {
            using (Database db = new PetaPoco.Database(ModelConfig.connectionStringName("bikes")))
            {
                return db.Fetch<Ride>("");
            }
        }
开发者ID:catflinger,项目名称:bikes,代码行数:19,代码来源:ride.cs

示例10: GetAllTopics

 private static List<Topic> GetAllTopics()
 {
     using (var db = new Database("umbracoDbDSN"))
     {
         return db.Fetch<Topic>("SELECT * FROM forumTopics WHERE isSpam = 1 ORDER BY id DESC");
     }
 }
开发者ID:joshbtn,项目名称:OurUmbraco,代码行数:7,代码来源:ForumSpamListTopics.ascx.cs

示例11: GetLeases

        public ActionResult GetLeases()
        {
            var db = new PetaPoco.Database("umbracoDbDSN");
            var listOfLeases = db.Fetch<Lease>(new Sql().Select("*").From("_sg_Lease"));

            return Json(listOfLeases);
        }
开发者ID:sebastienricher,项目名称:SectionG,代码行数:7,代码来源:MainSurfaceController.cs

示例12: getRoutes

     public static List<Route> getRoutes()
     {
         using (Database db = new PetaPoco.Database(ModelConfig.connectionStringName("bikes")))
         {
             return db.Fetch<Route>("WHERE deleted = FALSE");
         }
 }
开发者ID:catflinger,项目名称:bikes,代码行数:7,代码来源:route.cs

示例13: GetAllComments

 private static List<Comment> GetAllComments()
 {
     using (var db = new Database("umbracoDbDSN"))
     {
         return db.Fetch<Comment>("SELECT * FROM forumComments WHERE isSpam = 1 ORDER BY id DESC");
     }
 }
开发者ID:joshbtn,项目名称:OurUmbraco,代码行数:7,代码来源:ForumSpamListComments.ascx.cs

示例14: FrmNewLayout

        public FrmNewLayout()
        {
            InitializeComponent();
            db = new Database("XE");

            vALUECODEBindingSource.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 21);
            vALUECODEBindingSource1.DataSource = db.Fetch<VALUE_CODE>("where GROUPNAME = @0", 22);      // 区域

            mACHINELAYOUTBindingSource.DataSource = mach;

            ConditionValidationRule ruleNoEmpty = new ConditionValidationRule();
            ruleNoEmpty.ConditionOperator = ConditionOperator.IsNotBlank;
            ruleNoEmpty.ErrorText = "该项不能为空。";
            dxValidationProvider1.SetValidationRule(FLOORIDTextEdit, ruleNoEmpty);                  // 楼层
            dxValidationProvider1.SetValidationRule(AREAIDTextEdit, ruleNoEmpty);                   // 区域
        }
开发者ID:hyblusea,项目名称:BloodInfo_MngPlatform,代码行数:16,代码来源:FrmNewLayout.cs

示例15: Index

 public ActionResult Index(int page = 1)
 {
     var db = new PetaPoco.Database("MonoCMS");
     var categories = db.Fetch<Category>("SELECT category_name FROM category");
     return View(categories);
     //return View();
 }
开发者ID:manoj-malviya,项目名称:monocms,代码行数:7,代码来源:CategoryController.cs


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