public DataTable GetTransferOut(string dtb, object from, object to, ref string sErr) { connect(); InitSPCommand(_strSPGetTransferOutName); AddParameter("DB", dtb); AddParameter("FROM", from); AddParameter("TO", to); DataTable list = new DataTable(); try { list = executeSelectSP(); } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(list); }
public CoreDAInfo Get( String DAG_ID, ref string sErr) { CoreDAInfo objEntr = new CoreDAInfo(); connect(); InitSPCommand(_strSPGetName); AddParameter(CoreDAInfo.Field.DAG_ID.ToString(), DAG_ID); DataTable list = new DataTable(); try { list = executeSelectSP(command); } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (list.Rows.Count > 0) { objEntr = (CoreDAInfo)GetDataFromDataRow(list, 0); } //if (dr != null) list = CBO.FillCollection(dr, ref list); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(objEntr); }
public DataTableCollection Get_Page(CoreDAInfo obj, string orderBy, int pageIndex, int pageSize, ref String sErr) { string whereClause = CreateWhereClause(obj); DataTableCollection dtList = null; connect(); InitSPCommand(_strSPGetPages); AddParameter("WhereClause", whereClause); AddParameter("OrderBy", orderBy); AddParameter("PageIndex", pageIndex); AddParameter("PageSize", pageSize); try { dtList = executeCollectSelectSP(); } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(dtList); }
public Boolean IsExist( String DAG_ID ) { connect(); InitSPCommand(_strSPIsExist); AddParameter(CoreDAInfo.Field.DAG_ID.ToString(), DAG_ID); string sErr = ""; DataTable list = new DataTable(); try { list = executeSelectSP(); } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } if (list.Rows.Count == 1) { return(true); } return(false); }
public string Delete( String DAG_ID ) { connect(); InitSPCommand(_strSPDeleteName); AddParameter(CoreDAInfo.Field.DAG_ID.ToString(), DAG_ID); string sErr = ""; try { excuteSPNonQuery(); } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(sErr); }
public string Update(CoreDAInfo objEntr) { connect(); InitSPCommand(_strSPUpdateName); AddParameter(CoreDAInfo.Field.DAG_ID.ToString(), objEntr.DAG_ID); AddParameter(CoreDAInfo.Field.NAME.ToString(), objEntr.NAME); AddParameter(CoreDAInfo.Field.EI.ToString(), objEntr.EI); string sErr = ""; try { excuteSPNonQuery(); } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(sErr); }
/// <summary> /// Return 1: Table is exist Identity Field /// Return 0: Table is not exist Identity Field /// Return -1: Erro /// </summary> /// <param name="tableName"></param> public Int32 Add(CoreDAInfo objEntr, ref string sErr) { int ret = -1; connect(); InitSPCommand(_strSPInsertName); AddParameter(CoreDAInfo.Field.DAG_ID.ToString(), objEntr.DAG_ID); AddParameter(CoreDAInfo.Field.NAME.ToString(), objEntr.NAME); AddParameter(CoreDAInfo.Field.EI.ToString(), objEntr.EI); try { //command.ExecuteNonQuery(); object tmp = executeSPScalar(); if (tmp != null && tmp != DBNull.Value) { ret = Convert.ToInt32(tmp); } else { ret = 0; } } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(ret); }
public string Update(CorePODInfo objEntr) { connect(); InitSPCommand(_strSPUpdateName); AddParameter(CorePODInfo.Field.USER_ID.ToString(), objEntr.USER_ID); AddParameter(CorePODInfo.Field.TB.ToString(), objEntr.TB); AddParameter(CorePODInfo.Field.USER_ID1.ToString(), objEntr.USER_ID1); AddParameter(CorePODInfo.Field.USER_NAME.ToString(), objEntr.USER_NAME); AddParameter(CorePODInfo.Field.DB_DEFAULT.ToString(), objEntr.DB_DEFAULT); AddParameter(CorePODInfo.Field.LANGUAGE.ToString(), objEntr.LANGUAGE); AddParameter(CorePODInfo.Field.ROLE_ID.ToString(), objEntr.ROLE_ID); AddParameter(CorePODInfo.Field.PASS.ToString(), objEntr.PASS); string sErr = ""; try { excuteSPNonQuery(); } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(sErr); }
/// <summary> /// Return 1: Table is exist Identity Field /// Return 0: Table is not exist Identity Field /// Return -1: Erro /// </summary> /// <param name="tableName"></param> public Int32 Add(CorePODInfo objEntr, ref string sErr) { int ret = -1; connect(); InitSPCommand(_strSPInsertName); AddParameter(CorePODInfo.Field.USER_ID.ToString(), objEntr.USER_ID); AddParameter(CorePODInfo.Field.TB.ToString(), objEntr.TB); AddParameter(CorePODInfo.Field.USER_ID1.ToString(), objEntr.USER_ID1); AddParameter(CorePODInfo.Field.USER_NAME.ToString(), objEntr.USER_NAME); AddParameter(CorePODInfo.Field.DB_DEFAULT.ToString(), objEntr.DB_DEFAULT); AddParameter(CorePODInfo.Field.LANGUAGE.ToString(), objEntr.LANGUAGE); AddParameter(CorePODInfo.Field.ROLE_ID.ToString(), objEntr.ROLE_ID); AddParameter(CorePODInfo.Field.PASS.ToString(), objEntr.PASS); try { //command.ExecuteNonQuery(); object tmp = executeSPScalar(); if (tmp != null && tmp != DBNull.Value) { ret = Convert.ToInt32(tmp); } else { ret = 0; } } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(ret); }
public DataTable GetAll( ref string sErr) { connect(); InitSPCommand(_strSPGetAllName); DataTable list = new DataTable(); try { list = executeSelectSP(); } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(list); }
public DataTable GetPermissionByRole(string role, ref string sErr) { connect(); InitSPCommand(_strSPGetPermissionByRoleName); AddParameter("ROLE_ID", role); DataTable list = new DataTable(); try { list = executeSelectSP(); } catch (Exception ex) { sErr = ex.Message; } disconnect(); if (sErr != "") { CoreErrorLog.SetLog(sErr); } return(list); }