showmodaldialog 的问题
如何在打开对话框的页面服务端获取window.dialogArguments传递过来的参数,希望在PAGE_LOAD中以这个参数执行SQL?
posted @ 2005-12-12 08:52 蔚然之家 阅读(110) 评论(0) 编辑
如何在打开对话框的页面服务端获取window.dialogArguments传递过来的参数,希望在PAGE_LOAD中以这个参数执行SQL?
posted @ 2005-12-12 08:52 蔚然之家 阅读(110) 评论(0) 编辑
posted @ 2005-11-17 15:22 蔚然之家 阅读(348) 评论(1) 编辑
posted @ 2005-11-12 23:01 蔚然之家 阅读(2424) 评论(19) 编辑
private void btOK_Click(object sender, System.EventArgs e)
{
string s ="<script language = JavaScript>";
if (Page.IsValid) 
{
string userId = tbUser.Text; //加密口令
CryptMethod cr = new CryptMethod();
string cryptpass = cr.Encrypto(tbPass.Text);
bool success = Account.SignIn(userId,cryptpass); //判断用户名和口令
string filename = Server.MapPath(XML_FILE+userId+".xml");
if(!File.Exists(filename)) //判断用户配置文件
{
lbError.Text ="没有用户配置文件";
return ;
}
if (success) //口令正确
{
if (FormsAuthentication.GetRedirectUrl(userId, false).EndsWith(URL_DEFAULT)) 
{
FormsAuthentication.SetAuthCookie(userId, false);
s += "window.opener=null;" + System.Environment.NewLine;
s += "window.close();" + System.Environment.NewLine;
if (chkPassword.Checked)//进入修改口令界面
{
s +="window.open('/PressMange/UserControl/UserChangePassPerson.aspx');"+System.Environment.NewLine;
}
else //进入主界面
s += "window.open('main.aspx','dialog','left=0,top=0,height=710,width=1010,resizable=1,status=0,scrollbars=0');"+System.Environment.NewLine;
s+="</script>";
RegisterClientScriptBlock("script",s);
}
else
{
FormsAuthentication.RedirectFromLoginPage(userId, false);
}
}
else 
{
lbError.Text ="非法登陆";
}
}
}posted @ 2005-11-12 13:29 蔚然之家 阅读(652) 评论(0) 编辑
private string subTotal(int row ,int num)
{
string r = (row+1).ToString();
if( num == 0)//
{
return "=C"+r+"+F"+r+"-I"+r;
}
else
return "=E"+r+"+H"+r+"-K"+r;
}
private string sumTotal(string scol,int firstrow,int num)
{
string r = num.ToString();
string fr = firstrow.ToString();
return "=Sum("+scol+fr+":"+scol+r+")";
}
private void CreateExcelWorkbook(DataRow[] rows)
{
string strCurrentDir = Server.MapPath("..") + "\\TempReports\\";
string licenseFile = MapPath("..") + "\\XML\\Aspose.Excel.lic";
Excel excel = new Excel(licenseFile, this);
;
string designerFile = strCurrentDir+"cangku2.xls";
excel.Open(designerFile);
Worksheet sheet = excel.Worksheets["Sheet1"];
sheet.Name = "wuzi";
Cells cells = sheet.Cells;
int styleIndex;
styleIndex = excel.Styles.Add();
Aspose.Excel.Style stylecell = excel.Styles[styleIndex];
stylecell.Borders[BorderType.LeftBorder].LineStyle=CellBorderType.Thin;
stylecell.Borders[BorderType.TopBorder].LineStyle = CellBorderType.Thin;
stylecell.Borders[BorderType.RightBorder].LineStyle=CellBorderType.Thin;
stylecell.Borders[BorderType.BottomBorder].LineStyle = CellBorderType.Thin;
int iRow =4;
foreach(DataRow row in rows)
{
cells[iRow,0].PutValue(row[0].ToString());
cells[iRow,1].PutValue(row[1].ToString());
cells[iRow,2].PutValue(row[2]);
cells[iRow,3].PutValue( row[3]);
cells[iRow,4].PutValue(row[4]);
cells[iRow,5].PutValue(row[5]);
cells[iRow,6].PutValue(row[3]);
cells[iRow,7].PutValue(row[6]);
cells[iRow,8].PutValue(row[7]);
cells[iRow,9].PutValue(row[3]);
cells[iRow,10].PutValue(row[8]);
cells[iRow,11].Formula=subTotal(iRow,0);
cells[iRow,12].PutValue(row[3]);
cells[iRow,13].Formula=subTotal(iRow,1);
iRow++;
}
string zj="总计";
cells[iRow,3].PutValue(zj);
cells[iRow,6].PutValue(zj);
cells[iRow,9].PutValue(zj);
cells[iRow,12].PutValue(zj);
cells[iRow,4].Formula=sumTotal("E",5,iRow);
cells[iRow,7].Formula=sumTotal("H",5,iRow);
cells[iRow,10].Formula=sumTotal("K",5,iRow);
cells[iRow,13].Formula=sumTotal("N",5,iRow);
cells[1,8].PutValue(cpStartDate.SelectedDate.ToShortDateString());
cells[1,12].PutValue(cpEndDate.SelectedDate.ToShortDateString());
Range range = cells.CreateRange(4,0,iRow-4+1,14);
range.Style = stylecell;
for(int i = 0; i < excel.Worksheets.Count ; i ++)
{
sheet = excel.Worksheets[i];
if(sheet.Name != "wuzi")
{
excel.Worksheets.RemoveAt(i);
i --;
}
}
/**//*Response.Clear();
Response.Buffer= true;
Response.Charset="GB2312";
this.Response.ContentEncoding=System.Text.Encoding.GetEncoding("GB2312");*/
excel.Save(HttpUtility.UrlEncode("物资进出库汇总.xls",Encoding.UTF8), SaveType.OpenInBrowser,FileFormatType.Default,this.Response);
}posted @ 2005-11-10 15:36 蔚然之家 阅读(4563) 评论(54) 编辑