108 lines
4.1 KiB
C#
108 lines
4.1 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using Kingdee.BOS;
|
|
using Kingdee.BOS.Core.Bill.PlugIn;
|
|
using Kingdee.BOS.Core.Bill.PlugIn.Args;
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
|
using Kingdee.BOS.Core.Metadata;
|
|
using Kingdee.BOS.Core.Metadata.EntityElement;
|
|
using Kingdee.BOS.Core.SqlBuilder;
|
|
using Kingdee.BOS.Orm.DataEntity;
|
|
using Kingdee.BOS.ServiceHelper;
|
|
using Kingdee.BOS.Util;
|
|
using Kingdee.BOS.Core.DynamicForm;
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn;
|
|
using Kingdee.BOS.Core.Validation;
|
|
using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;
|
|
|
|
namespace aoyuPlugIn
|
|
{
|
|
[Description("调拔单")]
|
|
public class cc_dbd : AbstractBillPlugIn
|
|
{
|
|
List<KeyValuePair<int, string>> mycolor = new List<KeyValuePair<int, string>>();
|
|
public override void BarItemClick(BarItemClickEventArgs e)
|
|
{
|
|
base.BarItemClick(e);
|
|
if (e.BarItemKey == "tbApprove" || e.BarItemKey == "tbSplitApprove")
|
|
{
|
|
string fbillno = this.View.Model.GetValue("FBillNo").ToString();
|
|
var sSql = String.Format("EXEC hz_cc_dbd " + fbillno);
|
|
var dr = DBServiceHelper.ExecuteDynamicObject(this.Context, sSql);
|
|
if (dr.Count > 0)
|
|
{
|
|
|
|
string t = "发货数量大于当前库存,不能审核!";
|
|
foreach (var item in dr)
|
|
{
|
|
string k = "物料编号:" + item["FNUMBER"].ToString() + "|未出库数合计:" + item["wcks"].ToString()
|
|
+ "|即时库存:" + item["jskc"].ToString();
|
|
t = t + "\r\n" + k;
|
|
}
|
|
|
|
List<KeyValuePair<int, string>> colors = new List<KeyValuePair<int, string>>();
|
|
DynamicObjectCollection entrys = this.View.Model.GetEntityDataObject(this.View.BusinessInfo.GetEntity("FBillEntry"));
|
|
int rowNo = 0;
|
|
//80C8FE
|
|
foreach (var one in entrys)
|
|
{
|
|
string wl = "";
|
|
wl = Convert.ToString((this.View.Model.GetValue("FMATERIALID", rowNo) as DynamicObject)["Number"]);
|
|
foreach (var item in dr)
|
|
{
|
|
if (item["FNUMBER"].ToString() == wl)
|
|
{
|
|
colors.Add(new KeyValuePair<int, string>(rowNo, "#80C8FE"));
|
|
mycolor.Add(new KeyValuePair<int, string>(rowNo, "#FFFFFF"));
|
|
}
|
|
}
|
|
rowNo++;
|
|
}
|
|
EntryGrid grid = this.View.GetControl<EntryGrid>("FBillEntry");
|
|
grid.SetRowBackcolor(colors);
|
|
|
|
this.View.ShowMessage(t);
|
|
//setColor();
|
|
e.Cancel = true;
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
public override void EntryBarItemClick(BarItemClickEventArgs e)
|
|
{
|
|
base.EntryBarItemClick(e);
|
|
if (e.BarItemKey.ToString() == "tbDeleteRow")
|
|
{
|
|
EntryGrid grid = this.View.GetControl<EntryGrid>("FBillEntry");
|
|
|
|
//int tol = this.Model.GetEntryRowCount("FEntity");
|
|
int k = this.Model.GetEntryCurrentRowIndex("FBillEntry");
|
|
|
|
grid.SetRowBackcolor("#FFFFFF", k);
|
|
|
|
}
|
|
//this.View.ShowMessage(e.BarItemKey.ToString());
|
|
}
|
|
|
|
|
|
//设置行颜色
|
|
void setColor()
|
|
{
|
|
List<KeyValuePair<int, string>> colors = new List<KeyValuePair<int, string>>();
|
|
DynamicObjectCollection entrys = this.View.Model.GetEntityDataObject(this.View.BusinessInfo.GetEntity("FBillEntry"));
|
|
int rowNo = 0;
|
|
foreach (var one in entrys)
|
|
{
|
|
colors.Add(new KeyValuePair<int, string>(rowNo, "#80C8FE"));
|
|
rowNo++;
|
|
}
|
|
EntryGrid grid = this.View.GetControl<EntryGrid>("FBillEntry");
|
|
grid.SetRowBackcolor(colors);
|
|
}
|
|
}
|
|
}
|