20240318 开车报告 总结
This commit is contained in:
@@ -17,7 +17,6 @@ namespace FineUIPro.Web.TestRun.DriverReport
|
||||
GetButtonPower();
|
||||
BindGrid();
|
||||
btnNew.OnClientClick = Window1.GetShowReference("MonthReportEdit.aspx") + "return false;";
|
||||
BLL.UnitWorkService.InitUnitWorkDropDownList(this.drpUnitWorkId, this.CurrUser.LoginProjectId, true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -26,38 +25,23 @@ namespace FineUIPro.Web.TestRun.DriverReport
|
||||
//加载列表
|
||||
public void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT report.DriverReportId,
|
||||
report.DriverReportCode,
|
||||
report.DriverReporName,
|
||||
string strSql = @"SELECT report.MonthReportId,
|
||||
report.ProjectId,
|
||||
report.UnitWorkId,
|
||||
report.CompilePerson,
|
||||
report.SubmitDate,
|
||||
report.Number,
|
||||
report.ReportType,
|
||||
report.Remark,
|
||||
unitWork.UnitWorkName,
|
||||
u.UserName AS CompilePersonName"
|
||||
+ @" FROM Driver_DriverReport AS report "
|
||||
+ @" LEFT JOIN WBS_UnitWork AS unitWork ON unitWork.UnitWorkId = report.UnitWorkId"
|
||||
+ @" LEFT JOIN Sys_User AS u ON u.UserId = report.CompilePerson"
|
||||
+ @" WHERE report.ProjectId=@projectId AND report.ReportType='2'";
|
||||
report.MonthReportCode,
|
||||
(CONVERT(varchar(10),DATEADD(DAY,1,DATEADD(MONTH,-1,report.MonthReportDate)),120)+'至'+CONVERT(varchar(10),report.MonthReportDate,120)) as MonthReportDate"
|
||||
+ @" FROM TestRun_MonthReport AS report "
|
||||
+ @" WHERE report.ProjectId=@projectId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
||||
if (!string.IsNullOrEmpty(this.drpUnitWorkId.SelectedValue) && this.drpUnitWorkId.SelectedValue != BLL.Const._Null)
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtMonthReportCode.Text.Trim()))
|
||||
{
|
||||
strSql += " AND report.UnitWorkId=@unitWorkId";
|
||||
listStr.Add(new SqlParameter("@unitWorkId", this.drpUnitWorkId.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtDriverReporName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND report.DriverReporName LIKE @DriverReporName";
|
||||
listStr.Add(new SqlParameter("@DriverReporName", "%" + this.txtDriverReporName.Text.Trim() + "%"));
|
||||
strSql += " AND report.MonthReportCode LIKE @monthReportCode";
|
||||
listStr.Add(new SqlParameter("@monthReportCode", "%" + this.txtMonthReportCode.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();
|
||||
@@ -157,10 +141,12 @@ namespace FineUIPro.Web.TestRun.DriverReport
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var info = BLL.DriverReportService.GetDriverReportById(rowID);
|
||||
var info = BLL.TestRun_MonthReportService.GetMonthReportById(rowID);
|
||||
if (info != null)
|
||||
{
|
||||
BLL.DriverReportService.DeleteDriverReport(rowID);
|
||||
BLL.TestRun_MonthReportItem2Service.DeleteMonthReportItem2ByReportId(rowID);
|
||||
BLL.TestRun_MonthReportItemService.DeleteMonthReportItemByMonthReportId(rowID);
|
||||
BLL.TestRun_MonthReportService.DeleteMonthReportById(rowID);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
@@ -182,6 +168,34 @@ namespace FineUIPro.Web.TestRun.DriverReport
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TestRun/DriverReport/MonthReport&menuId={1}", id, BLL.Const.MonthReportMenuId)));
|
||||
}
|
||||
else if (e.CommandName == "Push")//推送提醒
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("MonthReportPush.aspx?id={0}", Grid1.SelectedRowID, "编辑 - ")));
|
||||
}
|
||||
else if (e.CommandName == "SeePush")//查看推送内容
|
||||
{
|
||||
var report = BLL.TestRun_MonthReportService.GetMonthReportById(id);
|
||||
if (report != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(report.PushPerson))
|
||||
{
|
||||
if (report.PushPerson.Contains(this.CurrUser.UserId))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MonthReportPushView.aspx?id={0}", Grid1.SelectedRowID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("对不起,您不是接收推送人员,不能查看!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("对不起,您不是接收推送人员,不能查看!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -210,5 +224,22 @@ namespace FineUIPro.Web.TestRun.DriverReport
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 查看
|
||||
/// <summary>
|
||||
/// 查看
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuView_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MonthReportView.aspx?id={0}", Grid1.SelectedRowID, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user