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


C# DbConn.ExecuteSql方法代码示例

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


在下文中一共展示了DbConn.ExecuteSql方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Add

        /// <summary>
        /// createtime expiresetime不用传。
        /// </summary>
        /// <param name="PubConn"></param>
        /// <param name="model"></param>
        /// <param name="tokentype"></param>
        /// <returns></returns>
        public virtual bool Add(DbConn PubConn, DbModels.tb_token model, Models.DbModels.TokenType tokentype)
        {
            DateTime nowtime = PubConn.GetServerDate();
            model.createtime = nowtime;
            model.expires = nowtime.AddMinutes(GetExpiresminutes(tokentype));
            List<ProcedureParameter> Par = new List<ProcedureParameter>()
                {

                    //
                    new ProcedureParameter("@token",    model.token),
                    //
                    new ProcedureParameter("@userid",    model.userid),
                    new ProcedureParameter("@id",    model.id),
                    //
                    new ProcedureParameter("@username",    model.username),
                    //
                    new ProcedureParameter("@appid",    model.appid),
                    //
                    new ProcedureParameter("@createtime",   model.createtime),
                    //
                    new ProcedureParameter("@expires", model.expires  )
                };
            int rev = PubConn.ExecuteSql("insert into " + tokentype.ToString() + " (token,userid,id,username,appid,createtime,expires)" +
                                         "  values(@token,@userid,@id,@username,@appid,@createtime,@expires)", Par);
            return rev == 1;
        }
开发者ID:buweixiaomi,项目名称:DydCert,代码行数:33,代码来源:TokenDal.cs

示例2: Add

        public virtual bool Add(DbConn PubConn, tb_user_model model)
        {

            List<ProcedureParameter> Par = new List<ProcedureParameter>()
                {
					
					//员工工号
					new ProcedureParameter("@userstaffno",    model.userstaffno),
					//
					new ProcedureParameter("@username",    model.username),
					//员工角色,查看代码枚举:开发人员,管理员
					new ProcedureParameter("@userrole",    model.userrole),
					//
					new ProcedureParameter("@usercreatetime",    model.usercreatetime),
					//员工手机号码
					new ProcedureParameter("@usertel",    model.usertel),
					//
					new ProcedureParameter("@useremail",    model.useremail),
					//登录密码
					new ProcedureParameter("@userpsw",    model.userpsw)  
                };
            int rev = PubConn.ExecuteSql(@"insert into tb_user(userstaffno,username,userrole,usercreatetime,usertel,useremail,userpsw)
										   values(@userstaffno,@username,@userrole,@usercreatetime,@usertel,@useremail,@userpsw)", Par);
            return rev == 1;

        }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:26,代码来源:tb_user_dal.cs

示例3: Add2

        public virtual bool Add2(DbConn PubConn, tb_producter_model model)
        {
            return SqlHelper.Visit((ps) =>
            {
                List<ProcedureParameter> Par = new List<ProcedureParameter>()
                {

                    //��������ʱid(�����������Ψһ,Guidתlong)
                    new ProcedureParameter("@tempid",    model.tempid),
                    //����������
                    new ProcedureParameter("@productername",    model.productername),
                    //ip��ַ
                    new ProcedureParameter("@ip",    model.ip),
                    //����id
                    new ProcedureParameter("@mqpathid",    model.mqpathid),
                    ////�������������ʱ��
                    //new ProcedureParameter("@lastheartbeat",    model.lastheartbeat),
                    ////�����ߴ���ʱ��
                    //new ProcedureParameter("@createtime",    model.createtime)
                };
                int rev = PubConn.ExecuteSql(@"insert into tb_producter(tempid,productername,ip,mqpathid,lastheartbeat,createtime)
                                           values(@tempid,@productername,@ip,@mqpathid,getdate(),getdate())", Par);
                return rev == 1;
            });
        }
开发者ID:xwx2015,项目名称:MQ,代码行数:25,代码来源:tb_producter_dal.cs

示例4: Add2

        public virtual bool Add2(DbConn PubConn, tb_consumer_model model)
        {
            return SqlHelper.Visit((ps) =>
            {
                List<ProcedureParameter> Par = new List<ProcedureParameter>()
                    {

                        //��������ʱid(�����������Ψһ,Guidתlong)
                        new ProcedureParameter("@tempid",    model.tempid),
                        //������clinet��id
                        new ProcedureParameter("@consumerclientid",    model.consumerclientid),
                        //֧�ֵķ���˳���(֧�ֶ��˳���)
                        new ProcedureParameter("@partitionindexs",    model.partitionindexs),
                        //�ͻ�������
                        new ProcedureParameter("@clientname",    model.clientname),
                        ////�������ʱ��(�Ե�ǰ��ʱ��Ϊ׼)
                        //new ProcedureParameter("@lastheartbeat",    model.lastheartbeat),
                        ////��һ�θ���ʱ��(�Ե�ǰ��ʱ��Ϊ׼)
                        //new ProcedureParameter("@lastupdatetime",    model.lastupdatetime),
                        ////�ͻ��˴���ʱ��(�Ե�ǰ��ʱ��Ϊ׼)
                        //new ProcedureParameter("@createtime",    model.createtime)
                    };
                int rev = PubConn.ExecuteSql(@"insert into tb_consumer(tempid,consumerclientid,partitionindexs,clientname,lastheartbeat,lastupdatetime,createtime)
                                               values(@tempid,@consumerclientid,@partitionindexs,@clientname,getdate(),getdate(),getdate())", Par);
                return rev == 1;
            });
        }
开发者ID:xwx2015,项目名称:MQ,代码行数:27,代码来源:tb_consumer_dal.cs

示例5: Edit

        public virtual bool Edit(DbConn PubConn, tb_user_model model)
        {
            List<ProcedureParameter> Par = new List<ProcedureParameter>()
            {
                    
					//员工工号
					new ProcedureParameter("@userstaffno",    model.userstaffno),
					//
					new ProcedureParameter("@username",    model.username),
					//员工角色,查看代码枚举:开发人员,管理员
					new ProcedureParameter("@userrole",    model.userrole),
					//
					new ProcedureParameter("@usercreatetime",    model.usercreatetime),
					//员工手机号码
					new ProcedureParameter("@usertel",    model.usertel),
					//
					new ProcedureParameter("@useremail",    model.useremail),
                    //登录密码
					new ProcedureParameter("@userpsw",    model.userpsw) 
            };
            Par.Add(new ProcedureParameter("@id", model.id));

            int rev = PubConn.ExecuteSql("update tb_user set [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected] where [email protected]", Par);
            return rev == 1;

        }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:26,代码来源:tb_user_dal.cs

示例6: DeleteAll

 public void DeleteAll(DbConn PubConn)
 {
     SqlHelper.Visit((ps) =>
     {
         string Sql = "truncate table tb_error";
         int rev = PubConn.ExecuteSql(Sql, ps.ToParameters());
         return rev;
     });
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:9,代码来源:tb_error_dal.cs

示例7: UpdateTaskSuccess

 public int UpdateTaskSuccess(DbConn PubConn, int id)
 {
     return SqlHelper.Visit(ps =>
     {
         string cmd = "update tb_task set taskerrorcount=0,taskruncount=taskruncount+1 where [email protected]";
         ps.Add("id", id);
         return PubConn.ExecuteSql(cmd, ps.ToParameters());
     });
 }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:9,代码来源:tb_task_dal.cs

示例8: DeleteOneNode

 public bool DeleteOneNode(DbConn PubConn, int id)
 {
     return SqlHelper.Visit<bool>(ps =>
     {
         ps.Add("id", id);
         string sql = "delete from tb_user where (select count(1) from tb_task where [email protected])=0 and [email protected]";
         int i = PubConn.ExecuteSql(sql, ps.ToParameters());
         return i > 0;
     });
 }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:10,代码来源:tb_user_dal.cs

示例9: DeleteNotOnLineByClientID

 public bool DeleteNotOnLineByClientID(DbConn PubConn, int consumerclientid, int maxtimeoutsenconds)
 {
     return SqlHelper.Visit((ps) =>
     {
         ps.Add("@consumerclientid", consumerclientid); ps.Add("@maxtimeoutsenconds", maxtimeoutsenconds);
         string Sql = "delete from tb_consumer where [email protected] and DATEDIFF(S,lastheartbeat,getdate())>@maxtimeoutsenconds";
         int rev = PubConn.ExecuteSql(Sql, ps.ToParameters());
         return true;
     });
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:10,代码来源:tb_consumer_dal.cs

示例10: UpdateTaskError

 public int UpdateTaskError(DbConn PubConn, int id, DateTime time)
 {
     return SqlHelper.Visit(ps =>
     {
         string cmd = "update tb_task set taskerrorcount=taskerrorcount+1,[email protected] where [email protected]";
         ps.Add("id", id);
         ps.Add("tasklasterrortime", time);
         return PubConn.ExecuteSql(cmd, ps.ToParameters());
     });
 }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:10,代码来源:tb_task_dal.cs

示例11: ClientHeatbeat

 public bool ClientHeatbeat(DbConn PubConn, int mqpathid, long tempid)
 {
     return SqlHelper.Visit((ps) =>
     {
         ps.Add("@mqpathid", mqpathid); ps.Add("@tempid", tempid);
         string Sql = "update tb_producter WITH (ROWLOCK) set lastheartbeat=getdate() where [email protected] and [email protected]";
         int rev = PubConn.ExecuteSql(Sql, ps.ToParameters());
         return true;
     });
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:10,代码来源:tb_producter_dal.cs

示例12: Update

        public bool Update(DbConn PubConn, tb_category_model model)
        {
            List<ProcedureParameter> Par = new List<ProcedureParameter>()
                {
					new ProcedureParameter("@categoryname",    model.categoryname),
                    new ProcedureParameter("@id",    model.id),
                };
            int rev = PubConn.ExecuteSql(@"update tb_category set [email protected] where [email protected]", Par);
            return rev == 1;
        }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:10,代码来源:tb_category_dal.cs

示例13: UpdateLastStartTime

 public int UpdateLastStartTime(DbConn PubConn, int id, DateTime time)
 {
     return SqlHelper.Visit(ps =>
     {
         string cmd = "update tb_task set [email protected] where [email protected]";
         ps.Add("id", id);
         ps.Add("tasklaststarttime", time);
         return PubConn.ExecuteSql(cmd, ps.ToParameters());
     });
 }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:10,代码来源:tb_task_dal.cs

示例14: SaveTempData

 public virtual int SaveTempData(DbConn PubConn,int taskid,string json)
 {
     return SqlHelper.Visit(ps =>
     {
         string cmd = "update tb_tempdata set [email protected] where [email protected]";
         ps.Add("taskid", taskid);
         ps.Add("tempdatajson",json);
         return PubConn.ExecuteSql(cmd, ps.ToParameters());
     });
 }
开发者ID:zeus911,项目名称:Dyd.BaseService.TaskManager,代码行数:10,代码来源:tb_tempdata_dal.cs

示例15: Add2

 public virtual void Add2(DbConn PubConn, string client)
 {
     SqlHelper.Visit((ps) =>
     {
         ps.Add("@client", client);
         PubConn.ExecuteSql(@"insert into tb_consumer_client(client,createtime)
                                 values(@client,getdate())", ps.ToParameters());
         return true;
     });
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:10,代码来源:tb_consumer_client_dal.cs


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