每日一剂 14-5-28

1 case when then

http://blog.sina.com.cn/s/blog_4e6dffee0100iwll.html

2  <asp:RadioButtonList ID="ctrl_维修级别ID" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ctrl_维修级别ID_SelectedIndexChanged"                                         RepeatDirection="Horizontal">                                     </asp:RadioButtonList>

3,主表会把外键表作为实体属性使用(引用过来)Note:ThisKey(主表主键);OtherKey (外键表列名)

public partial class T_ArtificialLevel : INotifyPropertyChanging, INotifyPropertyChanged {

private EntitySet<T_LevelBase> _T_LevelBase;

[global::System.Data.Linq.Mapping.AssociationAttribute(Name="T_ArtificialLevel_T_LevelBase", Storage="_T_LevelBase", ThisKey="ID", OtherKey="人工级别ID")] public EntitySet<T_LevelBase> T_LevelBase { }

}

4,USE [CHIVAST_SMS]

GO

UPDATE [dbo].[T_SYS_Right]    SET [权限地址] = '/Translation/TranslationManage.aspx?type=M'  WHERE [权限名称] = '翻译件管理' GO

---------------------------------------------------------------------------------------------

USE [CHIVAST_SMS] GO

INSERT INTO [dbo].[T_SYS_Role_Right]    ([角色ID]  ,[权限ID])  VALUES 

((select top 1 ID from T_SYS_Right where 权限名称 = '受理人权限'),      

(select top 1 ID from T_SYS_Role where 角色名称 = '系统管理员'))

GO

---------------------------------------------------------------------------------------------

USE [CHIVAST_SMS] GO

INSERT INTO [dbo].[T_SYS_Role_Right]            ([角色ID]            ,[权限ID])      VALUES            ((select top 1 ID from T_SYS_Right where 权限名称 = '中心领导权限'),       (select top 1 ID from T_SYS_Role where 角色名称 = '系统管理员')) GO

5,动态跨行rowspan(列内容相同时)

public static void GroupRows(GridView GridView1, int cellNum)        

{         

    int i = 0, rowSpanNum = 1;            

while (i < GridView1.Rows.Count - 1)            

{                

GridViewRow gvr = GridView1.Rows[i];

   for (++i; i < GridView1.Rows.Count; i++)                

{                    

GridViewRow gvrNext = GridView1.Rows[i];                    

if (gvr.Cells[cellNum].Text == gvrNext.Cells[cellNum].Text)                  

   {                        

gvrNext.Cells[cellNum].Visible = false;                        

rowSpanNum++;                  

   }                   

  else                    

{                        

gvr.Cells[cellNum].RowSpan = rowSpanNum;                        

rowSpanNum = 1;                        

break;                    

}

if (i == GridView1.Rows.Count - 1)                   

  {                        

gvr.Cells[cellNum].RowSpan = rowSpanNum;                    

}                

}            

}        

}

posted @ 2014-05-29 23:37  Zhangxueliang  阅读(136)  评论(0编辑  收藏  举报