2024-01-26 开车分包管理修改

This commit is contained in:
2024-01-26 17:12:01 +08:00
parent 2b91cacd97
commit de85f779a3
42 changed files with 3714 additions and 1083 deletions
@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web.UI.DataVisualization.Charting;
namespace FineUIPro.Web.TestRun.DriverSub
{
@@ -17,7 +18,7 @@ namespace FineUIPro.Web.TestRun.DriverSub
GetButtonPower();
BindGrid();
btnNew.OnClientClick = Window1.GetShowReference("DriverSubContactEdit.aspx") + "return false;";
BLL.UnitService.InitUnitDownList(this.drpSubUnitId, this.CurrUser.LoginProjectId, true);
btnSubContractors.OnClientClick = Window1.GetShowReference("DriverSubContactorList.aspx") + "return false;";
}
}
#endregion
@@ -26,36 +27,49 @@ namespace FineUIPro.Web.TestRun.DriverSub
//加载列表
public void BindGrid()
{
string strSql = @"SELECT sub.DriverSubContactId,
sub.ProjectId,
sub.Code,
sub.SubUnitId,
sub.ContactInfo,
sub.ChargeManInfo,
sub.ContactContent,
sub.Result,
sub.IntTime,
sub.OutTime,
sub.AttachUrl,
sub.Remark,
Unit.UnitName AS SubUnitName"
+ @" FROM DriverSub_DriverSubContact 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
@@ -139,7 +153,7 @@ namespace FineUIPro.Web.TestRun.DriverSub
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DriverSubContactEdit.aspx?id={0}", Grid1.SelectedRowID, "编辑 - ")));
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DriverSubContactEdit.aspx?DriverSubPlanId={0}", Grid1.SelectedRowID, "编辑 - ")));
}
#endregion