提交代码
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server" />
|
||||
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="HBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="开车保运计划" EnableCollapse="true"
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="开车保运计划" EnableCollapse="true" ForceFit="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="DriverRunPlanId" AllowCellEditing="true" ClicksToEdit="2" DataIDField="DriverRunPlanId" AllowSorting="true" SortField="Code"
|
||||
SortDirection="ASC" OnSort="Grid1_Sort" EnableColumnLines="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" EnableTextSelection="True" OnRowCommand="Grid1_RowCommand" OnRowDoubleClick="Grid1_RowDoubleClick">
|
||||
@@ -44,16 +44,22 @@
|
||||
FieldType="String" HeaderText="预估保运人数" HeaderTextAlign="Center" Width="220px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="GuaranteedOperationPeriod" DataField="GuaranteedOperationPeriod"
|
||||
FieldType="String" HeaderText="保运工期(月)" HeaderTextAlign="Center" Width="220px">
|
||||
FieldType="String" HeaderText="保运工期(月)" HeaderTextAlign="Center" Width="180px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="TotalGuaranteedOperationDays" DataField="TotalGuaranteedOperationDays"
|
||||
FieldType="String" HeaderText="总保运人工日" HeaderTextAlign="Center" Width="220px">
|
||||
FieldType="String" HeaderText="总保运人工日" HeaderTextAlign="Center" Width="180px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="UsedDays" DataField="UsedDays"
|
||||
FieldType="String" HeaderText="已用保运工日" HeaderTextAlign="Center" Width="180px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="LeaveDays" DataField="LeaveDays"
|
||||
FieldType="String" HeaderText="剩余保运工日" HeaderTextAlign="Center" Width="180px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="Remark" DataField="Remark"
|
||||
FieldType="String" HeaderText="备注" HeaderTextAlign="Center" Width="120px">
|
||||
</f:RenderField>
|
||||
<f:LinkButtonField HeaderText="附件" ConfirmTarget="Top" Width="80px" CommandName="AttachUrl" ColumnID="AttachUrl"
|
||||
TextAlign="Center" ToolTip="附件查看" Icon="Find" />
|
||||
<%--<f:LinkButtonField HeaderText="附件" ConfirmTarget="Top" Width="80px" CommandName="AttachUrl" ColumnID="AttachUrl"
|
||||
TextAlign="Center" ToolTip="附件查看" Icon="Find" />--%>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
|
||||
@@ -39,6 +39,8 @@ namespace FineUIPro.Web.TestRun.DriverRun
|
||||
driverRun.GuaranteedOperationPeriod,
|
||||
driverRun.TotalGuaranteedOperationDays,
|
||||
(CASE WHEN driverRun.IsAcceptInvite=1 THEN '是' ELSE '否' END) AS IsAcceptInvite,
|
||||
isnull(driverRun.UsedDays,0) as UsedDays,
|
||||
isnull(driverRun.TotalGuaranteedOperationDays,0)-isnull(driverRun.UsedDays,0) as LeaveDays,
|
||||
driverRun.AttachUrl,
|
||||
driverRun.Remark,
|
||||
Unit.UnitName AS UnitName"
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user