• 一些基本的项目开发规范.慢慢总结中..


    一. 命名规范

        1 .Net控件命名规则

          控件标识符 +  意义标识符

      如:Lab标签

          Lab    +  UserName

      其他的控件标识符[主要是控件名简写,以及自己的习惯] : TextBox(Txt),Button(Btn),DropDownList(Drp) ....

     2.存储过程命名规范.

     (1) 存储过程前缀 + 表名 + [作用字段名]+功能标识符

      UP     + TableName+ ByID  + Sel

         即:UserProcedure +TableName +ByID +Select

         Select---->Sel

       Update--->Upd 

       Delete---->Del

         Insert---->Ins

      (2)其他存储过程采用

       Get + xx + By + Parameter或者

       Get + xx + By +   Parameter1 + Parameter2

    二.网页对应CS文件编写规范.

    代码
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    namespace WebUI.Manage.Manageyewu
    {

    protectedvoid Page_Load(object sender, EventArgs e)
    {
    if (!IsPostBack)
    {
    BindControls();
    //首先初始化控件,主要用来绑定控件的值
    BindStyle(); //用来设置某些控件的样式,或者是否需要显示等等.
    BindJsEvents(); //加载控件需要执行的事件,一般是JS事件
    }
    }

    privatevoid BindStyle()
    {
    ChangeLabUserDisplay();
    }

    privatevoid ChangeLabUserDisplay()
    {
    BtnSelCheckBox.Style.Add(
    "Display", "none");
    }

    privatevoid BindJsEvents()
    {
    SelAllCheckBox();
    }

    privatevoid SelAllCheckBox()
    {
    BtnSelCheckBox.Attributes.Add(
    "onclick", "return CheckSe()");
    }

    privatevoid BindControls()
    {
    BindRepNews();
    }

    privatevoid BindRepNews()
    {
    RepNews.DataSource
    = Dt;
    RepNews.DataBind();
    }

    }

    }

    三.变量命名规范.

    1.类中公共全局变量命名:UpperCase

    2.类中私有全局变量命名:lowerCase

    3.方法中变量命名:lowercase

    文章很初级..待续啊...有什么不好的。希望路过的朋友提出来哈。

       

  • 相关阅读:
    Beans
    HDU 1175 连连看
    HDU 1241 Oil Deposits dfs && bfs
    HDU1312:Red and Black
    背包问题
    canvas 和 svg
    前端性能优化---DOM操作
    四种常见的 POST 提交数据方式
    [转]浏览器缓存详解: expires, cache-control, last-modified, etag详细说明
    URL和URI
  • 原文地址:https://www.cnblogs.com/eastday/p/1745053.html
Copyright © 2020-2023  润新知