随笔-5  评论-1  文章-7  trackbacks-0
  2008年4月11日
posted @ 2008-04-11 16:10 romce 阅读(7) | 评论 (0)编辑
     摘要:

///用户数据结构
function _tagUser()
{
this.UserId = 0; //0-4
this.UserName = ""; //5-

this.Parse = function(VarTypeUser)
{
for (var i=0;i VarTypeUser[i] = String.fromCharCode(VarTypeUser.charCodeAt(i)^0xFFFF);
this.UserId = VarTypeUser.substr(0,4); //0-4
this.UserName = VarTypeUser.substr(5); //4--
}
  阅读全文
posted @ 2008-04-11 14:50 romce 阅读(11) | 评论 (1)编辑
  2008年4月10日
     摘要: DataGrid 通过内部控件获取所在控件的列索引, 原来以为列所引很容易通过属性得到,没想到费了一番周转,花了不少时间,太过费劲了,不知有更简单的方法没?


foreach (DataGridItem i in this.DtGrid.Controls[0].Controls)
{
if (i.ItemType == ListItemType.Header)
{
for (int month_i = 1; month_i <= 12; month_i++)
{
Label myLabel = (Label)i.FindControl("lblMonth" + month_i.ToString());
myLabel.Text = myYear.  阅读全文
posted @ 2008-04-10 12:41 romce 阅读(8) | 评论 (0)编辑
  2008年4月8日
     摘要: //对应年月的预算映射
string[] budgetArray = new string[12];
string[] actArray = new string[12];

budgetArray[0] = vi.Rows[i][vi.Budget1Column.ColumnName].ToString();
budgetArray[1] = vi.Rows[i][vi.Budget2Column.ColumnName].ToString();
budgetArray[2] = vi.Rows[i][vi.Budget3Column.ColumnName].ToString();
budgetArray[3] = vi.Rows[i][vi.Budget4Column.ColumnName].ToString();
  阅读全文
posted @ 2008-04-08 12:39 romce 阅读(9) | 评论 (0)编辑
  2008年4月7日
     摘要: //纵列合计
DS_PlanPrice.vi_PlanPriceRow drTotal = vi.Newvi_PlanPriceRow();
drTotal.ProductId = Convert.ToString(dtProduct.Rows[i][dtProduct.ProductIdColumn.ColumnName]);
drTotal.PriceTypeName = "Total";

foreach (DS_PlanPrice.vi_PlanPriceRow vRow in vi.Rows)
{
if (vRow.ProductId == dtProduct.Rows[i][dtProduct.ProductIdColumn.ColumnName].ToString())
  阅读全文
posted @ 2008-04-07 12:43 romce 阅读(11) | 评论 (0)编辑
  2008年4月3日
     摘要: readonly 关键字与 const 关键字不同。

1. const 字段只能在该字段的声明中初始化。
readonly 字段可以在声明或构造函数中初始化。因此,根据所使用的构造函数,readonly 字段可能具有不同的值。

2. const 字段是编译时常数,而 readonly 字段可用于运行时常数。

3. const 默认就是静态的,而 readonly 如果设置成静态的就必须显示声明。
  阅读全文
posted @ 2008-04-03 01:20 romce 阅读(21) | 评论 (0)编辑
  2008年3月25日
posted @ 2008-03-25 16:35 romce 阅读(16) | 评论 (0)编辑
     摘要: ///
/// 在页面显示出对应的年月
///

protected void YearMonthBind(string companyID, int startMonth)
{
int myYear = Convert.ToInt32(dropYear.SelectedValue);
int myMonth = startMonth;

foreach (DataGridItem i in this.DtGrid.Controls[0].Controls)
{
  阅读全文
posted @ 2008-03-25 13:54 romce 阅读(5) | 评论 (0)编辑
  2008年3月21日
     摘要: 定义类的两种基本方式:

(1) 利用函数构造类型。

function Foo(text, url) {
this.text = text;
this.url = url;
this.render = function() {
document.write('' + this.text + '');
}
}

  阅读全文
posted @ 2008-03-21 16:00 romce 阅读(8) | 评论 (0)编辑
     摘要: 在原有Repeater中嵌套Repeater:  阅读全文
posted @ 2008-03-21 12:56 romce 阅读(5) | 评论 (0)编辑