Example #1
0
        /// <summary>
        /// 获取用户个人信息
        /// </summary>
        /// <param name="strAccount">用户名</param>
        /// <returns></returns>
        public PersonInfo Account_PersonInfo_Get(string strAccount)
        {
            DataSet ds = dal.Get_AccountList("Power_Accounts.AcountName='" + strAccount + "'");
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                PersonInfo Person = new PersonInfo();
                DataRow dr = ds.Tables[0].Rows[0];
                Person.AcountName = dr["AcountName"].ToString();
                Person.ADD_Home = dr["ADD_Home"].ToString();
                Person.BIRTHDAY = dr["BIRTHDAY"].ToString().Equals("") ? DateTime.Parse("1900-01-01 00:00:00") : DateTime.Parse(dr["BIRTHDAY"].ToString());
                Person.Email = dr["Email"].ToString();
                Person.Fax_No_Dept = dr["Fax_No_Dept"].ToString();
                Person.ICQ_NO = dr["ICQ_NO"].ToString();
                Person.MOBIL_NO = dr["MOBIL_NO"].ToString();
                Person.MOBIL_NO_HIDDEN = bool.Parse(dr["MOBIL_NO_HIDDEN"].ToString());
                Person.MSN = dr["MSN"].ToString();
                Person.Post_NO_Home = dr["Post_NO_Home"].ToString();
                Person.QQ_NO = dr["QQ_NO"].ToString();
                Person.Sex = bool.Parse(dr["Sex"].ToString());
                Person.Tel_No_Dept = dr["Tel_No_Dept"].ToString();
                Person.Tel_NO_Home = dr["Tel_NO_Home"].ToString();
                Person.TrueName = dr["TrueName"].ToString();
                Person.DEPT_NAME = dr["DEPT_NAME"].ToString().Equals("") ? "离职/外部人员" : dr["DEPT_NAME"].ToString();

                return Person;
            }
            else
            {
                return null;
            }
        }
Example #2
0
 /// <summary>
 /// 用户个人信息
 /// </summary>
 /// <param name="Person">个人信息对象</param>
 /// <returns></returns>
 public int Account_PersonInfo_Update(PersonInfo Person)
 {
     return dal.Account_PersonInfo_Update(Person);
 }
Example #3
0
        /// <summary>
        /// 用户个人信息
        /// </summary>
        /// <param name="Person">个人信息对象</param>
        /// <returns></returns>
        public int Account_PersonInfo_Update(PersonInfo Person)
        {
            SqlParameter[] paras =
                {
                    new SqlParameter("@AcountName",SqlDbType.NVarChar,20),
                    new SqlParameter("@Sex",SqlDbType.Bit),
                    new SqlParameter("@BIRTHDAY",SqlDbType.DateTime),
                    new SqlParameter("@Tel_No_Dept",SqlDbType.VarChar,50),
                    new SqlParameter("@Fax_No_Dept",SqlDbType.VarChar,50),
                    new SqlParameter("@MOBIL_NO",SqlDbType.VarChar,50),
                    new SqlParameter("@MOBIL_NO_HIDDEN",SqlDbType.Bit),
                    new SqlParameter("@Email",SqlDbType.VarChar,50),
                    new SqlParameter("@QQ_NO",SqlDbType.VarChar,50),
                    new SqlParameter("@MSN",SqlDbType.VarChar,50),
                    new SqlParameter("@ICQ_NO",SqlDbType.VarChar,50),
                    new SqlParameter("@ADD_Home",SqlDbType.NVarChar,500),
                    new SqlParameter("@Post_NO_Home",SqlDbType.VarChar,50),
                    new SqlParameter("@Tel_NO_Home",SqlDbType.VarChar,50)
                };

            paras[0].Value = Person.AcountName;
            paras[1].Value = Person.Sex;
            paras[2].Value = Person.BIRTHDAY;
            paras[3].Value = Person.Tel_No_Dept;
            paras[4].Value = Person.Fax_No_Dept;
            paras[5].Value = Person.MOBIL_NO;
            paras[6].Value = Person.MOBIL_NO_HIDDEN;
            paras[7].Value = Person.Email;
            paras[8].Value = Person.QQ_NO;
            paras[9].Value = Person.MSN;
            paras[10].Value = Person.ICQ_NO;
            paras[11].Value = Person.ADD_Home;
            paras[12].Value = Person.Post_NO_Home;
            paras[13].Value = Person.Tel_NO_Home;

            try
            {
                int iReturn;
                int i = DbHelperSQL.RunProcedure("[Account_PersonInfo]", paras, out iReturn);
                return iReturn;
            }
            catch
            {
                return -1;
            }
        }