DataTable Select(BaseDataContract entity, List <string> lstFields, List <string> lstCols, string opSign, List <string> lstSortCols) { using (BizEntityFactory biz = new BizEntityFactory()) { return(biz.Select(entity, lstFields, lstCols, opSign, lstSortCols)); } }
/// <summary> /// 通过更新列、条件列 Dictionary -3 /// </summary> /// <param name="entity"></param> /// <param name="lstSet"></param> /// <param name="lstWhere"></param> /// <returns></returns> public int UpdateByParm(BaseDataContract entity, List <Dictionary <string, object> > lstSet, List <Dictionary <string, object> > lstWhere) { using (BizEntityFactory biz = new BizEntityFactory()) { return(biz.UpdateByParm(entity, lstSet, lstWhere)); } }
/// <summary> /// 全表查询 /// </summary> /// <param name="entity"></param> /// <returns></returns> public DataTable SelectFullTable(BaseDataContract entity) { using (BizEntityFactory biz = new BizEntityFactory()) { return(biz.SelectFullTable(entity)); } }
/// <summary> /// 根据主键更新-3 /// </summary> /// <param name="entityNew"></param> /// <param name="entityOrg"></param> /// <returns></returns> public int UpdateByPk(BaseDataContract entityNew, BaseDataContract entityOrg) { return(UpdateByPk(new List <BaseDataContract> { entityNew }, new List <BaseDataContract> { entityOrg })); }
/// <summary> /// 通过更新列、条件列 Dictionary -1 /// </summary> /// <param name="entity"></param> /// <param name="dicSet"></param> /// <param name="dicWhere"></param> /// <returns></returns> public int UpdateByParm(BaseDataContract entity, Dictionary <string, object> dicSet, Dictionary <string, object> dicWhere) { return(UpdateByParm(entity, new List <Dictionary <string, object> > { dicSet }, new List <Dictionary <string, object> > { dicWhere })); }
/// <summary> /// 根据条件删除-1 /// </summary> /// <param name="entity"></param> /// <param name="where"></param> /// <returns></returns> public int DeleteByParm(BaseDataContract entity, string where) { return(DeleteByParm(new List <BaseDataContract> { entity }, new List <string> { where })); }
/// <summary> /// 通过更新列、条件列 Dictionary -2 /// </summary> /// <param name="entity"></param> /// <param name="dicSet"></param> /// <param name="lstWhere"></param> /// <returns></returns> public int UpdateByParm(BaseDataContract entity, Dictionary <string, object> dicSet, List <Dictionary <string, object> > lstWhere) { List <Dictionary <string, object> > lstTmp = new List <Dictionary <string, object> >(); for (int i = 0; i < lstWhere.Count; i++) { lstTmp.Add(Function.CloneByBinary(dicSet) as Dictionary <string, object>); } return(UpdateByParm(entity, lstTmp, lstWhere)); }
/// <summary> /// 查询:按列、排序、值等否 /// </summary> /// <param name="entity"></param> /// <param name="lstFields"></param> /// <param name="lstCols"></param> /// <param name="opSign"></param> /// <param name="lstSortCols"></param> /// <returns></returns> internal DataTable Select(BaseDataContract entity, List <string> lstFields, List <string> lstCols, string opSign, List <string> lstSortCols) { DataTable dt = null; SqlHelper svc = null; try { svc = new SqlHelper(EnumBiz.onlineDB); dt = svc.Select(entity, lstFields, lstCols, opSign, lstSortCols); } catch (Exception ex) { ExceptionLog.OutPutException(Function.GetExceptionCaption(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message)); } finally { svc = null; } return(dt); }
/// <summary> /// 全表查询 /// </summary> /// <param name="entity"></param> /// <returns></returns> public DataTable SelectFullTable(BaseDataContract entity) { DataTable dt = null; SqlHelper svc = null; try { svc = new SqlHelper(EnumBiz.onlineDB); dt = svc.Select(entity); } catch (Exception ex) { ExceptionLog.OutPutException(Function.GetExceptionCaption(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message)); } finally { svc = null; } return(dt); }
/// <summary> /// 选择行 /// </summary> /// <param name="isTab"></param> private void SelectedRow(bool isTab) { BaseDataContract dr = (isTrigger ? CurrentDataContract : CurrentData()); if (dr == null) { return; } if (string.IsNullOrEmpty(Properties.ValueColumn)) { DialogBox.Msg("请指定数据列-ValueColumn.", MessageBoxIcon.Exclamation); return; } if (string.IsNullOrEmpty(Properties.DisplayColumn)) { DialogBox.Msg("请指定显示列-DisplayColumn.", MessageBoxIcon.Exclamation); return; } ValueChanged = true; CellValueChanged = true; Properties.DBValue = EntityTools.GetFieldValue(dr, Properties.ValueColumn).ToString(); Properties.DBRow = dr; Properties.DisplayValue = EntityTools.GetFieldValue(dr, Properties.DisplayColumn).ToString(); this.Text = Properties.DisplayValue; Properties.DBValueChanged(this); this.DBValueChanged(this); this.SelectionStart = this.Text.Length; ClosePopup(); TextChanged = false; ValueChanged = false; if (isTab) { MoveNextControl(); } if (this.IsExistsGroup) { ExpandRows(); } this.Focus(); }
/// <summary> /// 通过更新列、条件列 Dictionary /// </summary> /// <param name="entity"></param> /// <param name="lstSet"></param> /// <param name="lstWhere"></param> /// <returns></returns> public int UpdateByParm(BaseDataContract entity, List <Dictionary <string, object> > lstSet, List <Dictionary <string, object> > lstWhere) { int intRet = 0; SqlHelper svc = null; try { svc = new SqlHelper(EnumBiz.onlineDB); intRet = svc.Commit(svc.GetUpdateParm(entity, lstSet, lstWhere)); } catch (Exception ex) { intRet = -1; ExceptionLog.OutPutException(Function.GetExceptionCaption(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message)); } finally { svc = null; } return(intRet); }
public DataTable Select(BaseDataContract entity, List <string> lstFields, List <string> lstCols, List <string> lstSorts) { return(Select(entity, lstFields, lstCols, string.Empty, lstSorts)); }
public DataTable Select(BaseDataContract entity, List <string> lstCols, string opSign, List <string> lstSorts) { return(Select(entity, null, lstCols, opSign, lstSorts)); }
public DataTable Select(BaseDataContract entity, List <string> lstCols) { return(Select(entity, null, lstCols, string.Empty, null)); }
/// <summary> /// 根据主键查询-2 /// </summary> /// <param name="entity"></param> /// <param name="lstFields"></param> /// <returns></returns> public DataTable SelectByPk(BaseDataContract entity, List <string> lstFields) { return(SelectByPk(new List <BaseDataContract> { entity }, lstFields)); }
/// <summary> /// 根据主键查询-1 /// </summary> /// <param name="entity"></param> /// <returns></returns> public DataTable SelectByPk(BaseDataContract entity) { return(SelectByPk(entity, null)); }
public DataTable SelectFields(BaseDataContract entity, List <string> lstFields) { return(Select(entity, lstFields, null, string.Empty, null)); }
/// <summary> /// 插入.单条 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int Insert(BaseDataContract entity) { return(Insert(new List <BaseDataContract> { entity })); }
/// <summary> /// 根据主键删除 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int DeleteByPk(BaseDataContract entity) { return(DeleteByPk(new List <BaseDataContract> { entity })); }
/// <summary> /// FillRowValueByDBRow /// </summary> /// <param name="DBRow"></param> protected virtual void FillRowValueByDBRow(BaseDataContract DBRow) { }
/// <summary> /// 根据条件删除-3 /// </summary> /// <param name="entity"></param> /// <param name="lstWhere"></param> /// <returns></returns> public int DeleteByParm(BaseDataContract entity, List <string> lstWhere) { return(DeleteByParm(new List <BaseDataContract> { entity }, lstWhere)); }
protected virtual void FillRowValueByDBRow(GridView gv, BaseDataContract DBRow) { }
/// <summary> /// 根据主键更新-1 /// </summary> /// <param name="entity"></param> /// <returns></returns> public int UpdateByPk(BaseDataContract entity) { return(UpdateByPk(new List <BaseDataContract> { entity })); }