cefriend的专栏

cefriendID:cefriend
1699次访问,排名2万外好友16人,关注者12
cefriend的文章
原创 9 篇
翻译 0 篇
转载 1 篇
评论 2 篇
最近评论
dming4:未能加载文件或程序集“ASPnetPagerV2netfx2_0”或它的某一个依赖项。系统找不到指定的文件。
?????????????
conannb:收藏了 ths
文章分类
收藏
    相册
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 项目中的精华功能讲解:相信大家都用过CSDN 中结贴的功能吧(弹出的小黄窗体)收藏

    新一篇: 以前的一个博客地址

    相信大家都用过CSDN 中结贴的功能吧(弹出的小黄窗体)

    如下图所示:

    这个功能可以大家有时在项目中也要用到,我项目中就用到过

    具体实现:

    前台:

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Import Namespace="System.Data" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        
    <title></title>
        
    <script language="javascript" type="text/javascript">
            
    <!--
            
    //如CSDN一样的提示层
            function wfsr(txt){
            event.cancelBubble
    =true
            oStr
    = "<div id='tip' style='position:absolute;border:1px solid  #000000;background-color:#ff8080;font-size:9pt;color:#FFFFFF;;filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=0,OffY=0,Color=gray,Positive=true);display:none'></div>";
            
    if(typeof(tip)=="undefined")
            document.body.insertAdjacentHTML(
    "BeforeEnd",oStr)
            tip.innerHTML
    ="分配总金额:"+Number(document.getElementById("lbBUDGT02").value) + "<br/>你目前可分配金额:"+ (Number(document.getElementById("lbBUDGT02").value)-Number(document.getElementById("lbVal02").value));
            tip.style.top
    =event.clientY+10
            tip.style.left
    =event.clientX+10
            tip.style.display
    =''
            }

            document.onclick
    =function(){
            
    if(typeof(tip)!=="undefined"&&event.srcElement.id!="tip"&&event.srcElement.parentElement.id!='tip')
            tip.style.display
    ="none"
            }

            
            
    function   myPosition(obj){   
              
    var   t   =   obj.offsetTop,l   =   obj.offsetLeft;   
                      
    while   (obj=   obj.offsetParent){   
              t   
    +=   obj.offsetTop;     
              l   
    +=   obj.offsetLeft;   
                      }
       
                      alert(t);   
                      alert(l);   
              }
       

                
    function clearNoNum(obj)
                
    {
                    
    //先把非数字的都替换掉,除了数字和.
                    obj.value = obj.value.replace(/[^d.]/g,"");
                    
    //必须保证第一个为数字而不是.
                    obj.value = obj.value.replace(/^./g,"");
                    
    //保证只有出现一个.而没有多个.
                    obj.value = obj.value.replace(/.{2,}/g,".");
                    
    //保证.只出现一次,而不能出现两次以上
                    obj.value = obj.value.replace(".","$#$").replace(/./g,"").replace("$#$",".");
                }

                
    function   chkN(str)
                
    {
                    
    if(/D/.test(str.value)){alert('只能输入数字');str.value='0.00';}
                }
       
                
    function setVal02(obj)
                
    {
                    document.getElementById(
    "lbVal02").innerText="";
                    
    var sum = 0;
                    
    var txts =  document.getElementById('<%=objGridView.ClientID%>').getElementsByTagName("INPUT");

                    
    for(var i=0;i<txts.length;i++)
                    
    {    
                        
    if(txts[i].type=="text")
                        
    {
                            sum 
    += Number(txts[i].value);
                            document.getElementById(
    "lbVal02").value = sum;
                        }

                    }

                }

                
    function Chk_BUDGT02BUDGT03()
                
    {
                    
    var budgt03 = document.getElementById("lbVal02").value;
                    
    var budgt02 = document.getElementById("lbBUDGT02").value;
                    
    if(Number(budgt03)>Number(budgt02))
                    
    {
                        alert(
    "分配额总和"+budgt03+"不能大于可分配额"+budgt02 +",请重输检查输入");//给于提示
                        return false;
                    }

                }

            
    //-->    
        
    </script>

        
    <link href="../Css/style.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
        
    <form id="form1" runat="server">
            
    <div style="text-align: center">
                
    <table style="width: 100%" align="center" border="1" cellspacing="0" rules="rows">
                    
    <tr>
                        
    <td colspan="5" align="left">
                        当前位置:
    <asp:Label ID="lbPosition" runat="server" Text="Label"></asp:Label>
                            
    <asp:DropDownList ID="ddlBonus" runat="server" OnSelectedIndexChanged="ddlBonus_SelectedIndexChanged" AutoPostBack="True">
                            
    </asp:DropDownList></td>
                    
    </tr>
                    
    <tr>
                        
    <td colspan="5">
                            
    <asp:Label ID="lbddlBonusText" runat="server" Text="Label"></asp:Label><br />
                        
    <div style="display:none">(<asp:Label ID="lbYear" runat="server" Text="Label"></asp:Label><asp:Label ID="lbReason"
                            runat
    ="server" Text="Label"></asp:Label>季)</div></td>
                    
    </tr>
                    
    <tr>
                        
    <td style="width: 100px; height: 23px;">部门:<asp:Label ID="lbSText" runat="server" Text='<%#strLbSTEXT %>'></asp:Label></td>
                        
    <td style="height: 23px;" colspan="3">
                        (上次结余:
    <asp:Label
                            
    ID="lbBUDGT" runat="server" Text="Label"></asp:Label>
                        || 本部门总额:
    <asp:Label ID="lbBUDGT01" runat="server" Text="Label"></asp:Label><asp:TextBox
                            
    ID="lbBUDGT02" runat="server"></asp:TextBox></td>
                        
    <td style="width: 100px; height: 23px;">
                        
    </td>
                    
    </tr>
                    
    <tr>
                        
    <td colspan="5">
                        
    <asp:GridView ID="objGridView" runat="server" Width="100%" AutoGenerateColumns="False" OnRowDataBound="objGridView_RowDataBound">
                            
    <Columns>
                                
    <asp:TemplateField HeaderText="序号">
                                    
    <ItemTemplate>
                                        
    <asp:Label ID="lbID" runat="server" Text='<%#Container.DataItemIndex+1%>'></asp:Label>
                                    
    </ItemTemplate>
                                    
    <HeaderStyle Width="48px" />
                                    
    <ItemStyle Width="48px" />
                                
    </asp:TemplateField>
                                
    <asp:BoundField DataField="SNAME" HeaderText="姓名" >
                                    
    <HeaderStyle Width="50%" />
                                    
    <ItemStyle Width="50%" />
                                
    </asp:BoundField>
                                
    <asp:BoundField DataField="KQXS"  HeaderText="季度缺勤信息" HtmlEncode="False" >
                                    
    <HeaderStyle Width="12%" />
                                    
    <ItemStyle Width="12%" />
                                
    </asp:BoundField>
                                
    <asp:BoundField DataField="VAL01" HeaderText="标准绩效工资" HtmlEncode="False" >
                                    
    <HeaderStyle Width="12%" />
                                    
    <ItemStyle Width="12%" />
                                
    </asp:BoundField>
                                
    <asp:TemplateField HeaderText="二次分配额">
                                    
    <EditItemTemplate>
                                    
    </EditItemTemplate>
                                    
    <ItemTemplate>
                                        
    <asp:Label ID="Label1" runat="server" Text='<%# Bind("VAL02") %>' style="display:none;"></asp:Label>

                                        
    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("VAL02") %>' Width="100px" onmouseout="tip.style.display='none';"  onmouseover='wfsr(this);this.select();this.focus();'  onclick="wfsr(this);this.select();this.focus();" onchange="setVal02(this);"></asp:TextBox>
                                    
    </ItemTemplate>
                                
    </asp:TemplateField>   
                            
    </Columns>
                           
                        
    </asp:GridView>
                        
    </td>
                    
    </tr>
                    
    <tr>
                        
    <td style="width: 100px; height: 23px;">
                            合计:
    </td>
                        
    <td style="width: 100px; height: 23px;">
                        
    </td>
                        
    <td style="width: 100px; height: 23px;">
                        
    </td>
                        
    <td style="width: 100px; height: 23px;">
                        
    </td>
                        
    <td style="width: 100px; height: 23px;">
                            
    <asp:TextBox ID="lbVal02" style="border:0px" ReadOnly="true" runat="server"></asp:TextBox></td>
                    
    </tr>
                    
    <tr>
                        
    <td colspan="5" style="height: 23px">
                            
    <hr color="#bed6ff" noshade="noshade" />
                            
    <asp:GridView ID="objForm" runat="server" Width="100%" AutoGenerateColumns="False">
                                
    <Columns>
                                    
    <asp:BoundField DataField="SNAME2" HeaderText="人力资源审核人">
                                        
    <HeaderStyle Width="30%" />
                                        
    <ItemStyle Width="30%" />
                                    
    </asp:BoundField>
                                    
    <asp:BoundField DataField="ADVISE" HeaderText="审核意见" />
                                
    </Columns>
                            
    </asp:GridView>
                        
    </td>
                    
    </tr>
                    
    <tr>
                        
    <td colspan="5" style="height: 69px">
                        
    <hr color="#b6d3f1" noshade="noshade" />
                        
    <table>
                            
    <tr>
                                
    <td style="height: 26px"><asp:Button ID="btnSave" runat="server" Text="保 存" OnClick="btnSave_Click" OnClientClick="return Chk_BUDGT02BUDGT03();"/>
                                    
    <asp:Button ID="btnOK" runat="server" Text="提 交" OnClick="btnOK_Click" OnClientClick="return confirm('是否发起流程');"/>
                                    
    <asp:Button ID="btnCancel" runat="server" Text="取 消"/></td>
                            
    </tr>
                        
    </table>
                        
    </td>
                    
    </tr>
                
    </table>
            
    </div>

        
    </form>
    </body>
    </html>

     

    后台: 

    //*******************************************