1、 ););链式操作: /*var oDiv = $(); oDiv.html(hello oDiv.css(background,red oDiv.click(function()alert(123);*/).html().css(建议熟悉了,再写链式写法;取值和赋值合体:赋值和取值用的同一种方法,只不过是通过有没有参数来决定是取值还是赋值; /oDiv.innerHTML = ; /赋值 /alert( oDiv.innerHTML ); /取值 /$( /alert( $().html() ); css(width200px) /设置width是200px;) /获取width的值;取值和
2、赋值:获取的时候只能获取一个,赋值的时候赋值到所有的;li /当一组元素的时候,取值是一组中的第一个;会弹出内容:aaa /当一组元素的时候,赋值是一组中的所有元素$()下的常用方法attr() /alert($(div).attr(title); 获取title属性456 /设置titleclassbox /设置class(二)C#源码using System;using System.Collections.Generic;using System.Data;using System.Linq;using System.Text;namespace IDAL public interfac
3、e ISQLAbl / / 连接数据库/summaryparam name=sqlreturns/returnsbool Connect(String sql); /连接数据库bool Open(); /打开数据库bool Close();/ 关闭数据库DataTable GetTable(long getTableID);DataTable GetTable( List getTableID);DataTable GetTable(string getsWhere);DataTable GetTable(string getsWhere, List keys,List values);Dat
4、aTable GetTable(string getsWhere, int top);DataTable GetTable(string getsWhere, string orders);DataTable GetTable(List getTableID, string orders);DataTable GetTable(string getsWhere, int top, string orders); bool Edit(long EidtID, DataTable editTable); /编辑ID bool Edit(String editWhere, DataTable edi
5、tTable);long Edit(List editIds, DataTable editTable);/ 编辑多IDbool Add(DataTable addTable);/增加表单long DUI(string cmd);object GetObject(string cmd);bool Del(long delID);long Del(List delListID);long Del(string delWhere); using Maticsoft.Common;using Maticsoft.Model;namespace Maticsoft.BLL / ArticleClass
6、 public partial class ArticleClassprivate readonly Maticsoft.DAL.ArticleClass dal=new Maticsoft.DAL.ArticleClass();public ArticleClass()#region BasicMethod/ / 得到最大IDpublic int GetMaxId() return dal.GetMaxId();/ 是否存在该记录public bool Exists(int id) return dal.Exists(id);/ 增加一条数据public bool Add(Maticsoft
7、.Model.ArticleClass model) return dal.Add(model);/ 更新一条数据public bool Update(Maticsoft.Model.ArticleClass model) return dal.Update(model);/ 删除一条数据public bool Delete(int id) return dal.Delete(id);public bool DeleteList(string idlist ) return dal.DeleteList(idlist );/ 得到一个对象实体public Maticsoft.Model.Art
8、icleClass GetModel(int id) return dal.GetModel(id);/ 得到一个对象实体,从缓存中public Maticsoft.Model.ArticleClass GetModelByCache(int id) string CacheKey = ArticleClassModel- + id; object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey); if (objModel = null)try objModel = dal.GetModel(id); if (objModel
9、!= null)int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt(ModelCacheMaticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);catch return (Maticsoft.Model.ArticleClass)objModel;/ 获得数据列表public DataSet GetList(string strWhere) return dal.Get
10、List(strWhere);/ 获得前几行数据public DataSet GetList(int Top,string strWhere,string filedOrder) return dal.GetList(Top,strWhere,filedOrder);public List GetModelList(string strWhere) DataSet ds = dal.GetList(strWhere); return DataTableToList(ds.Tables0); DataTableToList(DataTable dt) List modelList = new L
11、ist 0)Maticsoft.Model.ArticleClass model;for (int n = 0; n rowsCount; n+) model = dal.DataRowToModel(dt.Rowsn); if (model !modelListGiSpx.Add(model); return modelList;/ 分页获取数据列表public int GetRecordCount(string strWhere) return dal.GetRecordCount(strWhere);public DataSet GetListByPage(string strWhere
12、, string orderby, int startIndex, int endIndex) return dal.GetListByPage( strWhere, orderby, startIndex, endIndex);/public DataSet GetList(int PageSize,int PageIndex,string strWhere)/ /return dal.GetList(PageSize,PageIndex,strWhere);/#endregion BasicMethod#region ExtensionMethodMaticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1