提交代码

This commit is contained in:
2024-01-17 16:12:42 +08:00
parent 66a56a44af
commit 74e2a00958
49 changed files with 4594 additions and 715 deletions
@@ -25,64 +25,26 @@ namespace FineUIPro.Web.TestRun.DriverPrepare
//加载列表
public void BindGrid()
{
string strSql = @"select * , u.UserName from DriverPrepare_Duty chec"
+ @" left join sys_User u on u.userId = chec.CompileMan where chec.ProjectId=@projectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(this.SDutyName.Text))
var duty = (from x in Funs.DB.DriverPrepare_Duty where x.ProjectId == this.CurrUser.LoginProjectId select x).FirstOrDefault();
if (duty != null)
{
strSql += " AND DutyName like @DutyName";
listStr.Add(new SqlParameter("@DutyName", "%" + this.SDutyName.Text.Trim() + "%"));
string strSql = @"select * from DriverPrepare_DutyItem chec"
+ @" where chec.DutyId=@DutyId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@DutyId", duty.DutyId));
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();
}
if (!string.IsNullOrEmpty(this.SDutyCode.Text))
else
{
strSql += " AND DutyCode like @DutyCode";
listStr.Add(new SqlParameter("@DutyCode", "%" + this.SDutyCode.Text.Trim() + "%"));
Grid1.DataSource = null;
Grid1.DataBind();
}
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
/// <summary>
/// 分页索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <summary>
/// 分页下拉框事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
@@ -127,31 +89,29 @@ namespace FineUIPro.Web.TestRun.DriverPrepare
/// </summary>
private void EditData()
{
if (Grid1.SelectedRowIndexArray.Length == 0)
var duty = (from x in Funs.DB.DriverPrepare_Duty where x.ProjectId == this.CurrUser.LoginProjectId select x).FirstOrDefault();
if (duty == null)
{
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
Alert.ShowInTop("项目记录尚未生成,请先新增记录", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DutyEdit.aspx?id={0}", Grid1.SelectedRowID, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DutyEdit.aspx?id={0}", duty.DutyId, "编辑 - ")));
}
#endregion
#region
protected void btnMenuDel_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
var duty = (from x in Funs.DB.DriverPrepare_Duty where x.ProjectId == this.CurrUser.LoginProjectId select x).FirstOrDefault();
if (duty == null)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
var DriverDataIdInfo = BLL.DriverPrepareDutyService.GetDriverPlanById(Grid1.SelectedRowID);
if (DriverDataIdInfo != null)
{
BLL.DriverPrepareDutyService.DeleteDriverPlan(Grid1.SelectedRowID);
}
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
Alert.ShowInTop("项目无记录,无需删除!", MessageBoxIcon.Warning);
return;
}
BLL.DriverPrepareDutyItemService.DeleteDutyItemByDutyId(duty.DutyId);
BLL.DriverPrepareDutyService.DeleteDriverPrepareDuty(duty.DutyId);
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
#endregion
@@ -186,12 +146,12 @@ namespace FineUIPro.Web.TestRun.DriverPrepare
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuModify.Hidden = false;
this.btnModify.Hidden = false;
this.Grid1.EnableRowDoubleClickEvent = true;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDel.Hidden = false;
this.btnDel.Hidden = false;
}
}
}