Browse Source

调整。

master
yibo 8 years ago
parent
commit
9ea9dc3366
10 changed files with 141 additions and 25 deletions
  1. +54
    -7
      B3SubstituteKill.Web/Pages/B3SubstituteKill/BaseInfos/SubKillFlag_/SubKillFlagEdit.cs
  2. +5
    -3
      B3SubstituteKill.Web/Pages/B3SubstituteKill/BaseInfos/SubKillFlag_/SubKillFlagList.cs
  3. +0
    -10
      B3SubstituteKill.Web/Pages/B3SubstituteKill/BaseInfos/SubKillFlag_/SubKillFlagList.xml
  4. +17
    -3
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillWeightBill_/SubKillWeightBillEdit.cs
  5. +7
    -1
      B3SubstituteKill.Web/PluginClass.cs
  6. +1
    -0
      B3SubstituteKill/B3SubstituteKill.csproj
  7. +18
    -0
      B3SubstituteKill/BL/BaseInfos/SubKillFlag/SubKillFlagBL.cs
  8. +9
    -0
      B3SubstituteKill/BO/BaseInfos/SubKillFlag/SubKillFlag.cs
  9. +27
    -0
      B3SubstituteKill/BO/BaseInfos/SubKillFlag/SubKillFlag_Detail.cs
  10. +3
    -1
      WebFolder/config/Plugins/B3SubstituteKill.plugin

+ 54
- 7
B3SubstituteKill.Web/Pages/B3SubstituteKill/BaseInfos/SubKillFlag_/SubKillFlagEdit.cs View File

@ -1,31 +1,78 @@
using BWP.B3SubstituteKill.BL;
using BWP.B3SubstituteKill.BO;
using BWP.Web.Layout;
using BWP.Web.WebControls;
using Forks.EnterpriseServices.DataForm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using TSingSoft.WebControls2;
using Forks.Utils.Collections;
namespace BWP.Web.Pages.B3SubstituteKill.BaseInfos.SubKillFlag_
{
class SubKillFlagEdit : DomainBaseInfoEditPage<SubKillFlag, ISubKillFlagBL>
{
protected override void BuildBody(Control form)
protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, CustomPageLayout.PageLayoutSection pageLayoutSection)
{
var vPanel = new VLayoutPanel();
form.Controls.Add(vPanel);
var panel = new LayoutManager("", mDFInfo, mDFContainer);
var layoutManager = new LayoutManager("", mDFInfo, mDFContainer);
var config = new AutoLayoutConfig();
config.Add("AccountingUnit_ID");
config.Add("Supplier_ID");
config.Add("Name");
config.Add("Remark");
panel.Config = config;
vPanel.Add(panel.CreateLayout());
layoutManager.Config = config;
pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo);
titlePanel.Controls.Add(layoutManager.CreateLayout());
}
protected override void BuildBody(System.Web.UI.Control parent)
{
base.BuildBody(parent);
AddDetail(parent.EAdd(new TitlePanel("标识明细", "标识明细")));
}
DFEditGrid _detailGrid;
private void AddDetail(TitlePanel titlePanel)
{
if (CanSave)
{
titlePanel.EAdd(new TSButton("新增", delegate
{
_detailGrid.GetFromUI();
Dmo.Details.Add(new SubKillFlag_Detail());
_detailGrid.DataBind();
}));
}
var editor = new DFCollectionEditor<SubKillFlag_Detail>(() => Dmo.Details);
editor.AllowDeletionFunc = () => CanSave;
editor.CanDeleteFunc = detail => CanSave;
editor.IsEditableFunc = (field, detail) => CanSave;
_detailGrid = titlePanel.EAdd(new DFEditGrid(editor) { Width = Unit.Percentage(100) });
_detailGrid.Columns.EAdd(new DFEditGridColumn<DFTextBox>("Name")).InitEditControl += (sender, e) => {
e.Control.Style["width"] = "400px";
};
var section = mPageLayoutManager.AddSection("Detail", "标识明细");
titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);
section.ApplyLayout(_detailGrid, mPageLayoutManager, DFInfo.Get(typeof(SubKillFlag_Detail)));
}
public override void AppToUI()
{
base.AppToUI();
_detailGrid.DataBind();
}
public override void GetFromUI()
{
base.GetFromUI();
_detailGrid.GetFromUI();
}
}
}

+ 5
- 3
B3SubstituteKill.Web/Pages/B3SubstituteKill/BaseInfos/SubKillFlag_/SubKillFlagList.cs View File

@ -14,15 +14,17 @@ namespace BWP.Web.Pages.B3SubstituteKill.BaseInfos.SubKillFlag_
{
vPanel.Add(CreateDefaultBaseInfoQueryControls((panel, config) =>
{
config.AddAfter("AccountingUnit_ID", "Name");
config.Remvoe("Name");
config.AddAfter("AccountingUnit_ID", "ID");
config.AddAfter("Supplier_ID", "AccountingUnit_ID");
}));
}
protected override void AddDFBrowseGridColumn(TSingSoft.WebControls2.DFBrowseGrid grid, string field)
{
base.AddDFBrowseGridColumn(grid, field);
if (field == "Name")
if (field != "Name")
base.AddDFBrowseGridColumn(grid, field);
if (field == "ID")
{
AddDFBrowseGridColumn(grid, "AccountingUnit_Name");
AddDFBrowseGridColumn(grid, "Supplier_Name");


+ 0
- 10
B3SubstituteKill.Web/Pages/B3SubstituteKill/BaseInfos/SubKillFlag_/SubKillFlagList.xml View File

@ -12,16 +12,6 @@
<Field name="ID"/>
<QBE paramName="ID"/>
</EQ>
<Or>
<Like>
<Field name="Name"/>
<QBE paramName="Name"/>
</Like>
<Like>
<Field name="Spell"/>
<QBE paramName="Name"/>
</Like>
</Or>
<EQ>
<Field name="AccountingUnit_ID"/>
<QBE paramName="AccountingUnit_ID"/>


+ 17
- 3
B3SubstituteKill.Web/Pages/B3SubstituteKill/Bills/SubKillWeightBill_/SubKillWeightBillEdit.cs View File

@ -190,7 +190,16 @@ __DFContainer.setValue('PriceBill_ID','');
var editor = new DFCollectionEditor<SubKillWeightBill_Detail>(() => Dmo.Details);
editor.AllowDeletionFunc = () => CanSave;
editor.CanDeleteFunc = detail => CanSave;
editor.IsEditableFunc = (field, detail) => CanSave;
editor.IsEditableFunc = (field, detail) =>
{
if (!CanSave)
return false;
if (field.Name == "Number")
return CheckDefaultRole("编辑头数");
if (field.Name == "MaoWeight" || field.Name == "PiWeight")
return CheckDefaultRole("编辑重量");
return true;
};
_detailGrid = titlePanel.EAdd(new DFEditGrid(editor) { Width = Unit.Percentage(100) });
_detailGrid.Columns.EAdd(new DFEditGridColumn<DFChoiceBox>("LiveVarieties_ID")).InitEditControl += (sender, e) =>
{
@ -204,8 +213,8 @@ __DFContainer.setValue('PriceBill_ID','');
{
e.Control.Style["width"] = "120px";
};
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("MaoWeight"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("PiWeight"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFTextBox>("MaoWeight"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFTextBox>("PiWeight"));
_detailGrid.Columns.Add(new DFEditGridColumn<DFValueLabel>("Weight"));
_detailGrid.Columns.EAdd(new DFEditGridColumn<DFChoiceBox>("LiveColonyHouse_ID")).InitEditControl += (sender, e) =>
{
@ -226,6 +235,11 @@ __DFContainer.setValue('PriceBill_ID','');
};
_detailGrid.Columns.Add(new DFEditGridColumn("Remark"));
_detailGrid.ValueColumns.Add("ID");
var dic = new Dictionary<string, Unit>();
dic.Add("毛重", Unit.Pixel(120));
dic.Add("皮重", Unit.Pixel(120));
dic.Add("重量", Unit.Pixel(120));
_detailGrid.PreferWidthGridSet = dic;
var section = mPageLayoutManager.AddSection("Detail", "过磅明细");
titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name);


+ 7
- 1
B3SubstituteKill.Web/PluginClass.cs View File

@ -1,4 +1,5 @@
using BWP.Web.Utils;
using BWP.B3System;
using BWP.Web.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
@ -12,6 +13,11 @@ namespace BWP.B3SubstituteKill
public void OnInit()
{
B3SubstituteDataProvider.Register();
SubSystem.RegisterSubSystem(new SubSystem("B3SubstituteKill", "B3代宰系统")
{
DisplayOrder = -601
});
}
}
}

+ 1
- 0
B3SubstituteKill/B3SubstituteKill.csproj View File

@ -86,6 +86,7 @@
<Compile Include="BL\Bills\SubKillWeightBill\WeightingInfoBL.cs" />
<Compile Include="BL\Bills\SubKillWeightBill\SubKillWeightBillBL.cs" />
<Compile Include="BO\BaseInfos\GenerationCostItem\GenerationCostItem.cs" />
<Compile Include="BO\BaseInfos\SubKillFlag\SubKillFlag_Detail.cs" />
<Compile Include="BO\BaseInfos\SubKillProductLine\SubKillProductLine.cs" />
<Compile Include="BO\BaseInfos\SubKillFlag\SubKillFlag.cs" />
<Compile Include="BO\BaseInfos\SubKillCallBack\SubKillCallBack.cs" />


+ 18
- 0
B3SubstituteKill/BL/BaseInfos/SubKillFlag/SubKillFlagBL.cs View File

@ -2,6 +2,7 @@
using BWP.B3SubstituteKill.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.BusinessInterfaces;
using Forks.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
@ -18,5 +19,22 @@ namespace BWP.B3SubstituteKill.BL
public class SubKillFlagBL : DomainBaseInfoBL<SubKillFlag>, ISubKillFlagBL
{
protected override void doInitNewDmo(SubKillFlag dmo)
{
base.doInitNewDmo(dmo);
dmo.Name = Guid.NewGuid().ToString();
}
protected override void beforeSave(SubKillFlag dmo)
{
foreach (var g in dmo.Details.GroupBy(x => x.Name))
{
if (g.Count() > 1)
throw new Exception(string.Format("名称:{0} 重复", g.Key));
}
foreach (var detail in dmo.Details)
detail.Spell = Converter.GetPinYin(detail.Name);
base.beforeSave(dmo);
}
}
}

+ 9
- 0
B3SubstituteKill/BO/BaseInfos/SubKillFlag/SubKillFlag.cs View File

@ -41,5 +41,14 @@ namespace BWP.B3SubstituteKill.BO
[ReferenceTo(typeof(Supplier), "Name")]
[Join("Supplier_ID", "ID")]
public string Supplier_Name { get; set; }
private SubKillFlag_DetailCollection _mDetails = new SubKillFlag_DetailCollection();
[OneToMany(typeof(SubKillFlag_Detail), "ID")]
[Join("ID", "SubKillFlag_ID")]
public SubKillFlag_DetailCollection Details
{
get { return _mDetails; }
set { _mDetails = value; }
}
}
}

+ 27
- 0
B3SubstituteKill/BO/BaseInfos/SubKillFlag/SubKillFlag_Detail.cs View File

@ -0,0 +1,27 @@
using BWP.B3Frameworks.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BWP.B3SubstituteKill.BO
{
[DFClass, Serializable, LogicName("代宰标识_明细")]
public class SubKillFlag_Detail : Base
{
public long SubKillFlag_ID { get; set; }
[DFNotEmpty]
[LogicName("标识名称")]
public string Name { get; set; }
public string Spell { get; set; }
}
[Serializable]
public class SubKillFlag_DetailCollection : DmoCollection<SubKillFlag_Detail>
{ }
}

+ 3
- 1
WebFolder/config/Plugins/B3SubstituteKill.plugin View File

@ -87,7 +87,9 @@
<Function index="9" name="作废" />
<Function index="10" name="完毕"/>
<Function index="11" name="撤销完毕"/>
<Function index="12" name="数据分析"/>
<Function index="12" name="编辑头数"/>
<Function index="13" name="编辑重量"/>
<Function index="14" name="数据分析"/>
</FunctionGroup>
</Security>
<Menus>


Loading…
Cancel
Save