52,792
社区成员




var win = Ext.create('Ext.window.Window', { //创建选择条件窗口
title: '条件选择',
layout: 'fit',
items: Ext.create('Ext.form.Panel', {
border: 0,
baseCls: 'x-plain',
url: 'SPPage.aspx',
bodyStyle: 'padding:20px 20px 10px 20px',
items: [{
xtype: 'textfield',
name: 'report_name',
value: record.get('report_name'),
hidden: true
}, {
xtype: 'textfield',
name: 'report_path',
value: record.get('report_path'),
hidden: true
}, {
xtype: 'datefield',
name: 'start_time',
fieldLabel: '开始日期',
format: 'Y-m-d',
value: new Date(),
width: 300,
height: 30
}, {
xtype: 'datefield',
name: 'end_time',
fieldLabel: '结束日期',
format: 'Y-m-d',
value: new Date(),
height: 30,
width: 300
}, {
xtype: 'combobox',
name: 'shifts',
fieldLabel: 'Select Shift',
multiSelect: true,
editable: false,
store: shiftstore,
displayField: 'shift',
valueField: 'id',
height: 30,
width: 300,
queryMode: 'local'
}, {
xtype: 'combobox',
name: 'skills',
fieldLabel: 'Select Skill',
multiSelect: true,
store: skillstore,
editable: false,
width: 300,
height: 30,
displayField: 'skill_name',
valueField: 'id',
queryMode: 'local'
}],
bbar: ['->', {
xtype: 'button',
method:'post',
text: '提交',
handler: function () {
var thisform = this.up('form').getForm();
if (thisform.isValid()) {
thisform.submit({
success: function (form, action) {
win.close();
//Then OpenTab
//openTab(record);
},
failure: function (form, action) {
alert('提交数据错误!');
}
});
}
}
}, {
xtype: 'button',
text: '取消',
handler: function () {
win.close();
}
}, '->']
})
});
win.show();
public partial class SPPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string returnValue = string.Empty;
try
{
string redirectUrl = string.Empty;
//DateTime start_time = DateTime.Parse(Request.Form["start_time"]);
//DateTime end_time = DateTime.Parse(Request.Form["end_time"]);
string start_time = Request.Form["start_time"];
string end_time = Request.Form["end_time"];
string shifts = Request.Form["shifts"];
string skills = Request.Form["skills"];
string report_name = Request.Form["report_name"];
string report_path = Request.Form["report_path"];
report_path = report_path.Replace('*', '\\');
ReportDocument repDoc = new ReportDocument();
repDoc.Load(report_path);
string spNameValue = "";
spNameValue = (repDoc.DataDefinition.FormulaFields["spName"].Text);
string spName = spNameValue.Substring(1, spNameValue.Length - 2);
string strCon = ConfigurationManager.ConnectionStrings["UMPDBContext1"].ConnectionString;
SqlConnection objCon = new SqlConnection(strCon);
try
{
objCon.Open();
SqlCommand objCmd = new SqlCommand();
objCmd.CommandType = System.Data.CommandType.StoredProcedure;
objCmd.CommandText = spName;
objCmd.Connection = objCon;
SqlParameter[] paramiters = new SqlParameter[5]{
new SqlParameter("@StartTime",start_time),
new SqlParameter("@EndTime",end_time),
new SqlParameter("@Shifts",""),
new SqlParameter("@Skills",""),
new SqlParameter("@UserVair","")
};
foreach (SqlParameter _param in paramiters)
{
objCmd.Parameters.Add(_param);
}
SqlDataAdapter dapt = new SqlDataAdapter(objCmd);
System.Data.DataSet ds = new System.Data.DataSet();
dapt.Fill(ds);
Session["ds"] = ds;
returnValue = "{success:true}";
}
catch (Exception ex)
{
returnValue = "{success:false,msg:'" + ex.ToString() + "'}";
}
//returnValue = "{success:true}";
}
catch (Exception ex)
{
returnValue = "{success:false,msg:'" + ex.ToString() + "'}";
}
//returnValue = "{success:false,msg:'sjfis'}";
Response.Write(returnValue);
Response.End();
}
}