2024-02-04 试车分包管理添加
This commit is contained in:
@@ -26,32 +26,51 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
//加载列表
|
||||
public void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT sub.DriverSubId,
|
||||
sub.ProjectId,
|
||||
sub.Code,
|
||||
sub.SubUnitId,
|
||||
sub.Implement,
|
||||
sub.Instruction,
|
||||
sub.AttachUrl,
|
||||
sub.Remark,
|
||||
Unit.UnitName AS SubUnitName"
|
||||
+ @" FROM DriverSub_DriverSub AS sub"
|
||||
+ @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId = sub.SubUnitId WHERE sub.ProjectId=@projectId";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId));
|
||||
if (!string.IsNullOrEmpty(this.drpSubUnitId.SelectedValue) && this.drpSubUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND sub.SubUnitId=@subUnitId";
|
||||
listStr.Add(new SqlParameter("@subUnitId", this.drpSubUnitId.SelectedValue));
|
||||
}
|
||||
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);
|
||||
var q = from x in Funs.DB.DriverSub_DriverSubContact
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x.DriverSubPlanId;
|
||||
var table = from x in Funs.DB.DriverSub_DriverSubPlan
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId && q.Contains(x.DriverSubPlanId)
|
||||
select new
|
||||
{
|
||||
x.DriverSubPlanId,
|
||||
x.Code,
|
||||
x.SubUnitId,
|
||||
x.Introductions,
|
||||
x.Achievement,
|
||||
x.Cooperation,
|
||||
x.InstallationIds,
|
||||
x.InstallationNames,
|
||||
x.AttachUrl,
|
||||
x.Remark,
|
||||
x.DriverSubNames,
|
||||
};
|
||||
table = table.Skip(Grid1.PageSize * Grid1.PageIndex).Take(Grid1.PageSize);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
public string GetDriverSubName(object str)
|
||||
{
|
||||
string strName = "";
|
||||
|
||||
if (str != null)
|
||||
{
|
||||
string[] strArr = str.ToString().Split(',');
|
||||
|
||||
foreach (string s in strArr)
|
||||
{
|
||||
foreach (System.Web.UI.WebControls.ListItem item in DropListService.drpDriverSubNameList())
|
||||
{
|
||||
if (item.Value == s)
|
||||
{
|
||||
strName += item.Text + ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return strName.TrimEnd(',');
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页
|
||||
@@ -125,6 +144,7 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
EditData();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 编辑
|
||||
/// </summary>
|
||||
@@ -135,7 +155,7 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DriverSubEdit.aspx?id={0}", Grid1.SelectedRowID, "编辑 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DriverSubEdit.aspx?DriverSubPlanId={0}", Grid1.SelectedRowID, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -147,10 +167,10 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var info = BLL.DriverSubService.GetDriverSubById(rowID);
|
||||
var info = BLL.DriverSubPlanService.GetDriverSubPlanById(rowID);
|
||||
if (info != null)
|
||||
{
|
||||
BLL.DriverSubService.DeleteDriverSub(rowID);
|
||||
BLL.DriverSubPlanService.DeleteDriverSubPlanById(rowID);
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
@@ -170,7 +190,7 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
string id = Grid1.DataKeys[e.RowIndex][0].ToString();
|
||||
if (e.CommandName == "AttachUrl")
|
||||
{
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TestRun/DriverSub/DriverSub&menuId={1}", id, BLL.Const.DriverSubMenuId)));
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TestRun/DriverSub/DriverSubPlan&menuId={1}", id, BLL.Const.DriverSubMenuId)));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -184,19 +204,19 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DriverSubMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnMenuModify.Hidden = false;
|
||||
this.Grid1.EnableRowDoubleClickEvent = true;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDel.Hidden = false;
|
||||
}
|
||||
//if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
//{
|
||||
// this.btnNew.Hidden = false;
|
||||
//}
|
||||
//if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
//{
|
||||
// this.btnMenuModify.Hidden = false;
|
||||
// this.Grid1.EnableRowDoubleClickEvent = true;
|
||||
//}
|
||||
//if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
//{
|
||||
// this.btnMenuDel.Hidden = false;
|
||||
//}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user