补充公司级别树
This commit is contained in:
@@ -42,7 +42,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
{
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
|
||||
this.InitDownList();
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
@@ -53,11 +53,10 @@ namespace FineUIPro.Web.Comprehensive
|
||||
this.GetButtonPower();
|
||||
}
|
||||
|
||||
GetList();
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
private void GetList()
|
||||
private void InitDownList()
|
||||
{
|
||||
BLL.UnitService.InitUnitDownList(this.sdrpUnitId, this.ProjectId, true);
|
||||
var punit = ProjectUnitService.GetProjectUnitByUnitIdProjectId(this.ProjectId, this.CurrUser.UnitId);
|
||||
@@ -73,25 +72,26 @@ namespace FineUIPro.Web.Comprehensive
|
||||
}
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
GetList();
|
||||
this.BindGrid();
|
||||
this.InitDownList();
|
||||
|
||||
this.GetButtonPower();
|
||||
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
btnNew.Hidden = true;
|
||||
}
|
||||
this.BindGrid();
|
||||
}
|
||||
/// <summary>
|
||||
/// 数据绑定
|
||||
/// </summary>
|
||||
public void BindGrid()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.ProjectId))
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
string strSql = @"SELECT QualitySampleFirstAccFileId
|
||||
return;
|
||||
}
|
||||
string strSql = @"SELECT QualitySampleFirstAccFileId
|
||||
, a.ProjectId
|
||||
, a.UnitId
|
||||
,b.UnitName
|
||||
@@ -103,33 +103,33 @@ namespace FineUIPro.Web.Comprehensive
|
||||
,Remark
|
||||
FROM dbo.Comprehensive_QualitySampleFirstAccFile a left join Base_Unit b on a.unitId=b.UnitId
|
||||
where a.ProjectId= @ProjectId";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
if (sdrpUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND a.UnitId=@UnitId";
|
||||
listStr.Add(new SqlParameter("@UnitId", sdrpUnitId.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.dpA.Text.Trim()))
|
||||
{
|
||||
strSql += " AND a.InspectionDate>=@ReceiveDate";
|
||||
listStr.Add(new SqlParameter("@ReceiveDate", dpA.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.dpB.Text.Trim()))
|
||||
{
|
||||
strSql += " AND a.InspectionDate<=@SendDate";
|
||||
listStr.Add(new SqlParameter("@SendDate", dpB.Text.Trim()));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
if (sdrpUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND a.UnitId=@UnitId";
|
||||
listStr.Add(new SqlParameter("@UnitId", sdrpUnitId.SelectedValue));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.dpA.Text.Trim()))
|
||||
{
|
||||
strSql += " AND a.InspectionDate>=@ReceiveDate";
|
||||
listStr.Add(new SqlParameter("@ReceiveDate", dpA.Text.Trim()));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.dpB.Text.Trim()))
|
||||
{
|
||||
strSql += " AND a.InspectionDate<=@SendDate";
|
||||
listStr.Add(new SqlParameter("@SendDate", dpB.Text.Trim()));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
//tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 分页、排序
|
||||
|
||||
Reference in New Issue
Block a user