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


C# Database.RunProc方法代码示例

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


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

示例1: BindGrid

        private void BindGrid()
        {
            SqlDataReader dr=null; //������������
            Database db = new Database();
            try
            {
                SqlParameter[] prams = {
                                       db.MakeInParam("@RoleID",SqlDbType.Int,4,RoleID)
                                   };
                if (DisplayType == 0)
                    db.RunProc("sp_GetStaffInRole", prams, out dr);
                else
                    db.RunProc("sp_GetStaffNotInRole", prams, out dr);

                DataTable dt = Tools.ConvertDataReaderToDataTable(dr);

                dbStaffList.DataSource = dt.DefaultView;
                dbStaffList.DataBind();
            }
            finally
            {
                if (db != null)
                { db.Close(); }
                if (dr != null)
                {

                    dr.Close();
                }
            }
        }
开发者ID:blfsir,项目名称:benzoa,代码行数:30,代码来源:ListView.aspx.cs

示例2: GetMyDocument

        /// <summary>
        /// �õ��ҵ������ĵ�
        /// </summary>
        /// <param name="UserName">�û���</param>
        /// <param name="RightCode">�鿴�ĵ���Ȩ�޴���</param>
        /// <returns>����dataReader</returns>
        public SqlDataReader GetMyDocument(string UserName,int RightCode)
        {
            Database data = new Database();
            SqlDataReader dataReader = null;
            // ִ�д洢���̣�������SqlDataReader����
            SqlParameter[] prams = {
                                       data.MakeInParam("@UserName" , SqlDbType.VarChar , 300, UserName),
                                       data.MakeInParam("@RightCode",SqlDbType.Int,4,RightCode)
                                   };

            try
            {
                data.RunProc("sp_GetMyNewDoc",prams,out dataReader);
                return dataReader;

            }
            catch(Exception ex)
            {
                Error.Log(ex.ToString());
                throw new Exception("��ȡ�ҵ��ĵ�����!",ex);
            }
            //finally
            //{
            //    data	   = null;
            //    dataReader = null;
            //}
        }
开发者ID:blfsir,项目名称:benzoa,代码行数:33,代码来源:Desktop.cs

示例3: BindGrid

        public void BindGrid()
        {
            SqlDataReader dr; //���Ȩ������
            string spName;//�洢������
            spName = "";
            Database db = new Database();
            SqlParameter[] prams = new SqlParameter[1];
            switch(DisplayType)
            {
                case "0":
                    prams[0] = db.MakeInParam("@PositionID",SqlDbType.Int,4,Int32.Parse(strObjID));
                    spName = "sp_GetPositionRightList";
                    break;
                case "1":
                    prams[0] = db.MakeInParam("@Teamid",SqlDbType.Int,4,Int32.Parse(strObjID));
                    spName = "sp_GetTeamRightList";
                    break;
                case "2":
                    prams[0] = db.MakeInParam("@RoleID",SqlDbType.Int,4,Int32.Parse(strObjID));
                    spName = "sp_GetRoleRightList";
                    break;
                default:
                    break;
                    //������
            }

            db.RunProc(spName,prams,out dr);

            DataTable dt =Tools.ConvertDataReaderToDataTable(dr);

            RightsGrid.DataSource = dt.DefaultView;
            RightsGrid.DataBind();
        }
开发者ID:hoku85,项目名称:UDS,代码行数:33,代码来源:RightListView.aspx.cs

示例4: Delete

        /// <summary>
        /// ɾ��ijĿ¼
        /// </summary>
        /// <param name="ClassID">��ĿID</param>
        public void Delete(int ClassID)
        {
            Database data = new Database();
            SqlParameter[] prams = {
                                       data.MakeInParam("@TeamID" , SqlDbType.Int, 20, ClassID),
            };
            try
            {
                data.RunProc("sp_DeleteTeam", prams);
            }

            catch (Exception ex)
            {
                Error.Log(ex.ToString());

            }
            finally
            {
                if (data != null)
                {
                    data.Close();
                    data.Dispose();
                }
            }
        }
开发者ID:blfsir,项目名称:benzoa,代码行数:29,代码来源:Directory.cs

示例5: Bangding

        private void Bangding()
        {
            SqlDataReader dr;
            Database db = new Database();
            SqlParameter[] parms = {
                                        db.MakeInParam("@StyleID",SqlDbType.Int  ,4,StyleID),
                                    };
            db.RunProc("sp_Flow_GetStyle",parms,out dr);
            if(dr.Read())
            {
                txtStyleName.Text = dr["Style_Name"].ToString();
                txtStyleRemark.Text = dr["Style_Remark"].ToString();
                lblTemplate.Text  = "<a href='" + @"Template\" + dr["Template"].ToString() + "'>" + dr["Template"].ToString() + "</a>";
                if(dr["Template"].ToString()=="")
                    Template.Visible = false;
                else
                    Template.Visible  = true;

            }
            else
            {
                Template.Visible  = false;
            }

            if(db!=null)
            {
                db.Close();
                db = null;
            }
            dr.Close();
            dr = null;
        }
开发者ID:hoku85,项目名称:UDS,代码行数:32,代码来源:EditStyle.aspx.cs

示例6: GetProjectName

        /// <summary>
        /// ��ȡij��Ŀ����
        /// </summary>
        /// <param name="ClassID">��ĿID</param>
        public static string GetProjectName(int ClassID)
        {
            string ProjectName = "";
            SqlDataReader dataReader = null;
            Database data = new Database();
            SqlParameter[] prams =
                                {
                                    data.MakeInParam("@projectid",	SqlDbType.Int, 20 ,ClassID)
                                };
            try
            {
                data.RunProc("sp_GetProjectName", prams, out dataReader);
                if (dataReader.Read())
                    ProjectName = dataReader[0].ToString();
                return ProjectName;
            }

            catch (Exception ex)
            {
                Error.Log(ex.ToString());
                return "";
            }
            finally
            {

                if (dataReader != null)
                {
                    dataReader.Close();
                }
            }
        }
开发者ID:blfsir,项目名称:benzoa,代码行数:35,代码来源:Project.cs

示例7: AdminBBS

        /// <summary>
        /// �ж��Ƿ��й���Ȩ��
        /// </summary>
        /// <param name="username">�û���</param>
        /// <returns>bool</returns>
        public bool AdminBBS(string username,int classid)
        {
            if(classid!=0)
            {
                int actid = 8;
                Database db = new Database();
                SqlParameter[] prams = {
                                           db.MakeInParam("@Class_ID",SqlDbType.Int,4,classid),
                                           db.MakeInParam("@Username",SqlDbType.VarChar,100,username),
                                           db.MakeInParam("@Act_ID",SqlDbType.Int,4,actid),
                                           db.MakeOutParam("@ReturnValue",SqlDbType.Int,4)
                                       };
                try
                {
                    db.RunProc("sp_GetAccessPermission",prams);
                                        //					����������
                                        //					return(true);
                    return((Int32.Parse(prams[3].Value.ToString())==1)?true:false);

                }
                catch(Exception ex)
                {
                    Error.Log(ex.Message);
                    throw new Exception("BBSȨ���жϴ���!",ex);
                }
            }
            else
                return(false);
        }
开发者ID:hoku85,项目名称:UDS,代码行数:34,代码来源:BBS.cs

示例8: Bangding

        private void Bangding()
        {
            SqlDataReader dr;
            Database db = new Database();
            SqlParameter[] parms = {
                                        db.MakeInParam("@DeptID",SqlDbType.Int  ,4,DeptID),
                                    };
            db.RunProc("sp_Flow_GetDept", parms, out dr);
            try
            {
                if (dr.Read())
                {
                    txtDeptName.Text = dr["Dept_Name"].ToString();
                    txtRemark.Text = dr["Dept_Remark"].ToString();
                }

                if (db != null)
                {
                    db.Close();
                    db = null;
                }
            }
            finally
            {
                if (db != null)
                {
                    db.Close();
                }
                if (dr != null)
                {
                    dr.Close();
                }
                dr = null;
            }
        }
开发者ID:blfsir,项目名称:benzoa,代码行数:35,代码来源:EditDepartment.aspx.cs

示例9: Bangding

        private void Bangding()
        {
            SqlDataReader dr = null; //存放人物的数据
            Database mySQL = new Database();
            try
            {
                SqlParameter[] parameters = {
                                            mySQL.MakeInParam("@NewsID",SqlDbType.Int ,4,0)
                                        };

                mySQL.RunProc("sp_Flow_GetNews", parameters, out dr);

                DataTable dt = Tools.ConvertDataReaderToDataTable(dr);

                dgStyleListAdmin.DataSource = dt.DefaultView;
                dgStyleListAdmin.DataBind();

            }
            finally
            {
                if (mySQL != null)
                {
                    mySQL.Close();
                }
                if (dr != null)
                {
                    dr.Close();
                }
            }
        }
开发者ID:blfsir,项目名称:benzoa,代码行数:30,代码来源:NewsManagement.aspx.cs

示例10: AddClass

        /// <summary>
        /// ��Ŀ¼�ڵ�
        /// </summary>
        /// <param name="ClassID">��Ŀ¼�ڵ�</param>
        /// <returns>��Ŀ¼�ڵ�</returns>
        public void AddClass(int ParentID, string ClassName, string ClassRemark, int ClassType, string AddedBy, DateTime AddedDate, int Status)
        {
            Database data = new Database();
            SqlParameter[] prams = {
                                       data.MakeInParam("@ClassParentID" , SqlDbType.Int, 20, ParentID),
                                       data.MakeInParam("@ClassName" , SqlDbType.NVarChar, 20, ClassName),
                                       data.MakeInParam("@ClassRemark" , SqlDbType.NVarChar, 400, ClassRemark),
                                       data.MakeInParam("@ClassType" , SqlDbType.Int, 1, ClassType),
                                       data.MakeInParam("@AddedBy" , SqlDbType.NVarChar, 40, AddedBy),
                                       data.MakeInParam("@AddedDate" , SqlDbType.DateTime, 30, AddedDate),
                                       data.MakeInParam("@Status" , SqlDbType.Int, 1, Status)
                                   };

            try
            {
                data.RunProc("sp_AddTeam", prams);

            }
            catch (Exception ex)
            {
                Error.Log(ex.ToString());
                throw new Exception("Ŀ¼��ӳ���", ex);
            }
            finally
            {
                if (data != null)
                {
                    data.Close();
                    data.Dispose();
                }
            }
        }
开发者ID:blfsir,项目名称:benzoa,代码行数:37,代码来源:Class.cs

示例11: BindGrid

        private void BindGrid()
        {
            SqlDataReader dr; //������������
            Database db = new Database();
            SqlParameter[] prams = {
                                       db.MakeInParam("@StaffType",SqlDbType.Bit,1,DisplayType)
                                   };
            db.RunProc("sp_GetAllStaff",prams,out dr);
            DataTable dt =Tools.ConvertDataReaderToDataTable(dr);

            dbStaffList.DataSource = dt.DefaultView;
            dbStaffList.DataBind();
            if(DisplayType==0)
            {
                //				lbOnline.BackColor = Color.FromArgb(0xCCCCCC);
                //				lbOffLine.BackColor =Color.FromArgb(0xFFFFFF);
                cmdRehab.Visible = false;
                cmdDimission.Visible = true;
                cmdChangePosition.Visible =true;
            }
            else
            {
                //				lbOnline.BackColor =Color.FromArgb(0xFFFFFF);
                //				lbOffLine.BackColor =Color.FromArgb(0xCCCCCC);
                cmdRehab.Visible = true;
                cmdDimission.Visible = false;
                cmdChangePosition.Visible =false;

            }
        }
开发者ID:hoku85,项目名称:UDS,代码行数:30,代码来源:ManageStaff.aspx.cs

示例12: BindGrid

        /// <summary>
        /// ���ݰ�
        /// </summary>
        private void BindGrid()
        {
            SqlDataReader dr; //������������
            Database db = new Database();
            SqlParameter[] prams = {
                                        db.MakeInParam("@StaffType",SqlDbType.Bit,1,displaytype)
            };
            db.RunProc("sp_GetAllStaff",prams,out dr);
            DataTable dt =Tools.ConvertDataReaderToDataTable(dr);
            //��DataTable��ĩβ���Ͽ��У�ʹ��DataGrid�̶�����
            int blankrows = StaffList.PageSize - (dt.Rows.Count % StaffList.PageSize);
            for (int i = 0; i < blankrows; i++)
            {
                dt.Rows.Add(dt.NewRow());
            }

            StaffList.DataSource = dt.DefaultView;
            StaffList.DataBind();

            //���ڿռ�¼����ʾcheckbox
            for(int i=0;i<StaffList.Items.Count;i++)
            {
                if(StaffList.Items[i].Cells[1].Text=="&nbsp;")
                {
                    StaffList.Items[i].FindControl("cb_StaffID").Visible = false;
                }
            }
            lbl_totalrecord.Text =StaffList.PageCount.ToString();
            lbl_curpage.Text = txb_PageNo.Text = (StaffList.CurrentPageIndex + 1).ToString();
            txb_ItemPerPage.Text = StaffList.PageSize.ToString();
            lbl_totalpage.Text = StaffList.PageCount.ToString();
        }
开发者ID:hoku85,项目名称:UDS,代码行数:35,代码来源:ModifyInfo1.aspx.cs

示例13: Add

        /// <summary>
        /// ��Ӳ���
        /// </summary>
        /// <param name="pid">�����ŵĸ�����id</param>
        /// <param name="name">�����ŵ�����</param>
        /// <param name="description">�����ŵ�����</param>
        /// <returns>�����ŷ��䵽��id</returns>
        public static long Add(long ParentDepartmentID,string name,string description)
        {
            Database db = new Database();
            SqlParameter[] prams = new SqlParameter[3];

            prams[0] = new SqlParameter();
            prams[1] = new SqlParameter();
            prams[2] = new SqlParameter();

            prams[0].SqlDbType = SqlDbType.Int;
            prams[0].ParameterName = "@Dept_ParentID";
            prams[0].Value = ParentDepartmentID;

            prams[1].SqlDbType = SqlDbType.VarChar;
            prams[1].Size = 255;
            prams[1].ParameterName = "@Dept_Name";
            prams[1].Value = name;

            prams[2].SqlDbType = SqlDbType.Text;
            prams[2].ParameterName = "@Dept_Remark";
            prams[2].Value = description;

            //prams[3] = new SqlParameter();
            //prams[3].SqlDbType = SqlDbType.Int;
            //prams[3].ParameterName = "@ID";
            //prams[3].Direction = ParameterDirection.ReturnValue;

            return (db.RunProc("sp_AddDepartment",prams));
        }
开发者ID:hoku85,项目名称:UDS,代码行数:36,代码来源:Department.cs

示例14: Add

        /// <summary>
        /// ��Ŀ���
        /// </summary>
        public void Add(int ParentID,string ProjectName,string ProjectRemark,string Wright,int Status,int Scale,DateTime StartDate,DateTime EndDate)
        {
            // �������ݿ�����༰DataReader
            Database data = new Database();

            // ִ�д洢���̣�������SqlDataReader����
            SqlParameter[] prams = {
                                       data.MakeInParam("@ParentID" , SqlDbType.Int, 20, ParentID),
                                       data.MakeInParam("@ProjectName" , SqlDbType.NVarChar, 20, ProjectName.Trim()),
                                       data.MakeInParam("@ProjectRemark" , SqlDbType.NVarChar, 400, ProjectRemark.Trim()),
                                       data.MakeInParam("@Wright" , SqlDbType.NVarChar, 40, Wright),
                                       data.MakeInParam("@Status" , SqlDbType.Int, 40, Status),
                                       data.MakeInParam("@Scale" , SqlDbType.Int, 20, Scale),
                                       data.MakeInParam("@StartDate" , SqlDbType.DateTime, 30, StartDate),
                                       data.MakeInParam("@EndDate" , SqlDbType.DateTime, 30, EndDate)
                                   };

            try
            {
                data.RunProc("sp_AddProject",prams);

            }
            catch(Exception ex)
            {
                Error.Log(ex.ToString());
                throw new Exception("��Ŀ��ӳ���",ex);
            }
            finally
            {
                data	   = null;
            }
        }
开发者ID:hoku85,项目名称:UDS,代码行数:35,代码来源:Project.cs

示例15: GetClassDetail

        /// <summary>
        /// ��ȡij�ڵ���ϸ��Ϣ
        /// </summary>
        /// <param name="ClassID">��ĿID</param>
        public SqlDataReader GetClassDetail(int ClassID)
        {
            SqlDataReader dataReader = null;
            Database data = new Database();
            SqlParameter[] prams =
                                {
                                    data.MakeInParam("@ClassID",	SqlDbType.Int, 20 ,ClassID)
                                };
            try
            {
                data.RunProc("sp_GetClass", prams, out dataReader);
                return dataReader;
            }

            catch (Exception ex)
            {
                Error.Log(ex.ToString());
                return null;
            }
            //finally
            //{
            //    data.Close();
            //    data.Dispose();
            //    dataReader.Close();
            //    dataReader.Dispose();
            //}
        }
开发者ID:blfsir,项目名称:benzoa,代码行数:31,代码来源:Class.cs


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