`
philix
  • 浏览: 80647 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

codecharge,java 常用代码参考

阅读更多

***

//DoLogin_OnClick

  if (Utils.getUserId(e.getPage()) != null ) { 
     String userId = DBTools.toSql(Utils.getUserId(e.getPage()), JDBCConnection.TEXT, "Connection1");
     SessionStorage.getInstance(e.getPage().getRequest()).setAttribute("User_Name", 
	 DBTools.dLookUp("User_Name","Users","User_ID="+userId,"Connection1"));
 }
 
//Form1_Insert1_OnClick

  e.getPage().setRedirectString("InsertMessagePage.do");


//Form1_Update1_OnClick

  e.getPage().setRedirectString("UpdateMessagePage.do");

 
//Tasks_BeforeShowRow

  if(e.getGrid().getControl("Estimated_Time").getValue() != null && 
      Utils.convertToDouble(e.getGrid().getControl("Estimated_Time").getValue()).doubleValue()>0 ){
    e.getGrid().getControl("Task_Percent").setValue( 
      (Utils.convertToDouble(e.getGrid().getControl("Expended_Time").getValue()).doubleValue()*100)/Utils.convertToDouble(e.getGrid().getControl("Estimated_Time").getValue()).doubleValue()); 
  } else {
    e.getGrid().getControl("Task_Percent").setValue(0);
  }
 
//DoLogin_OnClick

  if (Utils.getUserId(e.getPage()) != null ) { 
     String userId = DBTools.toSql(Utils.getUserId(e.getPage()), JDBCConnection.TEXT, "Connection1");
     SessionStorage.getInstance(e.getPage().getRequest()).setAttribute("User_Name", 
	 DBTools.dLookUp("User_Name","Users","User_ID="+userId,"Connection1"));
 }
 
//Users BeforeShowRow

  Link link1 = e.getGrid().getLink("Link1");
  link1.setHrefSourceValue("UserPage.do");
  link1.setPreserveType(PreserveParameterType.GET);
  link1.clearParameters();
  LinkParameter userId = new LinkParameter("user_id", "", ParameterSource.EXPRESSION);
  userId.setValue("1");
  link1.addParameter(userId);
  link1.setValue(e.getGrid().getControl("First_Name").getValue() + " " + e.getGrid().getControl("Last_Name").getValue() );

 
//Registration_MonthBox_BeforeShow

  if (StringUtils.isEmpty(e.getPage().getParameter("MonthBox"))) {
    e.getControl().setValue(new java.text.SimpleDateFormat("M").format(new Date()));
  }
 
//Form1_BeforeShow

   if (e.getRecord().isEditMode()) {
    //Edit Mode
  } else {
    //Add Mode
  }
 
class LUI {
  public void lastUpdateInfo(Page page) {
    page.getRecord("Tasks").getControl("LastUpdateDate").setValue(new Date());
    page.getRecord("Tasks").getControl("LastUpdateUserid").setValue(Utils.getUserId(page));
  }
}
//Tasks_BeforeInsert

  new LUI().lastUpdateInfo(e.getPage());


//Tasks_BeforeUpdate

  new LUI().lastUpdateInfo(e.getPage());

 
 if ("profile".equals(e.getPage().getHttpGetParams().getParameter("mode"))) {
	((com.codecharge.util.ModelAttribute)e.getModel().getAttribute("disabled")).setValue("disabled");
  }
 
e.getControl().setValue(e.getPage().getResourceString("CCS_Today"));
 

***

 

分享到:
评论

相关推荐

    codecharge studio 手册

    CodeCharge Studio集成了大量功能强大的IDE,提高了代码生成速度。您可以使用 ASP, JSP, PHP, Perl, ColdFusion, ASP.NET快速生成动态无bug的网页,然后通 过Studio强大的代码编辑器来编辑和定制您的程式。 内含的...

    codecharge 4.3, 特别文件下载

    CCProject.dll 博文链接:https://philix.iteye.com/blog/788095

    CodeCharge Studio4.1最新版

    您可以利用CodeCharge 来产生多种程序语言的程序源代码 (例如:ASP,PHP 3/4,JSP,... 等),快速地建设互动式网站。CodeCharge 提供您最快速且最简易的方式建立网页应用程序,让使用者能经由网页即时存取数据库的...

    CodeCharge Studio v3.1.1

    以组合的方式建立网页数据库及应用程序,可以快速开发最新且有力的网络应用程序,亦可开发电子商务元件,如网络商店、线上购物专车、分类广告及拍卖场等,或是替网站加入动态的内容,如留言版、线上调查及广告等。...

    KrisonAV:基于Codecharge Studio和Artisteer的内容管理系统-开源

    最好的部分是,KrisonAV是根据GNU通用公共许可证许可的开放源代码解决方案,每个人都可以免费使用。 使用Codecharge Studio编辑开源KrisonAV CMS,并创建自己的模块,模块甚至插件。 还有一个商业版本,其中包括您...

    简单的问题-如何将此VBScript字符串转换为PHP字符串

    看到这里:http://forums.codecharge.com/posts.php?post_id = 84257 [^]

Global site tag (gtag.js) - Google Analytics