当前位置: 首页>>代码示例>>C#>>正文


C# DB_OPT.Open方法代码示例

本文整理汇总了C#中SoMeTech.DataAccess.DB_OPT.Open方法的典型用法代码示例。如果您正苦于以下问题:C# DB_OPT.Open方法的具体用法?C# DB_OPT.Open怎么用?C# DB_OPT.Open使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SoMeTech.DataAccess.DB_OPT的用法示例。


在下文中一共展示了DB_OPT.Open方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:31,代码来源:UserBll.cs

示例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;
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:39,代码来源:OperationLogBll.cs

示例3: 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();
         }
     }
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:24,代码来源:OperationLogBll.cs

示例4: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     this.Master.LBTitle = "乡镇财政资金监管信息系统 - 查看操作日志";
     this.Master.strTitle = "查看操作日志";
     this.Master.TitlePic = "~/images/页标题/查看操作日志.jpg";
     this.Master.ButtonsPushDown = new ButtonsHandler(this.Buttons);
     if (!this.Page.IsPostBack)
     {
         if (this.Session["User"] != null)
         {
             if (base.Request.QueryString["PK"] == null)
             {
                 return;
             }
             DB_OPT dbo = null;
             try
             {
                 try
                 {
                     string userName = ((UserModel)this.Session["User"]).UserName;
                     string power = ((UserModel)this.Session["User"]).Power;
                     ButtonsModel model = new ButtonsModel(userName);
                     if (PowerClass.IfHasPower(userName, power, PowerNum.ServicesMessUpdate))
                     {
                         model.IfRefresh = true;
                         model.IfExit = true;
                         this.Master.btModel = model;
                         dbo = new DB_OPT();
                         dbo.Open();
                         this.SetValue(dbo);
                     }
                     else
                     {
                         Const.SorryForPower(this.Page);
                     }
                 }
                 catch (Exception exception)
                 {
                     new ExceptionLog.ExceptionLog { ErrClassName = base.GetType().ToString(), ErrMessage = exception.Message.ToString(), ErrMethod = "Page_Load()" }.WriteExceptionLog(true);
                     Const.OpenErrorPage("获取数据失败,请联系管理员!", this.Page);
                 }
                 return;
             }
             finally
             {
                 dbo.Close();
             }
         }
         Const.GoLoginPath_Open(this.Page);
     }
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:51,代码来源:OperationLogLook.aspx.cs

示例5: 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;
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:22,代码来源:UserBll.cs

示例6: 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;
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:20,代码来源:UserBll.cs

示例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;
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:21,代码来源:UserBll.cs

示例8: 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;
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:34,代码来源:UserBll.cs

示例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;
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:24,代码来源:UserBll.cs

示例10: 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;
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:21,代码来源:UserBll.cs

示例11: 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;
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:29,代码来源:UserBll.cs

示例12: btn_tb

 public static string btn_tb()
 {
     string str = "";
     StringBuilder builder = new StringBuilder();
     builder.Append("select distinct gsdm as PK_CORP,gsmc as Name,case len(gsdm) when 2 then 1 else 0 end as ISHASBABY,case len(gsdm) when 2 then 0 else 1 end as  Grade,substring(gsdm,1,2) as FatherPK,substring(gsdm,1,2)+'|' as PKPath,'0' as ZXBJ from PubGszl where kjnd=(select max(kjnd) from PubGszl)");
     builder.Append(" and gsdm in ");
     builder.Append(strSelectDW);
     builder.Append(" ; ");
     builder.Append("select gsdm as PK_CORP,kjnd,bmdm as BH,bmmc as Name from PUBBMXX where kjnd=(select max(kjnd) from PUBBMXX );");
     builder.Append(" and gsdm in ");
     builder.Append(strSelectDW);
     builder.Append(" ; ");
     builder.Append("select gsdm,kjnd,zydm,zyxm,bmdm from PUBZYXX  where kjnd=(select max(kjnd) from PUBZYXX );");
     builder.Append(" and gsdm in ");
     builder.Append(strSelectDW);
     builder.Append(" ; ");
     builder.Append("select ID,name as UserName,password,gsdm as PK_CORP from gl_CZY;");
     builder.Append(" and gsdm in ");
     builder.Append(strSelectDW);
     builder.Append(" ; ");
     DataSet set = DbHelperSQL.Query(builder.ToString());
     DB_OPT dbo = new DB_OPT();
     dbo.Open();
     if ((set == null) || (set.Tables.Count != 4))
     {
         return str;
     }
     DataTable table = set.Tables[0];
     for (int i = 0; i < table.Rows.Count; i++)
     {
         DataRow row = table.Rows[i];
         CompanyModel model = new CompanyDal
         {
             pk_corp = row["PK_CORP"].ToString(),
             Name = row["Name"].ToString(),
             IsHasBaby = row["ISHASBABY"].ToString(),
             Grade = Convert.ToInt32(row["Grade"].ToString()),
             FatherPK = row["FatherPK"].ToString(),
             PKPath = row["PKPath"].ToString(),
             ZXBJ = row["ZXBJ"].ToString()
         };
         builder = new StringBuilder();
         builder.Append("select * from DB_Company where pk_corp='");
         builder.Append(model.pk_corp);
         builder.Append("'");
         if (DbHelperOra.Exists(builder.ToString()))
         {
             builder = new StringBuilder();
             builder.Append("update Db_Company set IsHasBaby='");
             builder.Append(model.IsHasBaby);
             builder.Append("',Grade=");
             builder.Append(model.Grade);
             builder.Append(",FatherPK='");
             builder.Append(model.FatherPK);
             builder.Append("',PKPath='");
             builder.Append(model.PKPath);
             builder.Append("',ZXBJ='");
             builder.Append(model.ZXBJ);
             builder.Append("' where PK_CORP='");
             builder.Append(model.pk_corp);
             builder.Append("' ");
             DbHelperOra.ExecuteSql(builder.ToString());
         }
         else
         {
             builder = new StringBuilder();
             builder.Append("insert into Db_Company(pk_corp,Name,Ishasbaby,Grade,FatherPK,PKPath,ZXBJ) values('");
             builder.Append(model.pk_corp);
             builder.Append("','");
             builder.Append(model.Name);
             builder.Append("','");
             builder.Append(model.IsHasBaby);
             builder.Append("',");
             builder.Append(model.Grade);
             builder.Append(",'");
             builder.Append(model.FatherPK);
             builder.Append("','");
             builder.Append(model.PKPath);
             builder.Append("','");
             builder.Append(model.ZXBJ);
             builder.Append("')");
             DbHelperOra.ExecuteSql(builder.ToString());
             builder = new StringBuilder();
             builder.Append("insert into db_branch(BranchPK,BH,Name,ISHasbaby,grade,PK_CORP,ISJGBM) values (sys_Guid(),'D");
             builder.Append(model.pk_corp);
             builder.Append("01','");
             builder.Append(model.Name);
             builder.Append("默认部门',0,0,'");
             builder.Append(model.pk_corp);
             builder.Append("',0)");
             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);
//.........这里部分代码省略.........
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:101,代码来源:OnKeyTongBu.aspx.cs

示例13: 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 ";
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:50,代码来源:PublicDal.cs

示例14: 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 ";
 }
开发者ID:SoMeTech,项目名称:SoMeRegulatory,代码行数:49,代码来源:PublicDal.cs


注:本文中的SoMeTech.DataAccess.DB_OPT.Open方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。