提交代码
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
<f:Toolbar ID="Toolbar4" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="hdItemsString" runat="server" Hidden="true"></f:TextBox>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="" ToolTip="保存"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSelect" runat="server" Icon="ShapeSquareSelect" ToolTip="模板库选择方案" OnClick="btnSelect_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnNew" OnClick="btnNew_Click" Icon="Add" EnablePostBack="true" runat="server" ToolTip="新增方案">
|
||||
@@ -41,6 +44,25 @@
|
||||
<f:RenderField HeaderText="方案名称" ColumnID="SolutionName" DataField="SolutionName" Width="740px" ExpandUnusedSpace="true"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="FileCode" DataField="FileCode" FieldType="String"
|
||||
HeaderText="文件编号" HeaderTextAlign="Center" TextAlign="Center">
|
||||
<Editor>
|
||||
<f:TextBox runat="server" ID="txtFileCode"></f:TextBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="CompileMan" DataField="CompileMan" FieldType="String"
|
||||
HeaderText="编制责任人" HeaderTextAlign="Center" TextAlign="Center">
|
||||
<Editor>
|
||||
<f:TextBox runat="server" ID="txtCompileMan"></f:TextBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="150px" ColumnID="PlanCompletedDate" DataField="PlanCompletedDate" FieldType="Date"
|
||||
Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="计划完成时间" HeaderTextAlign="Center">
|
||||
<Editor>
|
||||
<f:DatePicker ID="txtPlanCompletedDate" Required="true" runat="server">
|
||||
</f:DatePicker>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
|
||||
@@ -277,10 +277,18 @@ namespace FineUIPro.Web.TestRun.DriverPrepare
|
||||
cell.SetCellValue(item.SolutionName);
|
||||
cell = row.CreateCell(2);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(string.Empty);
|
||||
cell.SetCellValue(item.FileCode);
|
||||
cell = row.CreateCell(3);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(string.Empty);
|
||||
cell.SetCellValue(item.CompileMan);
|
||||
cell = row.CreateCell(4);
|
||||
cell.CellStyle = cellStyle;
|
||||
string date = string.Empty;
|
||||
if (item.PlanCompletedDate != null)
|
||||
{
|
||||
date = string.Format("{0:yyyy-MM-dd}", item.PlanCompletedDate);
|
||||
}
|
||||
cell.SetCellValue(date);
|
||||
i++;
|
||||
}
|
||||
// 第三步:写入文件流
|
||||
@@ -364,10 +372,18 @@ namespace FineUIPro.Web.TestRun.DriverPrepare
|
||||
cell.SetCellValue(item.SolutionName);
|
||||
cell = row.CreateCell(3);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(string.Empty);
|
||||
cell.SetCellValue(item.FileCode);
|
||||
cell = row.CreateCell(4);
|
||||
cell.CellStyle = cellStyle;
|
||||
cell.SetCellValue(string.Empty);
|
||||
cell.SetCellValue(item.CompileMan);
|
||||
cell = row.CreateCell(5);
|
||||
cell.CellStyle = cellStyle;
|
||||
string date = string.Empty;
|
||||
if (item.PlanCompletedDate != null)
|
||||
{
|
||||
date = string.Format("{0:yyyy-MM-dd}", item.PlanCompletedDate);
|
||||
}
|
||||
cell.SetCellValue(date);
|
||||
if (type != item.SolutionType)
|
||||
{
|
||||
type = item.SolutionType;
|
||||
@@ -408,5 +424,28 @@ namespace FineUIPro.Web.TestRun.DriverPrepare
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var items = from x in db.DriverPrepare_SchemePlanItem
|
||||
join y in db.DriverPrepare_SchemePlan on x.SchemePlanId equals y.SchemePlanId
|
||||
where y.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
foreach (JObject mergedRow in Grid1.GetMergedData())
|
||||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
int i = mergedRow.Value<int>("index");
|
||||
var item = items.FirstOrDefault(x => x.SchemePlanItemId == this.Grid1.Rows[i].DataKeys[0].ToString());
|
||||
if (item != null)
|
||||
{
|
||||
item.FileCode = values.Value<string>("FileCode");
|
||||
item.CompileMan = values.Value<string>("CompileMan");
|
||||
item.PlanCompletedDate = Funs.GetNewDateTime(values.Value<string>("PlanCompletedDate"));
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,6 +66,15 @@ namespace FineUIPro.Web.TestRun.DriverPrepare {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox hdItemsString;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnSelect 控件。
|
||||
/// </summary>
|
||||
@@ -102,6 +111,33 @@ namespace FineUIPro.Web.TestRun.DriverPrepare {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDel;
|
||||
|
||||
/// <summary>
|
||||
/// txtFileCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFileCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCompileMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtPlanCompletedDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtPlanCompletedDate;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user