当前位置: 首页 > news >正文

广告案例网站全屏网站 内页怎么做

广告案例网站,全屏网站 内页怎么做,房地产开发公司网站建设方案模板,龙岗营销网站建设根据设计当MakeOld后#xff08;在读取数据库后#xff0c;或者手动调用#xff09;#xff0c;对记录(SubSonic生成的类#xff09;属性附值时#xff0c;Sonic会检测这个Value是否与原来的不同#xff0c;只有值不同时才会附值成功#xff0c;并将该列添加到DirtyCol…  根据设计当MakeOld后在读取数据库后或者手动调用对记录(SubSonic生成的类属性附值时Sonic会检测这个Value是否与原来的不同只有值不同时才会附值成功并将该列添加到DirtyColumns而DirtyColumns中的列才会被Update采用一般情况下 只要所有列中有一个列的是Dirtytrue(被更改过那么在Save时就会采用Update, 注意SubSonic中判断是否采用Update判断“全部字段集合”中是否存在一个字段被更改而生成Update命令时使用的集合是DirtyColumns集合而不是直接从全部字段集合中查找那些被更改的字段在多数情况下不会出问题但有些时候可能带来意想不到的问题参考下面的场境3。 //参考代码1             public bool IsDirty            {                get                {                    foreach(TableColumnSetting setting in this)                    {                        if(setting.IsDirty)                            return true;                    }                    return false;                }                //set                //{                //    foreach (TableColumnSetting setting in this)                //        setting.IsDirty value;                //}            } //参考代码2      public QueryCommand GetSaveCommand(string userName)        {            if(IsNew)                return GetInsertCommand(userName);             if(IsDirty)                return GetUpdateCommand(userName);             return null;        } 如果您对记录未做任何更改而直接调用 .Save()时会根据IsNew与IsDirty的取值来决定采用Insert或Update。 如果两个多是false那么就返回null.那么Save操作将什么都不做。 //参考代码3    QueryCommand cmd GetSaveCommand(userName);                if(cmd null)                    return; 场境1 Employe empnew Employe(1);//加载一个员工数据 //这个时候 IsNewfalse,IsDirtyfalse emp.Nameemp.Name; //没有改变 emp.Save();//这里的Save方法将不做任何处理   场境2 Employe empnew Employe(1); emp.NametxtName.txt;//假设您在文本框中调整了Name取值 //这个时候 isNewfalse;IsDirtytrue; emp.Save();将使用Update并且只更新Name字段。   场境3:报错) Employe empnew Employe(1); Employe backEmpnew Employe(); backEmp.CopyFrom(backEmp); //copyFrom后会backEmp.IsDirty全部是true //参考代码7 backEmp.Namexxxx; backEmp.MackOld();//将IsNew设置成False backEmp.Save(); //报错IsDirtyTrue,而DirtyColumns为空 //生成 Update Employe Set Where EmpoyeId1 这样的错误TSQL   场境4:(报错) Employe empnew Employe(1); Employe backEmpnew Employe(); backEmp.CopyFrom(backEmp); backEmp.MackOld(); backEmp.NamebackEmp.Name; backEmp.Save();//这时IsDirty是True,而DirtyColumns为空   正确作法应该在backEmp.MackOld()后再调用backEmp.MackClear(); //参考代码8       /// summary        /// Called after any property is set. Sets IsDirty to ctrue/c.        /// /summary        public void MarkClean()        {            foreach(TableSchema.TableColumnSetting setting in columnSettings)                setting.IsDirty false;            DirtyColumns.Clear();        } //参考代码4         /// summary        /// Called after Update() invokation. Sets IsNew to cfalse/c.        /// /summary        public void MarkOld()        {            IsLoaded true;            _isNew false;        } //参考代码5         /// summary        /// Copies the passed-in instance settings to this instance        /// /summary        /// param namecopyInstanceThe copy instance./param        public void CopyFrom(T copyInstance)        {            if(copyInstance null)                throw new ArgumentNullException(copyInstance);             foreach(TableSchema.TableColumnSetting setting in copyInstance.columnSettings)                SetColumnValue(setting.ColumnName, setting.CurrentValue);        } //参考代码6         /// summary        /// Sets a value for a particular column in the record        /// /summary        /// param namecolumnNameName of the column, as defined in the database/param        /// param nameoValueThe value to set the type to/param        public void SetColumnValue(string columnName, object oValue)        {            columnSettings columnSettings ?? new TableSchema.TableColumnSettingCollection();             // add the column to the DirtyColumns            // if this instance has already been loaded            // and this is a change to existing values            if(IsLoaded !IsNew)            {                TableSchema.Table schema GetSchema();                object oldValue null;                string oldValueMsg NULL;                string newValueMsg NULL;                bool areEqualOrBothNull false;                 try                {                    oldValue columnSettings.GetValue(columnName);                }                catch {}                 if(oldValue null oValue null)                    areEqualOrBothNull true;                else                {                    if(oldValue ! null)                    {                        oldValueMsg oldValue.ToString();                        areEqualOrBothNull oldValue.Equals(oValue);                    }                     if(oValue ! null)                        newValueMsg oValue.ToString();                }                 TableSchema.TableColumn dirtyCol schema.GetColumn(columnName);                 if(dirtyCol ! null !areEqualOrBothNull)                {                    string auditMessage String.Format(Value changed from {0} to {1}{2}, oldValueMsg, newValueMsg, Environment.NewLine);                    TableSchema.TableColumn dirtyEntry DirtyColumns.GetColumn(columnName);                    if(dirtyEntry ! null)                    {                        DirtyColumns.Remove(dirtyEntry);                        auditMessage String.Concat(dirtyCol.AuditMessage, auditMessage);                    }                     dirtyCol.AuditMessage auditMessage;                    DirtyColumns.Add(dirtyCol);                }            }             columnSettings.SetValue(columnName, oValue);//这里最终调用参考代码7         } //参考代码7             /// summary            /// Gets or sets the current value.            /// /summary            /// valueThe current value./value            public object CurrentValue            {                get { return _currentValue; }                set                {                    if(value null _currentValue null)                        return;                     if(value ! null)                    {                        if(value.Equals(_currentValue))                            return;                    }                     _currentValue value;                    _isDirty true;                }            }转载于:https://www.cnblogs.com/wdfrog/archive/2010/06/30/1768159.html
http://www.pierceye.com/news/84185/

相关文章:

  • 网站建设胶州家园网站维护必须要会什么
  • 网站开发实例教程深圳装修公司上市的有哪几家
  • 远程教育网站建设方案网站开发做美工
  • 网站建设的步骤过程视频学校网站建设工作简报
  • 专业设计网站排行榜做境外碎片化旅游的网站
  • 网站建设翻译谁提供seo网站推广软件
  • 网站都有什么类型公司门户网站建设
  • 哪有做网站公司巢湖网 网站
  • php网站开发是做什么的微信小程序注册后怎么登录
  • 网站生成静态页面工具家庭千兆网络组建方案
  • 做期货资讯网站网站登录界面源码
  • 备案个人网站名称推荐wordpress 样式
  • 桂林网站优化公司施工企业自营率怎么算
  • 常用的网站制作开发小程序的软件有哪些
  • 微信公众号如何做网站化工企业建网站
  • 企业门户网站实现百度网盘链接
  • 南通公司网站建设品牌的品牌推广设计
  • 泉州百度网站推广建程网是干嘛的
  • 网站规划与网页设计总结青岛行业网站建设电话
  • 学网站建设的专业叫什么全心代发17做网站
  • 滁州网站建设价格做公众号好还是网站好
  • 做什么网站赚钱最快三水顺德网站建设
  • 赤峰城乡建设局网站顺德外贸网站建设
  • 建网站教程视频下载网站建设公司怎样选
  • 公司怎么搭建自己网站南阳响应式网站制作
  • 网站建设栏目分级技术外包网站
  • 企业网站建设课程设计新闻发布会策划
  • 四川建设厅网上查询网站快速建站平台源码
  • 呼和浩特建设工程信息网站网页制作教程软件
  • 大气企业网站源码php网站数据流程