提交代码

This commit is contained in:
2024-02-21 15:14:53 +08:00
parent 2c6a615726
commit b3357fb53f
15 changed files with 1068 additions and 507 deletions
@@ -58,9 +58,50 @@ namespace FineUIPro.Web.TestRun.DriverRun
/// <param name="e"></param>
protected void btnAttach_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
if (this.drpUnitId.SelectedValue == BLL.Const._Null)
{
this.hdId.Text = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
Alert.ShowInTop("请选择单位名称!", MessageBoxIcon.Warning);
return;
}
string id = Request.Params["id"];
Model.DriverRun_DriverRunPlan newData = new Model.DriverRun_DriverRunPlan();
newData.Code = this.txtCode.Text.Trim();
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
{
newData.UnitId = this.drpUnitId.SelectedValue;
}
if (!string.IsNullOrEmpty(this.drpUnitWorkIds.SelectedValue))
{
newData.InstallationId = 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.EstimatedInsuredPersonNum = Funs.GetNewInt(this.txtEstimatedInsuredPersonNum.Text.Trim());
newData.GuaranteedOperationPeriod = Funs.GetNewInt(this.txtGuaranteedOperationPeriod.Text.Trim());
newData.TotalGuaranteedOperationDays = Funs.GetNewInt(this.txtTotalGuaranteedOperationDays.Text.Trim());
newData.Remark = this.txtRemark.Text.Trim();
newData.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newData.DriverRunPlanId = this.hdId.Text;
BLL.DriverRunPlanService.UpdateDriverRunPlan(newData);
}
else
{
newData.DriverRunPlanId = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
this.hdId.Text = newData.DriverRunPlanId;
BLL.DriverRunPlanService.AddDriverRunPlan(newData);
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/DriverRun/DriverRunPlan&menuId={1}", this.hdId.Text, BLL.Const.DriverRunPlanMenuId)));
}
@@ -72,11 +113,52 @@ namespace FineUIPro.Web.TestRun.DriverRun
/// <param name="e"></param>
protected void btnAttachK_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdId.Text)) //新增记录
if (this.drpUnitId.SelectedValue == BLL.Const._Null)
{
this.hdId.Text = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
Alert.ShowInTop("请选择单位名称!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/DriverRun/DriverRunPlan&menuId={1}", this.hdId.Text+"K", BLL.Const.DriverRunPlanMenuId)));
string id = Request.Params["id"];
Model.DriverRun_DriverRunPlan newData = new Model.DriverRun_DriverRunPlan();
newData.Code = this.txtCode.Text.Trim();
if (this.drpUnitId.SelectedValue != BLL.Const._Null)
{
newData.UnitId = this.drpUnitId.SelectedValue;
}
if (!string.IsNullOrEmpty(this.drpUnitWorkIds.SelectedValue))
{
newData.InstallationId = 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.EstimatedInsuredPersonNum = Funs.GetNewInt(this.txtEstimatedInsuredPersonNum.Text.Trim());
newData.GuaranteedOperationPeriod = Funs.GetNewInt(this.txtGuaranteedOperationPeriod.Text.Trim());
newData.TotalGuaranteedOperationDays = Funs.GetNewInt(this.txtTotalGuaranteedOperationDays.Text.Trim());
newData.Remark = this.txtRemark.Text.Trim();
newData.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newData.DriverRunPlanId = this.hdId.Text;
BLL.DriverRunPlanService.UpdateDriverRunPlan(newData);
}
else
{
newData.DriverRunPlanId = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
this.hdId.Text = newData.DriverRunPlanId;
BLL.DriverRunPlanService.AddDriverRunPlan(newData);
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/DriverRun/DriverRunPlanK&menuId={1}", this.hdId.Text + "K", BLL.Const.DriverRunPlanMenuId)));
}
#endregion
@@ -159,22 +241,15 @@ namespace FineUIPro.Web.TestRun.DriverRun
newData.TotalGuaranteedOperationDays = Funs.GetNewInt(this.txtTotalGuaranteedOperationDays.Text.Trim());
newData.Remark = this.txtRemark.Text.Trim();
newData.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(id))
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newData.DriverRunPlanId = id;
newData.DriverRunPlanId = this.hdId.Text;
BLL.DriverRunPlanService.UpdateDriverRunPlan(newData);
}
else
{
if (!string.IsNullOrEmpty(this.hdId.Text))
{
newData.DriverRunPlanId = this.hdId.Text.Trim();
}
else
{
newData.DriverRunPlanId = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
this.hdId.Text = newData.DriverRunPlanId;
}
newData.DriverRunPlanId = SQLHelper.GetNewID(typeof(Model.DriverRun_DriverRunPlan));
this.hdId.Text = newData.DriverRunPlanId;
BLL.DriverRunPlanService.AddDriverRunPlan(newData);
}
ShowNotify("保存成功!", MessageBoxIcon.Success);