Esempio n. 1
0
        public string GetRoleInfo(long RoleID, string FiledName)
        {
            UDS.Components.Database db = new UDS.Components.Database();
            SqlDataReader           dr = null;

            SqlParameter[] prams =
            {
                db.MakeInParam("@RoleID", SqlDbType.Int, 4, RoleID),
            };
            db.RunProc("sp_GetRoleInfo", prams, out dr);
            try
            {
                if (dr.Read())
                {
                    try
                    {
                        return(dr[FiledName].ToString());
                    }
                    catch
                    {
                        return("");
                    }
                }
                else
                {
                    return("");
                }
            }
            finally
            {
                dr = null;
                db = null;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 添加权限
        /// </summary>
        /// <param name="SrcID"></param>
        /// <param name="ObjID"></param>
        /// <param name="BaseOn"></param>
        /// <param name="ProcID"></param>
        /// <returns></returns>
        public int AddRight(long SrcID, long ObjID, int BaseOn, int ProcID)
        {
            int iReturn = 1;

            UDS.Components.Database mySQL = new UDS.Components.Database();
            try
            {
                SqlParameter[] parameters =
                {
                    mySQL.MakeInParam("@Act_ID",   SqlDbType.Int, 4, ProcID),
                    mySQL.MakeInParam("@Based_On", SqlDbType.Int, 4, BaseOn),
                    mySQL.MakeInParam("@Src_ID",   SqlDbType.Int, 4, SrcID),
                    mySQL.MakeInParam("@Obj_ID",   SqlDbType.Int, 4, ObjID)
                };
                mySQL.RunProc("sp_AddAssignRule", parameters);
            }
            catch (Exception e)
            {
                Error.Log(e.ToString());
            }
            finally
            {
                mySQL.Close();
                mySQL = null;
            }
            return(iReturn);
        }
Esempio n. 3
0
        /// <summary>
        /// ����ĵ���������ĿID
        /// </summary>
        /// <param name="DocID">�ĵ�ID</param>
        public static int GetDocumentProjectID(long DocID)
        {
            int iReturn=0;
            UDS.Components.Database mySQL = new UDS.Components.Database();
            SqlParameter[] parameters = {
                                            mySQL.MakeInParam("@DocID",SqlDbType.Int ,4,DocID)
                                        };

            try
            {
                iReturn = mySQL.RunProc("sp_Flow_GetDocumentProjectID",parameters);

            }
            catch(Exception e)
            {
                Error.Log(e.ToString());
                throw new Exception("��ù��ĵ���ĿID�����",e);
            }
            finally
            {
                mySQL.Close();
                mySQL = null;
            }
            return iReturn;
        }
Esempio n. 4
0
        /// <summary>
        /// 获得权限列表
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <param name="ClassID">权限对象</param>
        /// <param name="dr">返回DataReader</param>
        /// <returns>整形是否成功</returns>
        public int GetProcessList(string UserName, long ClassID, out SqlDataReader dr)
        {
            int iReturn = 1;

            UDS.Components.Database mySQL      = new UDS.Components.Database();
            SqlParameter[]          parameters =
            {
                mySQL.MakeInParam("@UserName", SqlDbType.VarChar, 300, UserName),
                mySQL.MakeInParam("@ClassID",  SqlDbType.Int,       4, ClassID)
            };
            dr = null;
            try
            {
                mySQL.RunProc("sp_GetRightListToClass", parameters, out dr);
            }
            catch (Exception e)
            {
                Error.Log(e.ToString());
            }
            finally
            {
                //mySQL.Close();
                //mySQL = null;
            }
            return(iReturn);
        }
Esempio n. 5
0
        /// <summary>
        /// 添加权限
        /// </summary>
        /// <param name="SrcID"></param>
        /// <param name="ObjID"></param>
        /// <param name="BaseOn"></param>
        /// <param name="ProcID"></param>
        /// <returns></returns>
        public int AddRight(long SrcID,long ObjID,int BaseOn,int ProcID)
        {
            int iReturn=1;
            UDS.Components.Database mySQL = new UDS.Components.Database();
            try
            {

                SqlParameter[] parameters = {
                                                mySQL.MakeInParam("@Act_ID",	SqlDbType.Int,	4,ProcID),
                                                mySQL.MakeInParam("@Based_On",	SqlDbType.Int,	4,BaseOn),
                                                mySQL.MakeInParam("@Src_ID",	SqlDbType.Int,	4,SrcID),
                                                mySQL.MakeInParam("@Obj_ID",	SqlDbType.Int,	4,ObjID)

                                        };
                mySQL.RunProc("sp_AddAssignRule",parameters);
            }
            catch(Exception e)
            {
                Error.Log(e.ToString());
            }
            finally
            {
                mySQL.Close();
                mySQL = null;
            }
            return iReturn;
        }
Esempio n. 6
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     // 在此处放置用户代码以初始化页面
     if (!Page.IsPostBack)
     {
         DeptID       = (Request.QueryString["DeptID"] == null)?"":Request.QueryString["DeptID"].ToString();
         displayType  = (Request.QueryString["displayType"] == null)?"":Request.QueryString["displayType"].ToString();
         selectedID   = (Request.QueryString["StaffIDS"] == null)?"":Request.QueryString["StaffIDS"].ToString();
         backfilepath = (Request.QueryString["BackFilePath"] == null)?"":Request.QueryString["BackFilePath"].ToString();
         SqlDataReader           dr;
         UDS.Components.Database db = new UDS.Components.Database();
         db.RunProc("SP_Ext_GetDepartment", out dr);
         Department.DataSource     = dr;
         Department.DataTextField  = "Department_Name";
         Department.DataValueField = "Department_ID";
         Department.DataBind();
     }
     if (Request.QueryString["ReturnPage"] != null)
     {
         ReturnPage = Int32.Parse(Request.QueryString["ReturnPage"].ToString());
     }
     else
     {
         ReturnPage = 0;
     }
 }
Esempio n. 7
0
        /// <summary>
        /// 获得自定义联系人分类
        /// </summary>
        /// <returns></returns>
        public SqlDataReader GetCustomLinkmanType()
        {
            UDS.Components.Database data = new UDS.Components.Database();
            SqlDataReader           dr   = null;

            data.RunProc("sp_Linkman_GetCustomLinkmanType", out dr);
            return(dr);
        }
Esempio n. 8
0
        /// <summary>
        /// 获得所有联系人分类关系数据
        /// </summary>
        /// <returns></returns>
        public SqlDataReader GetLinkmanTypeRelation()
        {
            UDS.Components.Database data = new UDS.Components.Database();
            SqlDataReader           dr   = null;

            data.RunProc("sp_Linkman_GetAllLinkmanTypeData", out dr);
            return(dr);
        }
Esempio n. 9
0
 /// <summary>
 /// ɾ����ɫ
 /// </summary>
 /// <param name="roleid">��ɫID</param>
 /// <returns>0�ɹ�1���ɹ�</returns>
 public static int Delete(int roleid)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlParameter[] prams = {
                                db.MakeInParam("@role_id",SqlDbType.Int,4,roleid)
                            };
     return(db.RunProc("sp_DeleteRole",prams));
 }
Esempio n. 10
0
 /// <summary>
 /// 删除角色
 /// </summary>
 /// <param name="roleid">角色ID</param>
 /// <returns>0成功1不成功</returns>
 public static int Delete(int roleid)
 {
     UDS.Components.Database db    = new UDS.Components.Database();
     SqlParameter[]          prams =
     {
         db.MakeInParam("@role_id", SqlDbType.Int, 4, roleid)
     };
     return(db.RunProc("sp_DeleteRole", prams));
 }
Esempio n. 11
0
 /// <summary>
 /// ��ӽ�ɫ
 /// </summary>
 /// <param name="rolename">��ɫ��</param>
 /// <param name="roledescription">��ɫ����</param>
 /// <returns>��ɫID</returns>
 public static int Add(string rolename,string roledescription)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlParameter[] prams = {
                                 db.MakeInParam("@Role_Name",SqlDbType.VarChar,300,rolename.Trim()),
                                 db.MakeInParam("@Role_Description",SqlDbType.VarChar,300,roledescription.Trim())
                            };
     return(db.RunProc("sp_AddMyRole",prams));
 }
Esempio n. 12
0
 /// <summary>
 /// �ӽ�ɫ��ɾ����Ա
 /// </summary>
 /// <param name="roleid">��ɫid</param>
 /// <param name="staffid">��Աid</param>
 /// <returns>����ֵ</returns>
 public static int DelStaffFromRole(int roleid,string staffid)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlParameter[] prams = {
                                 db.MakeInParam("@Role_ID",SqlDbType.Int,4,roleid),
                                 db.MakeInParam("@StaffIDS",SqlDbType.VarChar,3000,staffid)
                            };
     return(db.RunProc("sp_DeleteStaffFromRole",prams));
 }
Esempio n. 13
0
 /// <summary>
 /// 使人员复职
 /// </summary>
 /// <param name="staffids">人员id集合</param>
 /// <returns>是否成功</returns>
 public bool ReturnPosition(string staffids)
 {
     UDS.Components.Database db    = new UDS.Components.Database();
     SqlParameter[]          prams =
     {
         db.MakeInParam("@StaffIDS", SqlDbType.VarChar, 300, staffids)
     };
     return((db.RunProc("sp_StaffRehab", prams) == 0)?true:false);
 }
Esempio n. 14
0
 /// <summary>
 /// 从角色中添加成员
 /// </summary>
 /// <param name="roleid">角色id</param>
 /// <param name="staffid">非成员id</param>
 /// <returns>返回值</returns>
 public static int AddStaffFromRole(int roleid, string staffid)
 {
     UDS.Components.Database db    = new UDS.Components.Database();
     SqlParameter[]          prams =
     {
         db.MakeInParam("@Role_ID",  SqlDbType.Int,        4, roleid),
         db.MakeInParam("@StaffIDS", SqlDbType.VarChar, 3000, staffid)
     };
     return(db.RunProc("sp_AddStaffToRole", prams));
 }
Esempio n. 15
0
 /// <summary>
 /// 添加角色
 /// </summary>
 /// <param name="rolename">角色名</param>
 /// <param name="roledescription">角色描述</param>
 /// <returns>角色ID</returns>
 public static int Add(string rolename, string roledescription)
 {
     UDS.Components.Database db    = new UDS.Components.Database();
     SqlParameter[]          prams =
     {
         db.MakeInParam("@Role_Name",        SqlDbType.VarChar, 300, rolename.Trim()),
         db.MakeInParam("@Role_Description", SqlDbType.VarChar, 300, roledescription.Trim())
     };
     return(db.RunProc("sp_AddMyRole", prams));
 }
Esempio n. 16
0
 private void BindDepartment()
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlDataReader dr_department = null;
     db.RunProc("sp_GetAllDepartment",out dr_department);
     lstDeparment.DataSource = dr_department;
     lstDeparment.DataTextField = "Department_Name";
     lstDeparment.DataValueField = "Department_ID";
     lstDeparment.DataBind();
 }
Esempio n. 17
0
        /// <summary>
        /// 添加自定义联系人
        /// </summary>
        /// <param name="clinkman">CustomLinkman结构</param>
        /// <returns>添加的ID</returns>
        public int AddCustomLinkman(CustomLinkman clinkman, int staffid)
        {
            int result = 0;

            UDS.Components.Database data  = new UDS.Components.Database();
            SqlParameter[]          prams =
            {
                data.MakeInParam("@name",            SqlDbType.VarChar,  100, clinkman.Name),
                data.MakeInParam("@Gender",          SqlDbType.Bit,        1, clinkman.Gender),
                data.MakeInParam("@UnitTelephone",   SqlDbType.VarChar,   50, clinkman.UnitTelephone),
                data.MakeInParam("@Email",           SqlDbType.VarChar,   50, clinkman.Email),
                data.MakeInParam("@UnitAddress",     SqlDbType.VarChar,  200, clinkman.UnitAddress),
                data.MakeInParam("@UnitZip",         SqlDbType.VarChar,   50, clinkman.UnitZip),
                data.MakeInParam("@FamilyAddress",   SqlDbType.VarChar,  200, clinkman.FamilyAddress),
                data.MakeInParam("@FamilyZip",       SqlDbType.VarChar,   50, clinkman.FamilyZip),
                data.MakeInParam("@Mobile",          SqlDbType.VarChar,  100, clinkman.Mobile),
                data.MakeInParam("@FamilyTelephone", SqlDbType.VarChar,  100, clinkman.FamilyTelephone),
                data.MakeInParam("@Memo",            SqlDbType.VarChar, 1000, clinkman.Memo),
                data.MakeInParam("@Staffid",         SqlDbType.Int,        4, staffid),
                data.MakeInParam("@Age",             SqlDbType.VarChar,   50, clinkman.Age)
            };
            result = data.RunProc("sp_Linkman_AddCustomLinkman", prams);

            if (clinkman.Type.IndexOf(',', 0) != -1)
            {
                string [] arrtype = clinkman.Type.Split(',');
                for (int i = 0; i < arrtype.Length; i++)
                {
                    if (arrtype[i].Trim() != "")
                    {
                        SqlParameter[] prams1 =
                        {
                            data.MakeInParam("@typeid", SqlDbType.Int, 4, arrtype[i]),
                            data.MakeInParam("@id",     SqlDbType.Int, 4, result)
                        };
                        data.RunProc("sp_Linkman_AddCustomLinkmanType", prams1);
                    }
                }
            }

            return(result);
        }
Esempio n. 18
0
        private void BindDepartment()
        {
            UDS.Components.Database db            = new UDS.Components.Database();
            SqlDataReader           dr_department = null;

            db.RunProc("sp_GetAllDepartment", out dr_department);
            cboDepartment.DataSource     = dr_department;
            cboDepartment.DataTextField  = "Department_Name";
            cboDepartment.DataValueField = "Department_ID";
            cboDepartment.DataBind();
        }
Esempio n. 19
0
        private void BindPosition()
        {
            UDS.Components.Database db            = new UDS.Components.Database();
            SqlDataReader           dr_department = null;

            db.RunProc("sp_GetAllPosition", out dr_department);
            lstDeparment.DataSource     = dr_department;
            lstDeparment.DataTextField  = "Position_Name";
            lstDeparment.DataValueField = "Position_ID";
            lstDeparment.DataBind();
        }
Esempio n. 20
0
 /// <summary>
 /// 修改角色信息
 /// </summary>
 /// <param name="roleid">角色ID</param>
 /// <param name="rolename">角色名称</param>
 /// <param name="roledescription">角色描述</param>
 /// <returns>返回值(0成功1不成功)</returns>
 public static int Modify(int roleid, string rolename, string roledescription)
 {
     UDS.Components.Database db    = new UDS.Components.Database();
     SqlParameter[]          prams =
     {
         db.MakeInParam("@role_id",          SqlDbType.Int,       4, roleid),
         db.MakeInParam("@role_name",        SqlDbType.VarChar, 300, rolename.Trim()),
         db.MakeInParam("@role_description", SqlDbType.VarChar, 300, roledescription.Trim())
     };
     return(db.RunProc("sp_UpdateRoleInfo", prams));
 }
Esempio n. 21
0
        /// <summary>
        /// 人员职位级别更新
        /// </summary>
        /// <param name="PositionID">职位ID</param>
        /// <param name="NewCaste">新职级</param>
        /// <returns>返回是否成功</returns>
        public static int UpdateCaste(long PositionID, int NewCaste)
        {
            UDS.Components.Database db = new UDS.Components.Database();

            SqlParameter[] prams =
            {
                db.MakeInParam("@PositionID", SqlDbType.Int, 4, PositionID),
                db.MakeInParam("@NewCaste",   SqlDbType.Int, 4, NewCaste)
            };
            return(db.RunProc("sp_UpdatePositionCaste", prams));
        }
Esempio n. 22
0
 /// <summary>
 /// 检查此人是否已经在联系人列表中
 /// </summary>
 /// <param name="type">联系人类型(0:所有联系人1:员工联系人2:客户联系人3:自定义联系人)</param>
 /// <param name="staffid">用户id</param>
 /// <param name="id">联系人id</param>
 /// <returns></returns>
 public bool HaveInList(int type, int staffid, int id)
 {
     UDS.Components.Database data  = new UDS.Components.Database();
     SqlParameter[]          prams =
     {
         data.MakeInParam("@type",    SqlDbType.Int, 4, type),
         data.MakeInParam("@staffid", SqlDbType.Int, 4, staffid),
         data.MakeInParam("@id",      SqlDbType.Int, 4, id)
     };
     return((data.RunProc("sp_Linkman_HaveInList", prams) == 1)?true:false);
 }
Esempio n. 23
0
        public SqlDataReader GetStaffIDByRealName(string realname)
        {
            UDS.Components.Database db = new UDS.Components.Database();
            SqlDataReader           dr = null;

            SqlParameter[] prams =
            {
                db.MakeInParam("@realname", SqlDbType.VarChar, 100, realname)
            };
            db.RunProc("sp_GetStaffIDByRealName", prams, out dr);
            return(dr);
        }
Esempio n. 24
0
        public SqlDataReader GetCustomLinkmanType(int id)
        {
            UDS.Components.Database data  = new UDS.Components.Database();
            SqlParameter[]          prams =
            {
                data.MakeInParam("@id", SqlDbType.Int, 4, id)
            };
            SqlDataReader dr = null;

            data.RunProc("sp_Linkman_GetCustomLinkmanTypeByCustomLinkmanID", prams, out dr);
            return(dr);
        }
Esempio n. 25
0
File: BBS.cs Progetto: youye00/UDS
        public SqlDataReader Find(string key, BBSSearchOption option, DataTable boards)
        {
            string        boardids = "";
            string        sql      = "select * from UDS_Bbs_ForumItem";
            SqlDataReader dr       = null;


            if (option.searchtype == BBSSearchType.author)
            {
                sql += " where sender like '%" + key + "%'";
            }
            else if (option.searchtype == BBSSearchType.title)
            {
                sql += " where title like '%" + key + "%'";
            }

            if (option.BoardID != 0)
            {
                sql += " and board_id=" + option.BoardID;
            }
            else
            {
                foreach (DataRow row in boards.Rows)
                {
                    boardids += row["board_id"].ToString() + ",";
                }

                if (boardids != "")
                {
                    boardids = boardids.Substring(0, boardids.Length - 1);
                }



                sql += " and board_id in (" + boardids + ")";
            }
            if (option.TimeBound != TimeSpan.MaxValue)
            {
                //计算时间段
                sql += " and datediff(d,send_time,getdate())< " + option.TimeBound.Days.ToString();
            }


            UDS.Components.Database db    = new UDS.Components.Database();
            SqlParameter[]          prams =
            {
                db.MakeInParam("@SQL", SqlDbType.NText, 5000, sql),
            };

            db.RunProc("sp_RunSQL", prams, out dr);
            return(dr);
        }
Esempio n. 26
0
        /// <summary>
        /// 得到我的联系人
        /// </summary>
        /// <param name="type">联系人类型(0:所有联系人1:员工联系人2:客户联系人3:自定义联系人)</param>
        /// <param name="staffid">用户id</param>
        /// <returns></returns>
        public SqlDataReader GetMyLinkman(int type, int staffid)
        {
            UDS.Components.Database data  = new UDS.Components.Database();
            SqlParameter[]          prams =
            {
                data.MakeInParam("@type",    SqlDbType.Int, 4, type),
                data.MakeInParam("@staffid", SqlDbType.Int, 4, staffid)
            };
            SqlDataReader dr = null;

            data.RunProc("sp_Linkman_GetList", prams, out dr);
            return(dr);
        }
Esempio n. 27
0
 private void cmdSubmit_ServerClick(object sender, System.EventArgs e)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlParameter[] prams = {
                                 db.MakeInParam("@StaffIDS",SqlDbType.VarChar,300,selectedID),
                                 db.MakeInParam("@NewDeptID",SqlDbType.Int,4,Int32.Parse(Department.Items[Department.SelectedIndex].Value))
                            };
     db.RunProc("sp_StaffMove",prams);
     if(ReturnPage ==0)
         Response.Redirect(backfilepath+"?DeptID="+DeptID+"&displayType="+displayType);
     else
         Response.Redirect("../Staff/ManageStaff.aspx?DisplayType=0");
 }
Esempio n. 28
0
        public SqlDataReader GetRoleInfo(long RoleID)
        {
            UDS.Components.Database db = new UDS.Components.Database();
            SqlDataReader           dr = null;

            SqlParameter[] prams =
            {
                db.MakeInParam("@RoleID", SqlDbType.Int, 4, RoleID),
            };
            db.RunProc("sp_GetRoleInfo", prams, out dr);

            return(dr);
        }
Esempio n. 29
0
 /// <summary>
 /// 人员复职
 /// </summary>
 /// <param name="StaffID">人员ID</param>
 /// <returns>返回是否成功</returns>
 public bool Rehab(string StaffIDS)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     if (StaffIDS.Length > 0)
     {
         SqlParameter[] prams =
         {
             db.MakeInParam("@StaffIDS", SqlDbType.VarChar, 300, StaffIDS.ToString())
         };
         return(db.RunProc("sp_StaffRehab", prams) == 0?true:false);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 30
0
File: Team.cs Progetto: hoku85/UDS
 /// <summary>
 /// ������ɾ��ij��Ա
 /// </summary>
 /// <param name="staffids">��Աid����</param>
 /// <returns>�Ƿ�ɹ�</returns>
 public bool DeleteStaffFromTeam(string staffids,int TeamID)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlParameter[] prams = {
                                db.MakeInParam("@StaffIDS",SqlDbType.VarChar,300,staffids),
                                db.MakeInParam("@TeamID",SqlDbType.Int,8,TeamID)
                            };
     try
     {
         return((db.RunProc("sp_DeleteStaffFromTeam",prams)==0)?true:false);
     }
     catch(Exception ex)
     {
         Error.Log(ex.ToString());
         throw new Exception("������ɾ��ij��Ա!",ex);
     }
 }
Esempio n. 31
0
        /// <summary>
        /// 根据rolename得到roleid
        /// </summary>
        /// <param name="rolename">角色名称</param>
        /// <returns>角色id</returns>
        public static int GetRoleIDByName(string rolename)
        {
            UDS.Components.Database db = new UDS.Components.Database();
            int           roleid       = 0;
            SqlDataReader dr           = null;

            SqlParameter[] prams =
            {
                db.MakeInParam("@rolename", SqlDbType.VarChar, 100, rolename),
            };
            db.RunProc("sp_GetRoleIDFromName", prams, out dr);
            while (dr.Read())
            {
                roleid = Int32.Parse(dr["role_id"].ToString());
            }
            return(roleid);
        }
Esempio n. 32
0
 /// <summary>
 /// 设置用户是否需要硬件KEY验证
 /// </summary>
 /// <param name="StaffID">人员ID</param>
 /// <param name="IsNeedKey">是否需要登陆</param>
 /// <returns>返回是否成功</returns>
 public bool SetIsNeedKey(string StaffIDs, bool IsNeedKey)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     if (StaffIDs.Length > 0)
     {
         SqlParameter[] prams =
         {
             db.MakeInParam("@StaffIDs",  SqlDbType.VarChar, 1000, StaffIDs),
             db.MakeInParam("@IsNeedKey", SqlDbType.Bit,        1, IsNeedKey)
         };
         return(db.RunProc("sp_Staff_SetIsNeedKey", prams) == 0?true:false);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 33
0
File: Team.cs Progetto: youye00/UDS
 /// <summary>
 /// 加入成员至组
 /// </summary>
 /// <param name="staffids">人员id集合</param>
 /// <returns>是否成功</returns>
 public bool AddMemberToTeam(string staffids, int TeamID)
 {
     UDS.Components.Database db    = new UDS.Components.Database();
     SqlParameter[]          prams =
     {
         db.MakeInParam("@StaffIDS", SqlDbType.VarChar, 300, staffids),
         db.MakeInParam("@TeamID",   SqlDbType.Int,       8, TeamID)
     };
     try
     {
         return((db.RunProc("sp_AddStaffToTeam", prams) == 0)?true:false);
     }
     catch (Exception ex)
     {
         Error.Log(ex.ToString());
         throw new Exception("加入成员至组出错!", ex);
     }
 }
Esempio n. 34
0
 private void cmdSubmit_ServerClick(object sender, System.EventArgs e)
 {
     UDS.Components.Database db    = new UDS.Components.Database();
     SqlParameter[]          prams =
     {
         db.MakeInParam("@StaffIDS",  SqlDbType.VarChar, 300, selectedID),
         db.MakeInParam("@NewDeptID", SqlDbType.Int,       4, Int32.Parse(Department.Items[Department.SelectedIndex].Value))
     };
     db.RunProc("sp_StaffMove", prams);
     if (ReturnPage == 0)
     {
         Response.Redirect(backfilepath + "?DeptID=" + DeptID + "&displayType=" + displayType);
     }
     else
     {
         Response.Redirect("../Staff/ManageStaff.aspx?DisplayType=0");
     }
 }
Esempio n. 35
0
        /// <summary>
        /// 人员更新
        /// </summary>
        /// <param name="StaffID">人员ID</param>
        /// <returns>返回是否成功</returns>
        public int UpdateInfo(long StaffID, string RealName, int Sex, string Birthday, string Password, string Email, string Phone, string Mobile, long PositionID, int Caste)
        {
            UDS.Components.Database db = new UDS.Components.Database();

            SqlParameter[] prams =
            {
                db.MakeInParam("@StaffID",    SqlDbType.Int,        4, StaffID),
                db.MakeInParam("@RealName",   SqlDbType.VarChar,   50, RealName),
                db.MakeInParam("@Sex",        SqlDbType.Bit,        1, Sex),
                db.MakeInParam("@Birthday",   SqlDbType.DateTime,   8, Birthday),
                db.MakeInParam("@Password",   SqlDbType.VarChar,  255, Password),
                db.MakeInParam("@Email",      SqlDbType.VarChar,  500, Email),
                db.MakeInParam("@Phone",      SqlDbType.VarChar,   50, Phone),
                db.MakeInParam("@Mobile",     SqlDbType.VarChar,   50, Mobile),
                db.MakeInParam("@PositionID", SqlDbType.Int,        4, PositionID),
                db.MakeInParam("@Caste",      SqlDbType.Int,        4, Caste)
            };
            return(db.RunProc("sp_UpdateStaffInfo", prams));
        }
Esempio n. 36
0
 /// <summary>
 /// 更新自定义联系人分类
 /// </summary>
 /// <param name="mlinkman"></param>
 public void UpdateCustomLinkmanType(CustomLinkman clinkman)
 {
     UDS.Components.Database data = new UDS.Components.Database();
     if (clinkman.Type.IndexOf(',', 0) != -1)
     {
         string [] arrtype = clinkman.Type.Split(',');
         for (int i = 0; i < arrtype.Length; i++)
         {
             if (arrtype[i].Trim() != "")
             {
                 SqlParameter[] prams1 =
                 {
                     data.MakeInParam("@typeid", SqlDbType.Int, 4, arrtype[i]),
                     data.MakeInParam("@id",     SqlDbType.Int, 4, clinkman.ID)
                 };
                 data.RunProc("sp_Linkman_AddCustomLinkmanType", prams1);
             }
         }
     }
 }
Esempio n. 37
0
        /// <summary>
        /// 得到员工上下班时间
        /// </summary>
        public DutyTime GetDutyTime()
        {
            UDS.Components.Database db = new UDS.Components.Database();
            DutyTime dt = new DutyTime();

            System.Data.SqlClient.SqlParameter[] prams =
            {
                db.MakeInParam("@staffid",      System.Data.SqlDbType.Int,            4, staffid),
                db.MakeOutParam("@ondutytime",  System.Data.SqlDbType.SmallDateTime, 8),
                db.MakeOutParam("@offdutytime", System.Data.SqlDbType.SmallDateTime, 8)
            };
            if (db.RunProc("sp_WA_GetDutyTime", prams) != 0)
            {
                throw(new Exception("读取人员上下班时间出错"));
            }
            else
            {
                dt.OnDutyTime  = (System.DateTime)prams[1].Value;
                dt.OffDutyTime = (System.DateTime)prams[2].Value;
                return(dt);
            }
        }
Esempio n. 38
0
        private void Bind()
        {
            DataSet ds = new DataSet();

            UDS.Components.Staff staff1   = new UDS.Components.Staff();
            SqlDataReader        dr_Staff = staff1.GetAllStaffs();
            DataTable            dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);

            dt_Staff.TableName = "Staff";
            ds.Tables.Add(dt_Staff);

            try
            {
                UDS.Components.Database db    = new UDS.Components.Database();
                SqlParameter[]          prams =
                {
                    db.MakeInParam("@SQL", SqlDbType.NText, 5000, searchstring)
                };
                SqlDataReader dr = null;
                db.RunProc("sp_RunSql", prams, out dr);
                DataTable dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);
                dt.TableName = "Client";
                ds.Tables.Add(dt);

                ltl_Client.Text = dt.Rows.Count.ToString();

                ds.Relations.Add("ClientAddMan_Staff", ds.Tables["Client"].Columns["AddManID"], ds.Tables["Staff"].Columns["Staff_ID"], false);

                dt.DefaultView.Sort = ViewState["SortField"].ToString() + " " + ViewState["SortDirect"].ToString();

                dgrd_clientlist.DataSource = dt.DefaultView;
                dgrd_clientlist.DataBind();
            }
            catch (Exception ex)
            {
                UDS.Components.Error.Log(ex.ToString());
                Server.Transfer("../../Error.aspx");
            }
        }
Esempio n. 39
0
 /// <summary>
 /// ����ļ��������ݿ����
 /// </summary>
 /// <param name="att">DocAttachFile��</param>
 /// <param name="DocID">�ļ�ID</param>
 public void AddAttach(UDS.Components.DocAttachFile att,long DocID)
 {
     UDS.Components.Database data = new UDS.Components.Database();
     SqlParameter[] prams = {
                                data.MakeInParam("@DocID",  SqlDbType.Int, 20, DocID),
                                data.MakeInParam("@FileName",  SqlDbType.VarChar, 300, att.FileName),
                                data.MakeInParam("@FileSize",  SqlDbType.Int, 20, att.FileSize),
                                data.MakeInParam("@FileAttribute",  SqlDbType.SmallInt,20, att.FileAttribute),
                                data.MakeInParam("@FileVisualPath",  SqlDbType.NVarChar, 200, att.FileVisualPath),
                                data.MakeInParam("@FileAuthor",  SqlDbType.NVarChar, 50, att.FileAuthor),
                                data.MakeInParam("@FileCatlog",  SqlDbType.NVarChar, 20, att.FileCatlog),
                                data.MakeInParam("@FileAddedDate", SqlDbType.DateTime, 30, DateTime.Parse(att.FileAddedDate))
                            };
     try
     {
         data.RunProc("sp_Flow_AddFile", prams);
     }
     catch (Exception ex)
     {
         Error.Log(ex.ToString());
         throw new Exception("�ļ��������ͳ���!",ex);
     }
 }
Esempio n. 40
0
        /// <summary>
        /// 删除权限
        /// </summary>
        /// <param name="RuleIDs">权限记录号</param>
        public int DeleteRight(string RuleIDs)
        {
            int iReturn=1;
            UDS.Components.Database mySQL = new UDS.Components.Database();
            try
            {

                SqlParameter[] parameters = {
                                                mySQL.MakeInParam("@Rule_IDS",SqlDbType.VarChar ,300,RuleIDs)

                                            };
                mySQL.RunProc("sp_DeleteAssignRule",parameters);
            }
            catch(Exception e)
            {
                Error.Log(e.ToString());
            }
            finally
            {
                //mySQL.Close();
                //mySQL = null;
            }
            return iReturn;
        }
Esempio n. 41
0
        private void Bind()
        {
            DataSet ds = new DataSet();
            UDS.Components.Staff staff1 = new UDS.Components.Staff();
            SqlDataReader dr_Staff = staff1.GetAllStaffs();
            DataTable dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);
            dt_Staff.TableName = "Staff";
            ds.Tables.Add(dt_Staff);

            try
            {
                UDS.Components.Database db = new UDS.Components.Database();
                SqlParameter[] prams = {
                                           db.MakeInParam("@SQL",SqlDbType.NText,5000,searchstring)
                                       };
                SqlDataReader dr = null;
                db.RunProc("sp_RunSql",prams,out dr);
                DataTable dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);
                dt.TableName = "Client";
                ds.Tables.Add(dt);

                ltl_Client.Text = dt.Rows.Count.ToString();

                ds.Relations.Add("ClientAddMan_Staff",ds.Tables["Client"].Columns["AddManID"],ds.Tables["Staff"].Columns["Staff_ID"],false);

                dt.DefaultView.Sort = ViewState["SortField"].ToString() + " " + ViewState["SortDirect"].ToString();

                dgrd_clientlist.DataSource = dt.DefaultView;
                dgrd_clientlist.DataBind();
            }
            catch(Exception ex)
            {
                UDS.Components.Error.Log(ex.ToString());
                Server.Transfer("../../Error.aspx");
            }
        }
Esempio n. 42
0
 private void Page_Load(object sender, System.EventArgs e)
 {
     // �ڴ˴������û������Գ�ʼ��ҳ��
     if(!Page.IsPostBack)
     {
         DeptID = (Request.QueryString["DeptID"]==null)?"":Request.QueryString["DeptID"].ToString();
         displayType = (Request.QueryString["displayType"]==null)?"":Request.QueryString["displayType"].ToString();
         selectedID = (Request.QueryString["StaffIDS"]==null)?"":Request.QueryString["StaffIDS"].ToString();
         backfilepath =(Request.QueryString["BackFilePath"]==null)?"":Request.QueryString["BackFilePath"].ToString();
         SqlDataReader dr;
         UDS.Components.Database db = new UDS.Components.Database();
         db.RunProc("SP_Ext_GetDepartment",out dr);
         Department.DataSource = dr;
         Department.DataTextField = "Department_Name";
         Department.DataValueField = "Department_ID";
         Department.DataBind();
     }
     if(Request.QueryString["ReturnPage"]!=null)
     {
         ReturnPage  = Int32.Parse(Request.QueryString["ReturnPage"].ToString());
     }
     else
         ReturnPage = 0;
 }
Esempio n. 43
0
 /// <summary>
 /// �޸Ľ�ɫ��Ϣ
 /// </summary>
 /// <param name="roleid">��ɫID</param>
 /// <param name="rolename">��ɫ����</param>
 /// <param name="roledescription">��ɫ����</param>
 /// <returns>����ֵ��0�ɹ�1���ɹ���</returns>
 public static int Modify(int roleid,string rolename,string roledescription)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlParameter[] prams = {
                                 db.MakeInParam("@role_id",SqlDbType.Int ,4,roleid),
                                 db.MakeInParam("@role_name",SqlDbType.VarChar,300,rolename.Trim()),
                                 db.MakeInParam("@role_description",SqlDbType.VarChar,300,roledescription.Trim())
                            };
     return(db.RunProc("sp_UpdateRoleInfo",prams));
 }
Esempio n. 44
0
        /// <summary>
        /// 获得权限列表
        /// </summary>
        /// <param name="UserName">用户名</param>
        /// <param name="ClassID">权限对象</param>
        /// <param name="dr">返回DataTable</param>
        /// <returns>整形是否成功</returns>
        public int GetProcessList(string UserName,long ClassID,out DataTable dt)
        {
            int iReturn=1;
            SqlDataReader dr;
            UDS.Components.Database mySQL = new UDS.Components.Database();
            SqlParameter[] parameters = {
                                            mySQL.MakeInParam("@UserName",SqlDbType.VarChar ,300,UserName),
                                            mySQL.MakeInParam("@ClassID",SqlDbType.Int,4,ClassID)
                                        };
            dt = null;
            try
            {
                mySQL.RunProc("sp_GetRightListToClass",parameters,out dr);
                dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);

            }
            catch(Exception e)
            {
                Error.Log(e.ToString());
            }
            finally
            {
                //mySQL.Close();
                //mySQL = null;
            }
            return iReturn;
        }
Esempio n. 45
0
 /// <summary>
 /// ����Զ�����ϵ�˷���
 /// </summary>
 /// <returns></returns>
 public SqlDataReader GetCustomLinkmanType()
 {
     UDS.Components.Database data = new UDS.Components.Database();
     SqlDataReader dr = null;
     data.RunProc("sp_Linkman_GetCustomLinkmanType",out dr);
     return(dr);
 }
Esempio n. 46
0
 /// <summary>
 /// ��Ա��ְ
 /// </summary>
 /// <param name="StaffID">��ԱID</param>
 /// <returns>�����Ƿ�ɹ�</returns>
 public bool Rehab(string StaffIDS)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     if(StaffIDS.Length >0)
     {
         SqlParameter[] prams = {
                                    db.MakeInParam("@StaffIDS",SqlDbType.VarChar,300,StaffIDS.ToString())
                                };
         return db.RunProc("sp_StaffRehab",prams)==0?true:false;
     }
     else
         return false;
 }
Esempio n. 47
0
 private void BindPosition()
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlDataReader dr_department = null;
     try
     {
         db.RunProc("sp_GetAllPosition", out dr_department);
         lstDeparment.DataSource = dr_department;
         lstDeparment.DataTextField = "Position_Name";
         lstDeparment.DataValueField = "Position_ID";
         lstDeparment.DataBind();
     }
     finally
     {
         db.Close();
         dr_department.Close();
     }
 }
Esempio n. 48
0
 /// <summary>
 /// �������Ƿ��Ѿ�����ϵ���б���
 /// </summary>
 /// <param name="type">��ϵ������(0:������ϵ��1:Ա����ϵ��2:�ͻ���ϵ��3:�Զ�����ϵ��)</param>
 /// <param name="staffid">�û�id</param>
 /// <param name="id">��ϵ��id</param>
 /// <returns></returns>
 public bool HaveInList(int type,int staffid,int id)
 {
     UDS.Components.Database data = new UDS.Components.Database();
     SqlParameter[] prams = {
                                data.MakeInParam("@type",SqlDbType.Int,4,type),
                                data.MakeInParam("@staffid",SqlDbType.Int,4,staffid),
                                data.MakeInParam("@id",SqlDbType.Int,4,id)
                            };
     return((data.RunProc("sp_Linkman_HaveInList",prams)==1)?true:false);
 }
Esempio n. 49
0
 /// <summary>
 /// �õ��ҵ���ϵ��
 /// </summary>
 /// <param name="type">��ϵ������(0:������ϵ��1:Ա����ϵ��2:�ͻ���ϵ��3:�Զ�����ϵ��)</param>
 /// <param name="staffid">�û�id</param>
 /// <returns></returns>
 public SqlDataReader GetMyLinkman(int type,int staffid)
 {
     UDS.Components.Database data = new UDS.Components.Database();
     SqlParameter[] prams = {
                                 data.MakeInParam("@type",SqlDbType.Int,4,type),
                                 data.MakeInParam("@staffid",SqlDbType.Int,4,staffid)
     };
     SqlDataReader dr = null;
     data.RunProc("sp_Linkman_GetList",prams,out dr);
     return(dr);
 }
Esempio n. 50
0
        /// <summary>
        /// ��Ա����
        /// </summary>
        /// <param name="StaffID">��ԱID</param>
        /// <returns>�����Ƿ�ɹ�</returns>
        public int UpdateInfo(long StaffID, string RealName, int Sex, string Birthday, string Password, string Email, string Phone, string Mobile, long PositionID, int Caste, string ContractDate
            , string InsuranceStatus
            , string AccumulationStatus
            , string IDNumber
            , string Marriage
            , string Address
            , string BirthPlace
            , string Education
            , string Features
            , string Remark
            , string InsuranceBase
            , string EndowmentCompany
            , string EndowmentPersonal
            , string UnemploymentCompany
            , string UnemploymentPersonal
            , string Injury
            , string Maternity
            , string MedicalCompany
            , string MedicalPersonal
            , string InsuranceCompanyTotal
            , string InsurancePersonalTotal
            , string AccumulationBase
            , string AccumulationCompany
            , string AccumulationPersonal
            , string staff_dept)
        {
            UDS.Components.Database db = new UDS.Components.Database();

            SqlParameter[] prams = {
                                        db.MakeInParam("@StaffID",SqlDbType.Int,4,StaffID),
                                        db.MakeInParam("@RealName",SqlDbType.VarChar,50,RealName),
                                        db.MakeInParam("@Sex",SqlDbType.Bit ,1,Sex),
                                        db.MakeInParam("@Birthday",SqlDbType.DateTime ,8,Birthday),
                                        db.MakeInParam("@Password",SqlDbType.VarChar,255,Password),
                                        db.MakeInParam("@Email",SqlDbType.VarChar,500,Email),
                                        db.MakeInParam("@Phone",SqlDbType.VarChar,50,Phone),
                                        db.MakeInParam("@Mobile",SqlDbType.VarChar,50,Mobile),
                                        db.MakeInParam("@PositionID",SqlDbType.Int,4,PositionID),
                                        db.MakeInParam("@Caste",SqlDbType.Int,4,Caste),

                                           db.MakeInParam("@ContractDate",SqlDbType.DateTime,8,ContractDate),
                                         db.MakeInParam("@InsuranceStatus",SqlDbType.VarChar,300,InsuranceStatus),
                                        db.MakeInParam("@AccumulationStatus",SqlDbType.VarChar,300,AccumulationStatus),
                                        db.MakeInParam("@IDNumber",SqlDbType.VarChar,300,IDNumber),
                                        db.MakeInParam("@Marriage",SqlDbType.VarChar,300,Marriage),
                                        db.MakeInParam("@Address",SqlDbType.VarChar,300,Address),
                                        db.MakeInParam("@BirthPlace",SqlDbType.VarChar,300,BirthPlace),
                                        db.MakeInParam("@Education ",SqlDbType.VarChar,300,Education ),
                                        db.MakeInParam("@Features",SqlDbType.VarChar,300,Features),
                                        db.MakeInParam("@Remark",SqlDbType.VarChar,300,Remark),

                                        db.MakeInParam("@InsuranceBase",SqlDbType.Money,21, decimal.Parse(InsuranceBase)),
                                        db.MakeInParam("@EndowmentCompany",SqlDbType.Money,21, decimal.Parse(EndowmentCompany)),
                                        db.MakeInParam("@EndowmentPersonal ",SqlDbType.Money,21, decimal.Parse(EndowmentPersonal )),
                                        db.MakeInParam("@UnemploymentCompany ",SqlDbType.Money,21, decimal.Parse(UnemploymentCompany )),
                                        db.MakeInParam("@UnemploymentPersonal",SqlDbType.Money,21, decimal.Parse(UnemploymentPersonal)),
                                        db.MakeInParam("@Injury",SqlDbType.Money,21, decimal.Parse(Injury)),
                                        db.MakeInParam("@Maternity ",SqlDbType.Money,21, decimal.Parse(Maternity )),
                                        db.MakeInParam("@MedicalCompany ",SqlDbType.Money,21, decimal.Parse(MedicalCompany )),
                                        db.MakeInParam("@MedicalPersonal",SqlDbType.Money,21, decimal.Parse(MedicalPersonal)),
                                        db.MakeInParam("@InsuranceCompanyTotal ",SqlDbType.Money,21, decimal.Parse(InsuranceCompanyTotal )),
                                        db.MakeInParam("@InsurancePersonalTotal",SqlDbType.Money,21, decimal.Parse(InsurancePersonalTotal)),
                                        db.MakeInParam("@AccumulationBase",SqlDbType.Money,21, decimal.Parse(AccumulationBase)),
                                        db.MakeInParam("@AccumulationCompany ",SqlDbType.Money,21, decimal.Parse(AccumulationCompany )),
                                        db.MakeInParam("@AccumulationPersonal",SqlDbType.Money,21, decimal.Parse(AccumulationPersonal)),
                                        db.MakeInParam("@staff_dept",SqlDbType.VarChar,200,staff_dept)

                                    };
            return db.RunProc("sp_UpdateStaffInfo",prams);
        }
Esempio n. 51
0
 /// <summary>
 /// �����û��Ƿ���ҪӲ��KEY��֤
 /// </summary>
 /// <param name="StaffID">��ԱID</param>
 /// <param name="IsNeedKey">�Ƿ���Ҫ��½</param>
 /// <returns>�����Ƿ�ɹ�</returns>
 public bool SetIsNeedKey(string  StaffIDs,bool IsNeedKey)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     if(StaffIDs.Length >0)
     {
         SqlParameter[] prams = {
                                    db.MakeInParam("@StaffIDs",SqlDbType.VarChar,1000,StaffIDs),
                                    db.MakeInParam("@IsNeedKey",SqlDbType.Bit ,1,IsNeedKey)
                                };
         return db.RunProc("sp_Staff_SetIsNeedKey",prams)==0?true:false;
     }
     else
         return false;
 }
Esempio n. 52
0
 /// <summary>
 /// ʹ��Ա��ְ
 /// </summary>
 /// <param name="staffids">��Աid����</param>
 /// <returns>�Ƿ�ɹ�</returns>
 public bool ReturnPosition(string staffids)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlParameter[] prams = {
                                db.MakeInParam("@StaffIDS",SqlDbType.VarChar,300,staffids)
                             };
     return((db.RunProc("sp_StaffRehab",prams)==0)?true:false);
 }
Esempio n. 53
0
        public SqlDataReader GetRoleInfo(long RoleID)
        {
            UDS.Components.Database db = new UDS.Components.Database();
            SqlDataReader dr = null;
            SqlParameter[] prams = {
                                       db.MakeInParam("@RoleID",SqlDbType.Int ,4,RoleID),
            };
            db.RunProc("sp_GetRoleInfo",prams,out dr);

            return(dr);
        }
Esempio n. 54
0
        private void btn_OK_Click(object sender, System.EventArgs e)
        {
            if(lbx_search.Items.Count>0)
            {
                string searchstring = "";
                string tmp = "";
                DateTime begintime = new DateTime();
                DateTime endtime = DateTime.Now;
                foreach(ListItem lt in lbx_search.Items)
                {
                    string [] searcharr = new string[2];
                    searcharr = lt.Value.Split(':');
                    switch(searcharr[0].Trim())
                    {
                        case "������Ա����":
                            UDS.Components.Staff staff = new UDS.Components.Staff();
                            SqlDataReader dr_staffid = staff.GetStaffIDByRealName(searcharr[1]);
                            tmp = "UDS_CM_ClientContact.MarketmanID='";
                            while(dr_staffid.Read())
                            {
                                tmp +=  dr_staffid["staff_id"] + "' or UDS_CM_ClientContact.MarketmanID='";
                            }
                            dr_staffid.Close();
                            if(tmp=="UDS_CM_ContactInfo.MarketmanID='")
                                searchstring = "1=2";
                            else
                            {
                                tmp = tmp.Substring(0,tmp.Length-37);
                                searchstring += "(" + tmp + ") and ";
                            }
                            break;

                        case "�ͻ�����":
                            UDS.Components.CM cm = new UDS.Components.CM();
                            SqlDataReader dr_clientid = cm.GetClientIDByName(searcharr[1]);
                            tmp = "UDS_CM_ClientContact.ClientID='";
                            while(dr_clientid.Read())
                            {
                                tmp +=  dr_clientid["ID"] + "' or UDS_CM_ClientContact.ClientID='";
                            }
                            dr_clientid.Close();
                            if(tmp=="UDS_CM_ClientContact.ClientID='")
                                searchstring = "1=2";
                            else
                            {
                                tmp = tmp.Substring(0,tmp.Length-34);
                                searchstring += "(" + tmp + ") and ";
                            }
                            break;
                        case "�ͻ����":
                            searchstring += "UDS_CM_ClientContact.ClientID=" + searcharr[1] + " and ";
                            break;
                        case "���۽׶�":
                        switch(searcharr[1])
                        {
                            case "����":
                                searchstring += "patindex('%trace%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "���":
                                searchstring += "patindex('%boot%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "��Ʒ�Ƽ�":
                                searchstring += "patindex('%commend%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "������":
                                searchstring += "patindex('%requirement%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "�����ύ":
                                searchstring += "patindex('%submit%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "����̸��":
                                searchstring += "patindex('%negotiate%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "��Ŀʵʩ":
                                searchstring += "patindex('%actualize%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "���ٷ���":
                                searchstring += "patindex('%traceservice%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                            case "���":
                                searchstring += "patindex('%last%',UDS_CM_ClientContact.curstatus)>=0" + " and ";
                                break;
                        }
                            break;
                        case "�ɽ�Ԥ��":
                            searchstring += "UDS_CM_ClientContact.BargainPrognosis='" + searcharr[1] + "' and ";
                            break;
                        case "�ѽ�Ǣ����":
                            searchstring += "UDS_CM_ClientContact.ContactTimes=" + searcharr[1] + " and ";
                            break;
                        case "��Ǣ����ְ��":
                            searchstring += "UDS_CM_Linkman.[Position]='" + searcharr[1] + "' and ";
                            break;
                        case "�״ν�Ǣʱ��":
                            searchstring += "UDS_CM_ClientInfo.FirstContactTime='" + searcharr[1] + "' and ";
                            break;
                        case "���һ�ν�Ǣʱ��":
                            searchstring += "UDS_CM_ClientInfo.ContactTime='" + searcharr[1] + "' and ";
                            break;
                        case "�´�Լ��ʱ��":
                            searchstring += "UDS_CM_ClientInfo.NextContactTime='" + searcharr[1] + "' and ";
                            break;
                        case "����������¼":
                            //�õ�������ʼ��(��һ -- ����)
                            begintime = DateTime.Now;
                        switch((int)DateTime.Now.DayOfWeek)
                        {
                            case 0:
                                begintime = begintime.AddDays(-6);
                                break;
                            default:
                                begintime = begintime.AddDays(1-(int)DateTime.Now.DayOfWeek);
                                break;
                        }
                            searchstring += "(UDS_CM_ClientContact.updatetime between '" + begintime.ToShortDateString() + "' and '" + endtime.ToShortDateString() + "') and ";
                            break;
                        case "����������¼":
                            //�õ�������ʼ��
                            begintime = DateTime.Now;
                            begintime = begintime.AddDays(1-DateTime.Now.Day);
                            searchstring += "(UDS_CM_ClientContact.updatetime between '" + begintime.ToShortDateString() + "' and '" + endtime.ToShortDateString() + "') and ";
                            break;

                    }
                }

                searchstring = "select * from UDS_CM_ClientInfo where ID IN (select UDS_CM_ClientInfo.ID from UDS_CM_ClientContact left join UDS_CM_ClientContact_Linkman ON UDS_CM_ClientContact.ID=UDS_CM_ClientContact_Linkman.ContactID left join UDS_CM_Linkman ON UDS_CM_ClientContact_Linkman.LinkmanID=UDS_CM_ClientContact_Linkman.id,UDS_CM_ClientInfo where UDS_CM_ClientContact.clientid=UDS_CM_ClientInfo.id and " + searchstring;
                if(searchstring.EndsWith("and "))
                {
                    searchstring = searchstring.Substring(0,searchstring.Length-4);
                }
                searchstring += " group by UDS_CM_ClientInfo.ID)";

                DataSet ds = new DataSet();
                UDS.Components.Staff staff1 = new UDS.Components.Staff();
                SqlDataReader dr_Staff = staff1.GetAllStaffs();
                DataTable dt_Staff = UDS.Components.Tools.ConvertDataReaderToDataTable(dr_Staff);
                dt_Staff.TableName = "Staff";
                ds.Tables.Add(dt_Staff);

                UDS.Components.Database db = new UDS.Components.Database();
                SqlParameter[] prams = {
                                           db.MakeInParam("@SQL",SqlDbType.NText,5000,searchstring)
                                       };
                SqlDataReader dr = null;
                db.RunProc("sp_RunSql",prams,out dr);
                DataTable dt = UDS.Components.Tools.ConvertDataReaderToDataTable(dr);
                dt.TableName = "Client";
                ds.Tables.Add(dt);

                ltl_Client.Text = dt.Rows.Count.ToString();

                ds.Relations.Add("ClientAddMan_Staff",ds.Tables["Client"].Columns["AddManID"],ds.Tables["Staff"].Columns["Staff_ID"],false);

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

            }
        }
Esempio n. 55
0
        public string GetRoleInfo(long RoleID,string FiledName)
        {
            UDS.Components.Database db = new UDS.Components.Database();
            SqlDataReader dr = null;
            SqlParameter[] prams = {
                                       db.MakeInParam("@RoleID",SqlDbType.Int ,4,RoleID),
            };
            db.RunProc("sp_GetRoleInfo",prams,out dr);
            try
            {
                if(dr.Read())
                {
                    try
                    {
                        return dr[FiledName].ToString();
                    }
                    catch
                    {
                        return "";
                    }
                }
                else
                    return "";
            }
            finally
            {

                if (db != null)
                {
                    db.Close();
                }
                if (dr != null)
                {
                    dr.Close();
                    dr.Dispose();
                }
                dr = null;
                db = null;
            }
        }
Esempio n. 56
0
 /// <summary>
 /// ���������ϵ�˷����ϵ����
 /// </summary>
 /// <returns></returns>
 public SqlDataReader GetLinkmanTypeRelation()
 {
     UDS.Components.Database data = new UDS.Components.Database();
     SqlDataReader dr = null;
     data.RunProc("sp_Linkman_GetAllLinkmanTypeData",out dr);
     return(dr);
 }
Esempio n. 57
0
 /// <summary>
 /// �����Զ�����ϵ��
 /// </summary>
 /// <param name="mlinkman"></param>
 public void UpdateCustomLinkman(CustomLinkman clinkman)
 {
     UDS.Components.Database data = new UDS.Components.Database();
     SqlParameter[] prams = {
                                data.MakeInParam("@ID",SqlDbType.Int,4,clinkman.ID),
                                data.MakeInParam("@name",SqlDbType.VarChar,100,clinkman.Name),
                                data.MakeInParam("@Gender",SqlDbType.Bit,1,clinkman.Gender),
                                data.MakeInParam("@UnitTelephone",SqlDbType.VarChar,50,clinkman.UnitTelephone),
                                data.MakeInParam("@Email",SqlDbType.VarChar,50,clinkman.Email),
                                data.MakeInParam("@UnitAddress",SqlDbType.VarChar,200,clinkman.UnitAddress),
                                data.MakeInParam("@UnitZip",SqlDbType.VarChar,50,clinkman.UnitZip),
                                data.MakeInParam("@FamilyAddress",SqlDbType.VarChar,200,clinkman.FamilyAddress),
                                data.MakeInParam("@FamilyZip",SqlDbType.VarChar,50,clinkman.FamilyZip),
                                data.MakeInParam("@Mobile",SqlDbType.VarChar,100,clinkman.Mobile),
                                data.MakeInParam("@FamilyTelephone",SqlDbType.VarChar,100,clinkman.FamilyTelephone),
                                data.MakeInParam("@Memo",SqlDbType.VarChar,1000,clinkman.Memo),
                                data.MakeInParam("@Age",SqlDbType.VarChar,50,clinkman.Age),
                                data.MakeInParam("@Type",SqlDbType.VarChar,200,clinkman.Type)
                            };
     data.RunProc("sp_Linkman_UpdateCustomLinkman",prams);
 }
Esempio n. 58
0
 public SqlDataReader GetStaffIDByRealName(string realname)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     SqlDataReader dr = null;
     SqlParameter[] prams = {
                                db.MakeInParam("@realname",SqlDbType.VarChar,100,realname)
                            };
     db.RunProc("sp_GetStaffIDByRealName",prams,out dr);
     return(dr);
 }
Esempio n. 59
0
 /// <summary>
 /// ����rolename�õ�roleid
 /// </summary>
 /// <param name="rolename">��ɫ����</param>
 /// <returns>��ɫid</returns>
 public static int GetRoleIDByName(string rolename)
 {
     UDS.Components.Database db = new UDS.Components.Database();
     int roleid = 0;
     SqlDataReader dr = null;
     SqlParameter[] prams = {
                                db.MakeInParam("@rolename",SqlDbType.VarChar,100,rolename),
                            };
     try
     {
         db.RunProc("sp_GetRoleIDFromName", prams, out dr);
         while (dr.Read())
         {
             roleid = Int32.Parse(dr["role_id"].ToString());
         }
     }
     finally
     {
         db.Close();
     }
     return(roleid);
 }
Esempio n. 60
0
 /// <summary>
 /// �����Զ�����ϵ�˷���
 /// </summary>
 /// <param name="mlinkman"></param>
 public void UpdateCustomLinkmanType(CustomLinkman clinkman)
 {
     UDS.Components.Database data = new UDS.Components.Database();
     if(clinkman.Type.IndexOf(',',0)!=-1)
     {
         string [] arrtype = clinkman.Type.Split(',');
         for(int i = 0;i<arrtype.Length;i++)
         {
             if(arrtype[i].Trim()!="")
             {
                 SqlParameter[] prams1 = {
                                             data.MakeInParam("@typeid",SqlDbType.Int,4,arrtype[i]),
                                             data.MakeInParam("@id",SqlDbType.Int,4,clinkman.ID)
                                         };
                 data.RunProc("sp_Linkman_AddCustomLinkmanType",prams1);
             }
         }
     }
 }