本文整理汇总了C#中DBManager.CloseOleDB方法的典型用法代码示例。如果您正苦于以下问题:C# DBManager.CloseOleDB方法的具体用法?C# DBManager.CloseOleDB怎么用?C# DBManager.CloseOleDB使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBManager
的用法示例。
在下文中一共展示了DBManager.CloseOleDB方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMultiGroupUser
public static void AddMultiGroupUser(string userName, string password, string email, string userFirstName, string userLastName, string remarks, string groupIds)
{
string message;
string sErr = "";
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
if (remarks == null)
{
remarks = "";
}
if (userFirstName == null)
{
userFirstName = "";
}
if (userLastName == null)
{
userLastName = "";
}
try
{
Membership.CreateUser(userName, password, email);
string[] strArrays = new string[] { "exec spSysAddUserToGroups @GroupIds='", groupIds, "', @UserName='", userName, "'" };
string sql = string.Concat(strArrays);
db.executeNonQuery(sql, out sErr);
strArrays = new string[] { "exec spSysUpdateUserAdditionalData @UserName=", DBManager.quoteForDB(userName), ", @remarks=", DBManager.quoteForDB(remarks), ", @FirstName=", DBManager.quoteForDB(userFirstName), ", @LastName=", DBManager.quoteForDB(userLastName) };
sql = string.Concat(strArrays);
db.executeNonQuery(sql, out sErr);
db.CloseOleDB();
if (sErr != "")
{
message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת המשתמש נכשלה", sErr);
HttpContext.Current.Response.Write(message);
}
}
catch (MembershipCreateUserException membershipCreateUserException)
{
message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת המשתמש נכשלה", membershipCreateUserException.Message);
HttpContext.Current.Response.Write(message);
}
}
示例2: GetUserModuls
public static DataTable GetUserModuls(string userGroups, out string sErr)
{
sErr = "";
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
DataTable dt = new DataTable();
try
{
string sql = string.Concat("EXEC spGetUserModuls ", DBManager.quoteForDB(userGroups));
dt = db.getDataTable(sql, out sErr);
db.CloseOleDB();
}
catch (MembershipCreateUserException membershipCreateUserException)
{
sErr = membershipCreateUserException.Message;
}
return dt;
}
示例3: GetUserMenus
public static DataTable GetUserMenus(string lang, string menuId, string userName, out string sErr)
{
sErr = "";
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
DataTable dt = new DataTable();
try
{
string[] strArrays = new string[] { "EXEC spGetUserMenus ", DBManager.quoteForDB(lang), ",", menuId, ",", DBManager.quoteForDB(userName) };
dt = db.getDataTable(string.Concat(strArrays), out sErr);
db.CloseOleDB();
}
catch (MembershipCreateUserException membershipCreateUserException)
{
sErr = membershipCreateUserException.Message;
}
return dt;
}
示例4: GetUserGroups
public static DataTable GetUserGroups(string userName)
{
string sErr = "";
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
DataTable dt = new DataTable();
try
{
string sql = string.Concat("exec spSysGetUserGroups @UserName='", userName, "'");
dt = db.getDataTable(sql, out sErr);
db.CloseOleDB();
if (sErr != "")
{
HttpContext.Current.Response.Write(sErr);
}
}
catch (MembershipCreateUserException membershipCreateUserException)
{
HttpContext.Current.Response.Write(membershipCreateUserException.Message);
}
return dt;
}
示例5: CreateTableEntitySearchFields
public static Table CreateTableEntitySearchFields(DataTable oDT)
{
Table oTbl = new Table()
{
Width = Unit.Percentage(100),
ID = "SearchFiledsContainer",
CellPadding = 1,
CellSpacing = 0
};
TableRow oRow = null;
TableCell oCell = null;
for (int i = 0; i < oDT.Rows.Count; i++)
{
oRow = new TableRow();
oCell = new TableCell()
{
CssClass = "ContentStyle",
Width = Unit.Percentage(30),
Text = oDT.Rows[i]["FieldCaption"].ToString()
};
oRow.Cells.Add(oCell);
oCell = new TableCell()
{
Width = Unit.Percentage(70)
};
if (oDT.Rows[i]["ControlType"].ToString() == "combo")
{
DropDownList lst = new DropDownList()
{
ID = oDT.Rows[i]["FieldName"].ToString(),
Width = Unit.Pixel(155)
};
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
string sErr = string.Empty;
DataTable tblList = db.getDataTable(string.Concat("exec ", oDT.Rows[i]["ComboSource"].ToString()), out sErr);
db.CloseOleDB();
for (int j = 0; j < tblList.Rows.Count; j++)
{
lst.Items.Add(new ListItem(tblList.Rows[j][1].ToString(), tblList.Rows[j][0].ToString()));
}
lst.Attributes.Add("onchange", oDT.Rows[i]["ValidateFunc"].ToString());
oCell.Controls.Add(lst);
oRow.Cells.Add(oCell);
}
else if (oDT.Rows[i]["ControlType"].ToString() == "text")
{
TextBox oText = new TextBox()
{
Width = Unit.Pixel(155),
ID = oDT.Rows[i]["FieldName"].ToString()
};
JObject jo = new JObject();
JObject joContextKey = new JObject();
joContextKey["FrameName"] = oDT.Rows[i]["FrameName"].ToString();
joContextKey["FieldName"] = oDT.Rows[i]["FieldName"].ToString();
string strValidateFunc = oDT.Rows[i]["ValidateFunc"].ToString();
General.setContextKey(ref joContextKey, strValidateFunc);
jo.Add("contextKey", joContextKey);
jo.Add("methodUrl", VirtualPathUtility.ToAbsolute("~/Tools/EntitySearch.asmx/GetFieldComplition"));
jo.Add("minLength", 1);
oText.Attributes.Add("AC_Options", JsonConvert.SerializeObject(jo, Formatting.None));
oCell.Controls.Add(oText);
oRow.Cells.Add(oCell);
}
oTbl.Rows.Add(oRow);
}
return oTbl;
}
示例6: GetUsersListDataExtended
public static List<UserManager.UserData> GetUsersListDataExtended(string name_part, int group_id)
{
List<UserManager.UserData> users = new List<UserManager.UserData>();
string sErr = "";
string UserName = "";
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
try
{
string sql = string.Concat("exec spSysGetUsers @SearchString='", name_part, "',@GroupId=", group_id.ToString());
DataTable dt = db.getDataTable(sql, out sErr);
for (int i = 0; i < dt.Rows.Count; i++)
{
UserManager.UserData ud = new UserManager.UserData();
MembershipUser oUser = Membership.GetUser(dt.Rows[i]["UserName"].ToString());
UserName = dt.Rows[i]["UserName"].ToString();
ud.userName = dt.Rows[i]["UserName"].ToString();
ud.IsOnline = oUser.IsOnline;
ud.firstName = dt.Rows[i]["FirstName"].ToString();
ud.lastName = dt.Rows[i]["LastName"].ToString();
object day = oUser.LastLoginDate.Day;
object month = oUser.LastLoginDate.Month;
DateTime lastLoginDate = oUser.LastLoginDate;
ud.LastLoginDate = string.Format("{0:00}/{1:00}/{2:0000}", day, month, lastLoginDate.Year);
ud.Email = oUser.Email;
ud.Remarks = dt.Rows[i]["Comment"].ToString();
users.Add(ud);
}
db.CloseOleDB();
}
catch (Exception exception)
{
Exception ex = exception;
HttpContext.Current.Response.Write(string.Concat(ex.Message, " - Wrong data forUser:", UserName));
}
return users;
}
示例7: IsGroupPermissionExists
public static bool IsGroupPermissionExists(string name, string permission)
{
string message;
string sErr = "";
bool retVal = false;
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
try
{
string sql = string.Concat("exec spSysIsGroupPermissionExists @GroupName='", name, "', @Permission=", permission);
DataTable dt = db.getDataTable(sql, out sErr);
db.CloseOleDB();
if (sErr != "")
{
message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת קבוצה נכשלה", sErr);
HttpContext.Current.Response.Write(message);
}
retVal = (dt.Rows.Count <= 0 ? false : true);
}
catch (Exception exception)
{
message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת קבוצה נכשלה", exception.Message);
HttpContext.Current.Response.Write(message);
}
return retVal;
}
示例8: CreateNewGroup
public static void CreateNewGroup(string name, string permission)
{
string message;
string sErr = "";
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
try
{
string sql = string.Concat("exec spSysAddNewGroup @GroupName='", name, "', @Permission=", permission);
db.executeNonQuery(sql, out sErr);
db.CloseOleDB();
if (sErr != "")
{
message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת קבוצה נכשלה", sErr);
HttpContext.Current.Response.Write(message);
}
}
catch (Exception exception)
{
message = string.Format("<script>alert('{0}\\n\\n{1}')</script>", "הוספת קבוצה נכשלה", exception.Message);
HttpContext.Current.Response.Write(message);
}
}
示例9: DeleteSelectedUser
public static void DeleteSelectedUser(string userName)
{
string sErr = "";
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
try
{
string sql = string.Concat("exec spSysDeleteUser @UserName='", userName, "'");
db.getDataTable(sql, out sErr);
db.CloseOleDB();
if (sErr != "")
{
HttpContext.Current.Response.Write(sErr);
}
Membership.DeleteUser(userName, true);
}
catch (Exception exception)
{
HttpContext.Current.Response.Write(exception.Message);
}
}
示例10: InitApplicationTabs
public static DataTable InitApplicationTabs(string lang, string SubSystemIds, out string sErr)
{
DataTable oDT = null;
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
string strSQL = string.Format("exec spGetTabs '{0}', '{1}'", lang, SubSystemIds);
oDT = db.getDataTable(strSQL, out sErr);
db.CloseOleDB();
return oDT;
}
示例11: IsAppSessionExpired
public static bool IsAppSessionExpired(Page oPage)
{
string sErr = "";
oPage.Session["user_name"] = (oPage.User.Identity.IsAuthenticated ? oPage.User.Identity.Name : "Anonymous");
oPage.Session["user_name"] = oPage.Session["user_name"].ToString().Substring(oPage.Session["user_name"].ToString().IndexOf("\\") + 1);
oPage.Session["user_groups"] = General.GetUserGroups(oPage.Session["user_name"].ToString());
oPage.Session["AppSession"] = oPage.Session.SessionID;
oPage.Session["Direction"] = "rtl";
if (oPage.Request["lang"] == null)
{
oPage.Session["Language"] = "heb";
}
else
{
oPage.Session["Language"] = oPage.Request["lang"];
}
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
string sql = string.Concat("exec spSysGetUserByName @UserName='", oPage.Session["user_name"].ToString(), "'");
DataTable dt = db.getDataTable(sql, out sErr);
db.CloseOleDB();
if ((sErr != "" ? false : dt.Rows.Count > 0))
{
oPage.Session["EMAIL"] = dt.Rows[0]["EMAIL"].ToString();
oPage.Session["user_full_name"] = string.Concat(dt.Rows[0]["FirstName"].ToString(), " ", dt.Rows[0]["LastName"].ToString());
}
return false;
}
示例12: GetUserGroups
public static string GetUserGroups(string UserLogonName)
{
string UserGroupIDs = "";
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
string sErr = string.Empty;
DataTable tblList = db.getDataTable(string.Concat("exec spSysGetUserPermitedGroups '", UserLogonName, "'"), out sErr);
db.CloseOleDB();
for (int i = 0; i < tblList.Rows.Count; i++)
{
UserGroupIDs = (!(UserGroupIDs == "") ? string.Concat(UserGroupIDs, ",", tblList.Rows[i]["GroupId"].ToString()) : tblList.Rows[i]["GroupId"].ToString());
}
return UserGroupIDs;
}
示例13: GetPermitedSearches
public static List<int> GetPermitedSearches(string sGroups)
{
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
string sErr = string.Empty;
DataTable tblList = db.getDataTable(string.Concat("exec spGetPermitedSearches '", sGroups, "'"), out sErr);
db.CloseOleDB();
List<int> lstIDs = new List<int>();
for (int i = 0; i < tblList.Rows.Count; i++)
{
lstIDs.Add(int.Parse(tblList.Rows[i][0].ToString()));
}
return lstIDs;
}
示例14: GetApplicationHeaders
public static DataTable GetApplicationHeaders(string lang, string projectId, out string sErr)
{
DataTable oDT = null;
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
string strSQL = string.Format("exec spGetApplicationHeaders '{0}', '{1}'", lang, projectId);
oDT = db.getDataTable(strSQL, out sErr);
db.CloseOleDB();
return oDT;
}
示例15: GetUserPosition
public static string GetUserPosition(string userName)
{
string sErr = "";
string retVal = "";
DBManager db = new DBManager(ConfigurationManager.AppSettings["SYS_DSN"]);
DataTable dt = new DataTable();
try
{
string sql = string.Concat("exec spSysGetUserPosition @UserName='", userName, "'");
dt = db.getDataTable(sql, out sErr);
db.CloseOleDB();
if (sErr != "")
{
HttpContext.Current.Response.Write(sErr);
}
if (dt.Rows.Count > 0)
{
retVal = dt.Rows[0]["Position"].ToString();
}
}
catch (MembershipCreateUserException membershipCreateUserException)
{
HttpContext.Current.Response.Write(membershipCreateUserException.Message);
}
return retVal;
}