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


C# DB_Talk类代码示例

本文整理汇总了C#中DB_Talk的典型用法代码示例。如果您正苦于以下问题:C# DB_Talk类的具体用法?C# DB_Talk怎么用?C# DB_Talk使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: frmBox

        public frmBox(DB_Talk.Model.m_Box model, int operate)
         {
            InitializeComponent();

            _operate = operate;
            if (operate == 0)
            {
                _mModelOld = null;
                this.FormTitle = "添加";
                btnOK.Text = "添加";
                this.txtIP.Text = "172.21.0.2";
                //this.txtNetIP.Text= "10.21.0.2";
                //this.txtMask.Text = "255.255.255.0";
               
                this.txtNetIP.Enabled=false;
                this.txtMask.Enabled = false;

                this.txtDispatchIP1.Text = "172.21.0.41";
                this.txtDispatchIP2.Text = "172.21.0.42";
                this.txtRecordServerIP.Text = "172.21.0.21";
                this.txtTimerIP.Text = "";
            }
            else
            {
                btnTest.Visible = false;
                _mModel = model;
                _mModelOld = (DB_Talk.Model.m_Box)model.Clone();
                this.FormTitle = "编辑";
                btnOK.Text = "编辑";
                ShowModel();
            }
            //this.txtName.MaxLength = Global.Params.NameLen;
        }
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:33,代码来源:frmBox.cs

示例2: Add

		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(DB_Talk.Model.m_StaticRoute model,bool IsReturnID)   
		{
		    int Result=0;
		    StringBuilder strSql=new StringBuilder();
			StringBuilder strSql1=new StringBuilder();
			StringBuilder strSql2=new StringBuilder();	
			if(model.BoxID!=null)
		    {
			   strSql1.Append("BoxID,");	
			   strSql2.Append("'"+ model.BoxID +"',");	
			} 
            if(model.vc_NetIP!=null)
		    {
			   strSql1.Append("vc_NetIP,");	
			   strSql2.Append("'"+ model.vc_NetIP +"',");	
			} 
            if(model.vc_Mask!=null)
		    {
			   strSql1.Append("vc_Mask,");	
			   strSql2.Append("'"+ model.vc_Mask +"',");	
			} 
            if(model.vc_GateWayIP!=null)
		    {
			   strSql1.Append("vc_GateWayIP,");	
			   strSql2.Append("'"+ model.vc_GateWayIP +"',");	
			} 
            if(model.vc_Memo!=null)
		    {
			   strSql1.Append("vc_Memo,");	
			   strSql2.Append("'"+ model.vc_Memo +"',");	
			} 
            if(model.i_Flag!=null)
		    {
			   strSql1.Append("i_Flag,");	
			   strSql2.Append("'"+ model.i_Flag +"',");	
			} 
            strSql.Append("insert into m_StaticRoute(");	
			strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));	
			strSql.Append(")");
			strSql.Append(" values (");
			strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
			strSql.Append(")");  
			strSql.Append(";select @@IDENTITY");
			if (IsReturnID)
            {
                DataSet ds=GetDataSet(strSql.ToString());
                if(ds!=null && ds.Tables[0].Rows.Count>0)
                {
                   Result = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
                }
                else
                  Result=-1;
            }
            else  
            {
                Result = ExecuteSql(strSql.ToString());
            }
            return Result; 
		}
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:62,代码来源:m_StaticRoute.cs

示例3: DeleteRouteGroup

 //删除路由组
 private static bool DeleteRouteGroup(DB_Talk.Model.m_RouteGroup model)
 {
     bool b = false;
     if (!IsBoxExitRouteGroup(model)) return true;
     if (model.ID > 0 && model.vc_Name != "")
     {
         b = MBoxSDK.ConfigSDK.MBOX_DeleteRouteGroup(Global.Params.BoxHandle, (uint)model.ID, model.vc_Name);
     }
     return b;
 }
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:11,代码来源:MBoxOperate.cs

示例4: Update

 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(DB_Talk.Model.m_RegionRelation model)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("update m_RegionRelation set ");
     if (model.BoxID != null)
     {
         strSql.Append("BoxID=" + model.BoxID + ",");
     }
     else
     {
         strSql.Append("BoxID= null ,");
     }
     if (model.RegionID != null)
     {
         strSql.Append("RegionID='" + model.RegionID + "',");
     }
     else
     {
         strSql.Append("RegionID= null ,");
     }
     if (model.i_RelationType != null)
     {
         strSql.Append("i_RelationType=" + model.i_RelationType + ",");
     }
     else
     {
         strSql.Append("i_RelationType= null ,");
     }
     if (model.RelationID != null)
     {
         strSql.Append("RelationID=" + model.RelationID + ",");
     }
     else
     {
         strSql.Append("RelationID= null ,");
     }
     int n = strSql.ToString().LastIndexOf(",");
     strSql.Remove(n, 1);
     strSql.Append(" where ID=" + model.ID + "");
     int rowsAffected = DB.OleDbHelper.ExecuteSql(strSql.ToString());
     if (rowsAffected > 0)
     {
         return true;
     }
     else
     {
         return false;
     }
 }
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:52,代码来源:m_RegionRelation.cs

示例5: CreateRouteGroup

        //创建路由组
        private static bool CreateRouteGroup(DB_Talk.Model.m_RouteGroup model,out int RouteGroupID)
        {
            //创建路由组只传入名称,没有ID
            bool b = false;
            RouteGroupID = 0;
            List<DB_Talk.Model.m_RouteGroup> lst = new List<DB_Talk.Model.m_RouteGroup>();
            QueryRouteGroup(out lst);
            if (lst != null && lst.Count > 0)
            {
                DB_Talk.Model.m_RouteGroup temp = lst.Find(item => item.vc_Name == model.vc_Name);
                if (temp != null) //存在相同名称的,直接返回相同名称的路由组ID
                {
                    RouteGroupID = temp.ID;
                    return true;  //存在的不再添加
                }
                else
                {
                    model.ID = lst[lst.Count - 1].ID +1;  //不存在相同名称的,需要新建,ID为目前最大ID+1
                }
            }
            else
            {
                model.ID = 1; //没有路由的情况下ID从1开始
            }
            if (model.ID > 0 && model.vc_Name != "")
            {
                RouteGroupID = model.ID;
                b = MBoxSDK.ConfigSDK.MBOX_CreateRouteGroup(Global.Params.BoxHandle, (uint)model.ID, model.vc_Name);
            }
            return b;

            /*
            bool b = false;
            List<DB_Talk.Model.m_RouteGroup> lst = new List<DB_Talk.Model.m_RouteGroup>();
            QueryRouteGroup(out lst);
            if (lst != null && lst.Count > 0)
            {
                    if (lst.Contains(model))
                    {
                        return true;  //存在的不再添加
                    }
            }
            if (model.ID > 0 && model.vc_Name != "")
            {
                b = MBoxSDK.ConfigSDK.MBOX_CreateRouteGroup(Global.Params.BoxHandle, (uint)model.ID, model.vc_Name);
            }
            return b;
             */
        }
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:50,代码来源:MBoxOperate.cs

示例6: Update

		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(DB_Talk.Model.m_CameraInfo model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update m_CameraInfo set ");
			if (model.BoxID != null)
			{
				strSql.Append("BoxID="+model.BoxID+",");
			}
			else
			{
				strSql.Append("BoxID= null ,");
			}
			if (model.vc_Name != null)
			{
				strSql.Append("vc_Name='"+model.vc_Name+"',");
			}
			else
			{
				strSql.Append("vc_Name= null ,");
			}
			if (model.vc_Memo != null)
			{
				strSql.Append("vc_Memo='"+model.vc_Memo+"',");
			}
			else
			{
				strSql.Append("vc_Memo= null ,");
			}
			if (model.i_ChanelID != null)
			{
				strSql.Append("i_ChanelID="+model.i_ChanelID+",");
			}
			else
			{
				strSql.Append("i_ChanelID= null ,");
			}
			int n = strSql.ToString().LastIndexOf(",");
			strSql.Remove(n, 1);
			strSql.Append(" where ID="+ model.ID+"");
			int rowsAffected=DB.OleDbHelper.ExecuteSql(strSql.ToString());
			if (rowsAffected > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:52,代码来源:m_CameraInfo.cs

示例7: Add

		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(DB_Talk.Model.Data_MemberState model,bool IsReturnID)   
		{
		    int Result=0;
		    StringBuilder strSql=new StringBuilder();
			StringBuilder strSql1=new StringBuilder();
			StringBuilder strSql2=new StringBuilder();	
			if(model.i_DispatchNumber!=null)
		    {
			   strSql1.Append("i_DispatchNumber,");	
			   strSql2.Append("'"+ model.i_DispatchNumber +"',");	
			} 
            if(model.i_Number!=null)
		    {
			   strSql1.Append("i_Number,");	
			   strSql2.Append("'"+ model.i_Number +"',");	
			} 
            if(model.i_PeerNumber!=null)
		    {
			   strSql1.Append("i_PeerNumber,");	
			   strSql2.Append("'"+ model.i_PeerNumber +"',");	
			} 
            if(model.i_State!=null)
		    {
			   strSql1.Append("i_State,");	
			   strSql2.Append("'"+ model.i_State +"',");	
			} 
            strSql.Append("insert into Data_MemberState(");	
			strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));	
			strSql.Append(")");
			strSql.Append(" values (");
			strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
			strSql.Append(")");  
			strSql.Append(";select @@IDENTITY");
			if (IsReturnID)
            {
                DataSet ds=GetDataSet(strSql.ToString());
                if(ds!=null && ds.Tables[0].Rows.Count>0)
                {
                   Result = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
                }
                else
                  Result=-1;
            }
            else  
            {
                Result = ExecuteSql(strSql.ToString());
            }
            return Result; 
		}
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:52,代码来源:Data_MemberState.cs

示例8: Add

		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(DB_Talk.Model.m_GroupMembers model,bool IsReturnID)   
		{
		    int Result=0;
		    StringBuilder strSql=new StringBuilder();
			StringBuilder strSql1=new StringBuilder();
			StringBuilder strSql2=new StringBuilder();	
			if(model.BoxID!=null)
		    {
			   strSql1.Append("BoxID,");	
			   strSql2.Append("'"+ model.BoxID +"',");	
			} 
            if(model.GroupID!=null)
		    {
			   strSql1.Append("GroupID,");	
			   strSql2.Append("'"+ model.GroupID +"',");	
			} 
            if(model.MemberID!=null)
		    {
			   strSql1.Append("MemberID,");	
			   strSql2.Append("'"+ model.MemberID +"',");	
			} 
            strSql.Append("insert into m_GroupMembers(");	
			strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));	
			strSql.Append(")");
			strSql.Append(" values (");
			strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
			strSql.Append(")");  
			strSql.Append(";select @@IDENTITY");
			if (IsReturnID)
            {
                DataSet ds=GetDataSet(strSql.ToString());
                if(ds!=null && ds.Tables[0].Rows.Count>0)
                {
                   Result = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
                }
                else
                  Result=-1;
            }
            else  
            {
                Result = ExecuteSql(strSql.ToString());
            }
            return Result; 
		}
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:47,代码来源:m_GroupMembers.cs

示例9: Add

		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(DB_Talk.Model.m_CameraInfo model)
		{
			StringBuilder strSql=new StringBuilder();
			StringBuilder strSql1=new StringBuilder();
			StringBuilder strSql2=new StringBuilder();
			if (model.BoxID != null)
			{
				strSql1.Append("BoxID,");
				strSql2.Append(""+model.BoxID+",");
			}
			if (model.vc_Name != null)
			{
				strSql1.Append("vc_Name,");
				strSql2.Append("'"+model.vc_Name+"',");
			}
			if (model.vc_Memo != null)
			{
				strSql1.Append("vc_Memo,");
				strSql2.Append("'"+model.vc_Memo+"',");
			}
			if (model.i_ChanelID != null)
			{
				strSql1.Append("i_ChanelID,");
				strSql2.Append(""+model.i_ChanelID+",");
			}
			strSql.Append("insert into m_CameraInfo(");
			strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
			strSql.Append(")");
			strSql.Append(" values (");
			strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
			strSql.Append(")");
			strSql.Append(";select @@IDENTITY");
            object obj = DB.OleDbHelper.ExecuteSql(strSql.ToString());
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:45,代码来源:m_CameraInfo.cs

示例10: Add

 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(DB_Talk.Model.m_RegionRelation model)
 {
     StringBuilder strSql = new StringBuilder();
     StringBuilder strSql1 = new StringBuilder();
     StringBuilder strSql2 = new StringBuilder();
     if (model.BoxID != null)
     {
         strSql1.Append("BoxID,");
         strSql2.Append("" + model.BoxID + ",");
     }
     if (model.RegionID != null)
     {
         strSql1.Append("RegionID,");
         strSql2.Append("'" + model.RegionID + "',");
     }
     if (model.i_RelationType != null)
     {
         strSql1.Append("i_RelationType,");
         strSql2.Append("" + model.i_RelationType + ",");
     }
     if (model.RelationID != null)
     {
         strSql1.Append("RelationID,");
         strSql2.Append("" + model.RelationID + ",");
     }
     strSql.Append("insert into m_RegionRelation(");
     strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
     strSql.Append(")");
     strSql.Append(" values (");
     strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
     strSql.Append(")");
     strSql.Append(";select @@IDENTITY");
     object obj = DB.OleDbHelper.ExecuteSql(strSql.ToString());
     if (obj == null)
     {
         return 0;
     }
     else
     {
         return Convert.ToInt32(obj);
     }
 }
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:45,代码来源:m_RegionRelation.cs

示例11: frmDepartment

        public frmDepartment(DB_Talk.Model.m_Departments model, int operate)
         {
            InitializeComponent();
            if (Global.Params.ConfigModel.SystemConfig.MaxNameTextLengh != 0)
                this.txtName.MaxLength = Global.Params.ConfigModel.SystemConfig.MaxNameTextLengh;// Global.Params.NameLen;

            if (operate == 0)
            {
                this.FormTitle = "添加";
                btnOK.Text = "添加";
            }
            else
            {

                _mModel = model;
                this.FormTitle = "编辑";
                btnOK.Text = "编辑";
                ShowModel();
            }
           
        }
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:21,代码来源:frmDepartment.cs

示例12: frmCalledRule

        public frmCalledRule(DB_Talk.Model.m_CalledRule m, int operate)
        {
            InitializeComponent();
           
            _operate = operate;
            if (operate == 0)
            {
                this.FormTitle = "添加";
                btnOK.Text = "添加";
               
            }
            else
            {
                _mModel = m;
                this.FormTitle = "编辑";
                btnOK.Text = "编辑";
               // ShowModel();
            }

            this.Load += new EventHandler(frmCalledRule_Load);
           
            
        }
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:23,代码来源:frmCalledRule.cs

示例13: frmGroup

        public frmGroup(DB_Talk.Model.m_Group model, int operate)
         {
            InitializeComponent();
            _mModel = model;
            if (_mModel.GroupTypeID == CommControl.PublicEnums.EnumGroupType.Normal.GetHashCode())
                GroupType = "调度";
            else if((_mModel.GroupTypeID == CommControl.PublicEnums.EnumGroupType.Meeting.GetHashCode()))
                GroupType = "会议";

            if (operate == 0)
            {
                this.FormTitle = "添加";
                btnOK.Text = "添加";
            }
            else
            {
                this.FormTitle = "编辑";
                btnOK.Text = "编辑";
                ShowModel();
            }
            if (Global.Params.ConfigModel.SystemConfig.MaxNameTextLengh != 0)
               this.txtName.MaxLength = Global.Params.ConfigModel.SystemConfig.MaxNameTextLengh;//  Global.Params.NameLen;
            
        }
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:24,代码来源:frmGroup.cs

示例14: Add

		/// <summary>
		/// 增加一条数据
		/// </summary>
		public int Add(DB_Talk.Model.m_CalinglSourceRule model,bool IsReturnID)   
		{
		    int Result=0;
		    StringBuilder strSql=new StringBuilder();
			StringBuilder strSql1=new StringBuilder();
			StringBuilder strSql2=new StringBuilder();
            //if (model.ID != null)
            //{
            //    strSql1.Append("ID,");
            //    strSql2.Append("'" + model.ID + "',");
            //} 
			if(model.BoxID>0)
		    {
			   strSql1.Append("BoxID,");	
			   strSql2.Append("'"+ model.BoxID +"',");	
			} 
            if(model.vc_Code!=null)
		    {
			   strSql1.Append("vc_Code,");	
			   strSql2.Append("'"+ model.vc_Code +"',");	
			} 
            if(model.vc_Name!=null)
		    {
			   strSql1.Append("vc_Name,");	
			   strSql2.Append("'"+ model.vc_Name +"',");	
			} 
            if(model.CallingOrigID!=null)
		    {
			   strSql1.Append("CallingOrigID,");	
			   strSql2.Append("'"+ model.CallingOrigID +"',");	
			} 
            if(model.i_ServerType!=null)
		    {
			   strSql1.Append("i_ServerType,");	
			   strSql2.Append("'"+ model.i_ServerType +"',");	
			} 
            if(model.i_MinReLength!=null)
		    {
			   strSql1.Append("i_MinReLength,");	
			   strSql2.Append("'"+ model.i_MinReLength +"',");	
			} 
            if(model.OriRouteID!=null)
		    {
			   strSql1.Append("OriRouteID,");	
			   strSql2.Append("'"+ model.OriRouteID +"',");	
			} 
            if(model.CalledRuleID!=null)
		    {
			   strSql1.Append("CalledRuleID,");	
			   strSql2.Append("'"+ model.CalledRuleID +"',");	
			} 
            if(model.vc_Memo!=null)
		    {
			   strSql1.Append("vc_Memo,");	
			   strSql2.Append("'"+ model.vc_Memo +"',");	
			} 
            if(model.i_Flag!=null)
		    {
			   strSql1.Append("i_Flag,");	
			   strSql2.Append("'"+ model.i_Flag +"',");	
			} 
            strSql.Append("insert into m_CalinglSourceRule(");	
			strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));	
			strSql.Append(")");
			strSql.Append(" values (");
			strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
			strSql.Append(")");  
			strSql.Append(";select @@IDENTITY");
			if (IsReturnID)
            {
                DataSet ds=GetDataSet(strSql.ToString());
                if(ds!=null && ds.Tables[0].Rows.Count>0)
                {
                   Result = Convert.ToInt32(ds.Tables[0].Rows[0][0]);
                }
                else
                  Result=-1;
            }
            else  
            {
                Result = ExecuteSql(strSql.ToString());
            }
            return Result; 
		}
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:87,代码来源:m_CalinglSourceRule.cs

示例15: Update

		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(DB_Talk.Model.m_CalinglSourceRule model,string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update m_CalinglSourceRule set ");
			if(model.BoxID!=null)
		    {
			   strSql.Append("BoxID='"+ model.BoxID +"',");	
			} 
			if(model.vc_Code!=null)
		    {
			   strSql.Append("vc_Code='"+ model.vc_Code +"',");	
			} 
			if(model.vc_Name!=null)
		    {
			   strSql.Append("vc_Name='"+ model.vc_Name +"',");	
			} 
			if(model.CallingOrigID!=null)
		    {
			   strSql.Append("CallingOrigID='"+ model.CallingOrigID +"',");	
			} 
			if(model.i_ServerType!=null)
		    {
			   strSql.Append("i_ServerType='"+ model.i_ServerType +"',");	
			} 
			if(model.i_MinReLength!=null)
		    {
			   strSql.Append("i_MinReLength='"+ model.i_MinReLength +"',");	
			} 
			if(model.OriRouteID!=null)
		    {
			   strSql.Append("OriRouteID='"+ model.OriRouteID +"',");	
			} 
			if(model.CalledRuleID!=null)
		    {
			   strSql.Append("CalledRuleID='"+ model.CalledRuleID +"',");	
			} 
			if(model.vc_Memo!=null)
		    {
			   strSql.Append("vc_Memo='"+ model.vc_Memo +"',");	
			} 
			if(model.i_Flag!=null)
		    {
			   strSql.Append("i_Flag='"+ model.i_Flag +"',");	
			} 
			int n = strSql.ToString().LastIndexOf(",");
			strSql.Remove(n, 1);
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			else
			    strSql.Append(" where ID=" + model.ID +"");	         
            int rows=ExecuteSql(strSql.ToString());
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
开发者ID:FeelingMars,项目名称:DispatchPlatform,代码行数:65,代码来源:m_CalinglSourceRule.cs


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