本文整理汇总了C#中SoMeTech.DataAccess.DB_OPT.Close方法的典型用法代码示例。如果您正苦于以下问题:C# DB_OPT.Close方法的具体用法?C# DB_OPT.Close怎么用?C# DB_OPT.Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoMeTech.DataAccess.DB_OPT
的用法示例。
在下文中一共展示了DB_OPT.Close方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetUserCompany
public static string GetUserCompany(string username)
{
string str = "false";
DB_OPT dbo = null;
try
{
dbo = new DB_OPT();
dbo.Open();
string str2 = "";
UserDal.GetCompanyPK(username.Trim(), ref str2, dbo);
if (str2 != "")
{
string ccode = "";
string cname = "";
CompanyDal.GetCompanyName(str2, ref ccode, ref cname, dbo);
str = ccode + "," + cname;
}
}
catch (Exception exception)
{
new ExceptionLog.ExceptionLog { ErrClassName = "UserBll", ErrMessage = exception.Message.ToString(), ErrMethod = "GetUserCompany()" }.WriteExceptionLog(true);
}
finally
{
if (dbo != null)
{
dbo.Close();
}
}
return str;
}
示例2: insertOp
public static int insertOp(string opType, string Business, string Content, string ifPass, Page page)
{
int num = 0;
DB_OPT dbo = null;
try
{
OperationLogModel model = new OperationLogDal();
dbo = new DB_OPT();
dbo.Open();
string userName = "";
if (((UserModel) HttpContext.Current.Session["user"]).TrueName == "")
{
userName = ((UserModel) HttpContext.Current.Session["user"]).UserName;
}
else
{
userName = ((UserModel) HttpContext.Current.Session["user"]).TrueName;
}
model.UserName = userName;
model.opType = opType;
model.Business = Business;
model.Content = Content;
model.ifPass = ifPass;
num = model.Add(dbo);
}
catch (Exception exception)
{
new ExceptionLog.ExceptionLog { ErrClassName = "OperationLogBll", ErrMessage = exception.Message.ToString(), ErrMethod = "insertOp()" }.WriteExceptionLog(true);
Const.OpenErrorPage("操作失败,请联系管理员!", page);
}
finally
{
if (dbo != null)
{
dbo.Close();
}
}
return num;
}
示例3: TryCon
public static bool TryCon(string strCon)
{
bool flag = false;
DB_OPT db_opt = null;
try
{
db_opt = new DB_OPT();
db_opt.OpenTest(strCon);
flag = true;
}
catch (Exception exception)
{
new ExceptionLog.ExceptionLog { ErrClassName = "EIP_User.Login", ErrMessage = exception.Message.ToString(), ErrMethod = "TryCon()" }.WriteExceptionLog(true);
}
finally
{
if (db_opt != null)
{
db_opt.Close();
}
}
return flag;
}
示例4: deleteOp
public static void deleteOp(string pk, Page page)
{
DB_OPT db = null;
try
{
OperationLogModel model = new OperationLogDal();
db = new DB_OPT();
db.Open();
model.pk = pk;
model.Delete(db);
}
catch (Exception exception)
{
new ExceptionLog.ExceptionLog { ErrClassName = "OperationLogBll", ErrMessage = exception.Message.ToString(), ErrMethod = "deleteOp()" }.WriteExceptionLog(true);
Const.OpenErrorPage("操作失败,请联系管理员!", page);
}
finally
{
if (db != null)
{
db.Close();
}
}
}
示例5: IsPower
private void IsPower()
{
DB_OPT dbo = new DB_OPT();
try
{
UserModel model = new UserDal
{
UserName = ((UserModel)HttpContext.Current.Session["User"]).UserName
};
model.GetModel(dbo);
string[] strArray = model.CompanyPower.Split(new char[] { '|' });
for (int i = 0; i < strArray.Length; i++)
{
strArray[i].Trim();
}
}
catch (Exception)
{
}
finally
{
dbo.Close();
}
}
示例6: ChangePwd
public int ChangePwd(string struser, string strpwd, string strOpwd)
{
int num;
UserModel model = new UserDal();
DB_OPT dbo = new DB_OPT();
try
{
dbo.Open();
model.UserName = struser;
model.Password = QxRoom.QxConst.QxConst.Encrypt(strOpwd, "powerich");
num = model.UpdatePwd(strpwd, dbo);
}
catch (Exception exception)
{
throw exception;
}
finally
{
dbo.Close();
}
return num;
}
示例7: UserName
public DataSet UserName(string struser)
{
DataSet list;
UserModel model = new UserDal();
DB_OPT dbo = new DB_OPT();
try
{
dbo.Open();
model.UserPK = struser;
list = model.GetList(" UserPK='" + model.UserPK + "'", dbo);
}
catch (Exception exception)
{
throw exception;
}
finally
{
dbo.Close();
}
return list;
}
示例8: userinfo
public DataSet userinfo(string strwhere)
{
DataSet listAll;
UserModel model = new UserDal();
DB_OPT dbo = new DB_OPT();
try
{
dbo.Open();
listAll = model.GetListAll(strwhere, dbo);
}
catch (Exception exception)
{
throw exception;
}
finally
{
dbo.Close();
}
return listAll;
}
示例9: Updateuserinfo
public int Updateuserinfo(string strUser, string power, string strname, string pk_corp)
{
int num;
UserModel model = new UserDal();
DB_OPT dbo = new DB_OPT();
try
{
dbo.Open();
model.EmployeePK = strUser;
model.UserName = strname;
model.Power = power;
model.pk_corp = pk_corp;
num = model.Update(UserUpdatePowerType.BranchAndRole, UserUpdateIndex.AllowEmployeePK, dbo);
}
catch (Exception exception)
{
throw exception;
}
finally
{
dbo.Close();
}
return num;
}
示例10: Login
public UserModel Login(string struser)
{
UserModel model;
UserModel model2 = new UserDal();
DB_OPT dbo = new DB_OPT();
try
{
dbo.Open();
model2.UserName = struser;
model2.Login(dbo);
ConfigurationModel model3 = new ConfigurationDal().GetModel(dbo);
if (model3 != null)
{
HttpContext.Current.Response.Cookies["ischangelist"].Value = model3.ISCHANGELIST;
HttpContext.Current.Session["common"] = model3;
if (model3.ErrMessPath != "")
{
ExceptionLog.ExceptionLog log = new ExceptionLog.ExceptionLog {
LogFilePath = model3.ErrMessPath
};
}
}
model = model2;
}
catch (Exception exception)
{
throw exception;
}
finally
{
dbo.Close();
}
return model;
}
示例11: IsHaveData
public int IsHaveData(string emppk)
{
int num;
UserModel model = new UserDal();
DB_OPT dbo = new DB_OPT();
try
{
dbo.Open();
model.EmployeePK = emppk;
num = model.ExistsByEmpPK(dbo);
}
catch (Exception exception)
{
throw exception;
}
finally
{
dbo.Close();
}
return num;
}
示例12: deleteuserinfo
public string deleteuserinfo(string strUser, Page page)
{
string str2;
string str = "";
UserModel model = new UserDal();
DB_OPT dbo = new DB_OPT();
try
{
dbo.Open();
model.UserPK = strUser;
model.GetModel(dbo);
if (model.UserName == "admin")
{
return "admin";
}
model.Delete(dbo);
OperationLogBll.insertOp("删除", "用户列表", "删除 " + model.cName + " 单位, " + model.bName + "部门下用户名为:" + model.UserName + " 真实姓名为:" + model.TrueName + " 的用户", "Y", page);
str2 = str;
}
catch (Exception exception)
{
throw exception;
}
finally
{
dbo.Close();
}
return str2;
}
示例13: btn_tb
//.........这里部分代码省略.........
DbHelperOra.ExecuteSql(builder.ToString());
builder = new StringBuilder();
builder.Append("insert into db_role(RolePK,BH,Name,Power,ServicesPower,ISUserPower,Grade,BranchPK,PK_CORP )");
builder.Append("select sys_guid(),'R");
builder.Append(model.pk_corp);
builder.Append("01','");
builder.Append(model.Name);
builder.Append("默认角色',");
builder.Append("Power,ServicesPower,ISUserPower,Grade,(select BranchPK from Db_Branch where BH='D");
builder.Append(model.pk_corp);
builder.Append("01' and Rownum=1),'");
builder.Append(model.pk_corp);
builder.Append("' from db_role t where BH='R000000' ");
DbHelperOra.ExecuteSql(builder.ToString());
}
}
table = set.Tables[1];
for (int j = 0; j < table.Rows.Count; j++)
{
DataRow row2 = table.Rows[j];
BranchModel model2 = new BranchDal
{
BH = row2["BH"].ToString(),
Name = row2["Name"].ToString(),
pk_corp = row2["PK_CORP"].ToString()
};
if (model2.Exists(model2.BH, dbo) > 0)
{
model2.Update(dbo);
}
else
{
model2.Add(dbo);
}
}
table = set.Tables[3];
for (int k = 0; k < table.Rows.Count; k++)
{
DataRow row3 = table.Rows[k];
UserModel model3 = new UserDal
{
UserName = row3["UserName"].ToString().Trim(),
TrueName = row3["UserName"].ToString(),
Password = QxRoom.QxConst.QxConst.Encrypt(row3["password"].ToString(), "powerich")
};
if (string.IsNullOrEmpty(row3["PK_CORP"].ToString()))
{
model3.pk_corp = "01";
}
else
{
model3.pk_corp = row3["PK_CORP"].ToString();
}
if (model3.ExistsByUserName(dbo) > 0)
{
builder = new StringBuilder();
builder.Append("update DB_Users set Password ='");
builder.Append(model3.Password);
builder.Append("' , PK_Corp='");
builder.Append(model3.pk_corp);
builder.Append("' , TrueName='");
builder.Append(model3.UserName);
builder.Append("' where UserName='");
builder.Append(model3.UserName);
builder.Append("'");
DbHelperOra.ExecuteSql(builder.ToString());
}
else
{
builder = new StringBuilder();
builder.Append("insert into Db_Users(UserName,TrueName,Password,pk_corp,BranchPK,RolePK) values('");
builder.Append(model3.UserName);
builder.Append("','");
builder.Append(model3.UserName);
builder.Append("','");
builder.Append(model3.Password);
builder.Append("','");
builder.Append(model3.pk_corp);
builder.Append("',(select BranchPK from Db_Branch where BH='D");
builder.Append(model3.pk_corp);
builder.Append("01' and Rownum=1),(SELECT rolepk FROM db_role WHERE BH='R");
builder.Append(model3.pk_corp);
builder.Append("01' and Rownum=1))");
DbHelperOra.ExecuteSql(builder.ToString());
builder = new StringBuilder();
builder.Append("update db_users a set (a.Power, a.servicespower)= (select b.Power, b.servicespower from Db_Role b where a.RolePK=b.RolePK) where length(a.pk_corp)<=4");
DbHelperOra.ExecuteSql(builder.ToString());
}
}
dbo.Close();
StringBuilder builder2 = new StringBuilder();
builder2.Append("已成功同步乡财县管系统的基础数据! 本次共同步【单位数据】:");
builder2.Append(set.Tables[0].Rows.Count);
builder2.Append(" 条;【部门数据】:");
builder2.Append(set.Tables[1].Rows.Count);
builder2.Append(" 条;【人员数据】:");
builder2.Append(set.Tables[3].Rows.Count);
builder2.Append(" 条");
return builder2.ToString();
}
示例14: GetCompanyWhereZB
public static string GetCompanyWhereZB()
{
UserModel model = (UserModel) HttpContext.Current.Session["User"];
string str = model.Company.pk_corp;
string str2 = "";
if ((str != null) && (str.Trim() != ""))
{
DB_OPT dbo = new DB_OPT();
try
{
try
{
dbo.Open();
UserModel model2 = new UserDal {
UserName = model.UserName
};
model2.GetModel(dbo);
string[] strArray = model2.CompanyPower.Split(new char[] { '|' });
string str3 = "";
for (int i = 0; i < strArray.Length; i++)
{
str3 = str3 + strArray[i].Trim();
if (i < (strArray.Length - 1))
{
str3 = str3 + "','";
}
}
if (str3 != "")
{
str3 = "'" + str3 + "'";
return (" and ((trim(PD_QUOTA_INPUT_DEPART)='" + model.Branch.BH.Trim() + "' and trim(PD_QUOTA_INPUT_COMPANY)='" + str.Trim() + "') or trim(PD_QUOTA_DEPART) in (" + str3 + ") or (pd_quota_isup=1 and IF_SHOW=1 and company_code='" + str.Trim() + "'))");
}
return (" and ((trim(PD_QUOTA_INPUT_DEPART)='" + model.Branch.BH.Trim() + "' and trim(PD_QUOTA_INPUT_COMPANY)='" + str.Trim() + "') or (pd_quota_isup=1 and IF_SHOW=1 and company_code='" + str.Trim() + "'))");
}
catch (Exception)
{
str2 = " and 1=0 ";
}
return str2;
}
finally
{
if (dbo != null)
{
dbo.Close();
}
}
}
return " and 1=0 ";
}
示例15: GetCompanyWhere
public static string GetCompanyWhere()
{
string str = HttpContext.Current.Session["pk_corp"].ToString();
string str2 = "";
if ((str != null) && (str.Trim() != ""))
{
DB_OPT dbo = new DB_OPT();
try
{
try
{
dbo.Open();
UserModel model = new UserDal {
UserName = ((UserModel) HttpContext.Current.Session["User"]).UserName
};
model.GetModel(dbo);
string[] strArray = model.CompanyPower.Split(new char[] { '|' });
string str3 = "";
for (int i = 0; i < strArray.Length; i++)
{
str3 = str3 + strArray[i].Trim();
if (i < (strArray.Length - 1))
{
str3 = str3 + "','";
}
}
if (str3 != "")
{
str3 = "'" + str3 + "'";
return (" and (trim(PD_PROJECT_INPUT_COMPANY) like '" + str.Trim() + "%' and trim(PD_PROJECT_INPUT_COMPANY) in (" + str3 + "))");
}
return " and 1=0";
}
catch (Exception)
{
str2 = " and 1=0 ";
}
return str2;
}
finally
{
if (dbo != null)
{
dbo.Close();
}
}
}
return " and 1=0 ";
}