2024-01-26 开车分包管理修改
This commit is contained in:
@@ -15,9 +15,13 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BLL.UnitService.InitUnitDownList(this.drpSubUnitId, this.CurrUser.LoginProjectId, true);
|
||||
BLL.UnitWorkService.InitUnitWorkDropDownList(this.drpUnitWorkIds, this.CurrUser.LoginProjectId, true);
|
||||
//BLL.UnitService.InitUnitDownList(this.drpSubUnitId, this.CurrUser.LoginProjectId, true);
|
||||
//BLL.UnitWorkService.InitUnitWorkDropDownList(this.drpUnitWorkIds, this.CurrUser.LoginProjectId, true);
|
||||
string id = Request.Params["id"];
|
||||
DriverSubName.DataSource=DropListService.drpDriverSubNameList();
|
||||
DriverSubName.DataTextField = "Text";
|
||||
DriverSubName.DataValueField = "Value";
|
||||
DriverSubName.DataBind();
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
Model.DriverSub_DriverSubPlan data = BLL.DriverSubPlanService.GetDriverSubPlanById(id);
|
||||
@@ -25,16 +29,17 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
{
|
||||
this.hdId.Text = id;
|
||||
this.txtCode.Text = data.Code;
|
||||
if (!string.IsNullOrEmpty(data.SubUnitId))
|
||||
{
|
||||
this.drpSubUnitId.SelectedValue = data.SubUnitId;
|
||||
}
|
||||
this.txtIntroductions.Text = data.Introductions;
|
||||
this.txtAchievement.Text = data.Achievement;
|
||||
this.txtCooperation.Text = data.Cooperation;
|
||||
this.drpUnitWorkIds.SelectedValueArray = data.InstallationIds.Split(',');
|
||||
this.rblIsInvited.SelectedValue = data.IsInvited.ToString();
|
||||
this.txtRemark.Text = data.Remark;
|
||||
this.DriverSubName.SelectedValueArray= data.DriverSubNames.Split(',');
|
||||
//if (!string.IsNullOrEmpty(data.SubUnitId))
|
||||
//{
|
||||
// this.drpSubUnitId.SelectedValue = data.SubUnitId;
|
||||
//}
|
||||
//this.txtIntroductions.Text = data.Introductions;
|
||||
//this.txtAchievement.Text = data.Achievement;
|
||||
//this.txtCooperation.Text = data.Cooperation;
|
||||
//this.drpUnitWorkIds.SelectedValueArray = data.InstallationIds.Split(',');
|
||||
//this.rblIsInvited.SelectedValue = data.IsInvited.ToString();
|
||||
//this.txtRemark.Text = data.Remark;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,40 +70,41 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpSubUnitId.SelectedValue==BLL.Const._Null)
|
||||
{
|
||||
Alert.ShowInTop("请选择开车分包单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
//if (this.drpSubUnitId.SelectedValue==BLL.Const._Null)
|
||||
//{
|
||||
// Alert.ShowInTop("请选择开车分包单位!", MessageBoxIcon.Warning);
|
||||
// return;
|
||||
//}
|
||||
string id = Request.Params["id"];
|
||||
Model.DriverSub_DriverSubPlan newData = new Model.DriverSub_DriverSubPlan();
|
||||
newData.Code = this.txtCode.Text.Trim();
|
||||
if (this.drpSubUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
newData.SubUnitId = this.drpSubUnitId.SelectedValue;
|
||||
}
|
||||
newData.Introductions = this.txtIntroductions.Text.Trim();
|
||||
newData.Achievement = this.txtAchievement.Text.Trim();
|
||||
newData.Cooperation = this.txtCooperation.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.drpUnitWorkIds.SelectedValue))
|
||||
{
|
||||
newData.InstallationIds = GetStringByArray(this.drpUnitWorkIds.SelectedValueArray);
|
||||
string unitWorkNames = string.Empty;
|
||||
foreach (var item in this.drpUnitWorkIds.SelectedValueArray)
|
||||
{
|
||||
var unitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(item);
|
||||
if (unitWork!=null)
|
||||
{
|
||||
unitWorkNames += unitWork.UnitWorkName + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitWorkNames))
|
||||
{
|
||||
newData.InstallationNames = unitWorkNames.Substring(0, unitWorkNames.LastIndexOf(","));
|
||||
}
|
||||
}
|
||||
newData.IsInvited = Convert.ToBoolean(this.rblIsInvited.SelectedValue);
|
||||
newData.Remark = this.txtRemark.Text.Trim();
|
||||
newData.DriverSubNames= GetStringByArray(this.DriverSubName.SelectedValueArray);
|
||||
//if (this.drpSubUnitId.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// newData.SubUnitId = this.drpSubUnitId.SelectedValue;
|
||||
//}
|
||||
//newData.Introductions = this.txtIntroductions.Text.Trim();
|
||||
//newData.Achievement = this.txtAchievement.Text.Trim();
|
||||
//newData.Cooperation = this.txtCooperation.Text.Trim();
|
||||
//if (!string.IsNullOrEmpty(this.drpUnitWorkIds.SelectedValue))
|
||||
//{
|
||||
// newData.InstallationIds = GetStringByArray(this.drpUnitWorkIds.SelectedValueArray);
|
||||
// string unitWorkNames = string.Empty;
|
||||
// foreach (var item in this.drpUnitWorkIds.SelectedValueArray)
|
||||
// {
|
||||
// var unitWork = BLL.UnitWorkService.getUnitWorkByUnitWorkId(item);
|
||||
// if (unitWork!=null)
|
||||
// {
|
||||
// unitWorkNames += unitWork.UnitWorkName + ",";
|
||||
// }
|
||||
// }
|
||||
// if (!string.IsNullOrEmpty(unitWorkNames))
|
||||
// {
|
||||
// newData.InstallationNames = unitWorkNames.Substring(0, unitWorkNames.LastIndexOf(","));
|
||||
// }
|
||||
//}
|
||||
//newData.IsInvited = Convert.ToBoolean(this.rblIsInvited.SelectedValue);
|
||||
//newData.Remark = this.txtRemark.Text.Trim();
|
||||
newData.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
@@ -122,6 +128,13 @@ namespace FineUIPro.Web.TestRun.DriverSub
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取字符串
|
||||
/// </summary>
|
||||
/// <param name="array"></param>
|
||||
/// <returns></returns>
|
||||
private string GetStringByArray(string[] array)
|
||||
{
|
||||
string str = string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user