Esempio n. 1
0
        public List<SmsPeopleOR> selectSmsPeopleData(string orgbhWhere)
        {
            if (string.IsNullOrEmpty(orgbhWhere))
                return null;

            string sql = @"select bu.* from t_SmsPeople bu
            inner join t_Bank b on b.orgbh= bu.orgbh where " + orgbhWhere;
            DataTable dt = null;
            try
            {
                dt = dbMsSql.ExecuteQuery(sql);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            if (dt == null)
                return null;
            List<SmsPeopleOR> listSmsP = new List<SmsPeopleOR>();
            foreach (DataRow dr in dt.Rows)
            {
                SmsPeopleOR obj = new SmsPeopleOR(dr);
                listSmsP.Add(obj);
            }
            return listSmsP;
        }
Esempio n. 2
0
        /// <summary>
        /// 获取插入数据
        /// </summary>
        public string GetInsertSql(SmsPeopleOR smsPeople)
        {
            string sql = @"insert into t_SmsPeople (Id,Name,MobileNO,SendMoney,Description,
            orgbh)
            values ('@Id','@Name','@MobileNO',SendMoney,'@Description',
            '@orgbh')";
            sql = sql.Replace("@Id", smsPeople.Id);	//
            sql = sql.Replace("@Name", smsPeople.Name);	//姓名
            sql = sql.Replace("@MobileNO", smsPeople.Mobileno);	//手机号码
            sql = sql.Replace("@SendMoney", smsPeople.Sendmoney.ToString());	//发送金额
            sql = sql.Replace("@Description", smsPeople.Description);	//描述
            sql = sql.Replace("@orgbh", smsPeople.Orgbh);	//所属机构

            return sql;
        }