62,041
社区成员
发帖
与我相关
我的任务
分享
MeProtypeYfZk.prototype.CreateUpdateControl=function(bh)
{
//alert(bhyfzk+"zyrs");
if(bh!=-1)
{
try
{
var ds= CWXT.CWDJ.CKJF.GetDataSet(bh,"cwgl_pz_yfzk");// cwgl_pz_yfzk
if(ds){
this.GetDataSet_CALL_BACK_YFZK(ds);
}
}
catch(ex)
{
}
}
}
MeProtypeYfZk.prototype.GetDataSet_CALL_BACK_YFZK=function(response)
{
if(response.value==null)
return;
var ds=response.value;
if(ds.Tables[0].Rows.length==0)return;
if((ds!=null)&&(typeof(ds)=="object")&&(ds.Tables!=0))
{
for(var i=0;i<ds.Tables[0].Rows.length-1;i++)
{
this.AddRow();
}
this.InitControlValue(ds);
}
}
MeProtypeYfZk.prototype.InitControlValue=function(ds)
{
var obj=document.getElementById(this.tableid);
for(var i=0;i<ds.Tables[0].Rows.length;i++)
{
tr=obj.rows[(i+1)];
for(var j=2;j<tr.childNodes.length;j++)
{
td=tr.childNodes[j];
input=td.firstChild;
if(j==2)
{
input.value= ds.Tables[0].Rows[i].khjlh;
input=td.childNodes[1];
//alert(CWXT.CWDJ.CKJF.GetValueForCondition("cwgl_jc_gykh","mc",ds.Tables[0].Rows[i].khjlh));
//alert(d1);
//if(d1)
// {
input.value=ds.Tables[0].Rows[i].khjlh;
//}
}
else if(j==3)
{
input.value=parseFloat(ds.Tables[0].Rows[i].je.toString()).toFixed(2)/100;
}
else
{
input.value=ds.Tables[0].Rows[i].zy;
}
}
}
}
[AjaxPro.AjaxMethod]
public DataSet GetDataSet(string bh,string table)
{
string sql=" select * from "+table+" where pzjlh="+bh;
DataSet ds=new DataSet();
ds=func.func1.ExeSelect(sql);
return ds;
}
[AjaxPro.AjaxMethod]
public DataSet GetValueForCondition(string table,string filed,string values)
{
string sql="select "+filed+" from "+table+" where bh="+values;
DataSet ds=new DataSet();
ds=func.func1.ExeSelect(sql);
return ds;
}