本文整理汇总了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 });
}
示例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();
}
}
示例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";
}
示例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;
}
示例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");
}
示例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();
}
示例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 }); // 操作类型
}
示例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();
}
}
示例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>("");
}
}
示例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");
}
}
示例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);
}
示例12: getRoutes
public static List<Route> getRoutes()
{
using (Database db = new PetaPoco.Database(ModelConfig.connectionStringName("bikes")))
{
return db.Fetch<Route>("WHERE deleted = FALSE");
}
}
示例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");
}
}
示例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); // 区域
}
示例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();
}