添加项目文件。
This commit is contained in:
107
aoyuPlugIn/常成/cc_dbd.cs
Normal file
107
aoyuPlugIn/常成/cc_dbd.cs
Normal file
@@ -0,0 +1,107 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
67
aoyuPlugIn/常成/cc_dbd_lb.cs
Normal file
67
aoyuPlugIn/常成/cc_dbd_lb.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
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.List.PlugIn;
|
||||
|
||||
namespace aoyuPlugIn
|
||||
{
|
||||
[Description("调拔单列表审核")]
|
||||
public class cc_dbd_lb : AbstractListPlugIn
|
||||
{
|
||||
public override void BeforeDoOperation(BeforeDoOperationEventArgs e)
|
||||
{
|
||||
base.BeforeDoOperation(e);
|
||||
if (e.Operation.FormOperation.Id == "ad221364-f04e-4b31-8a69-debd8f5066bc")//审核
|
||||
{
|
||||
if (this.ListView.SelectedRowsInfo.Count > 0)
|
||||
|
||||
{
|
||||
|
||||
for (int i = 0; i < this.ListView.SelectedRowsInfo.Count; i++)
|
||||
{
|
||||
//取指定行单据编号
|
||||
string fbillno = this.ListView.SelectedRowsInfo[i].BillNo;
|
||||
string zt = this.ListView.SelectedRowsInfo[i].DataRow["FDOCUMENTSTATUS"].ToString();
|
||||
|
||||
if (zt == "D" || zt == "B")
|
||||
{
|
||||
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 = "单据编号:" + fbillno + "中物料:" + item["FNUMBER"].ToString() + "|未出库数合计:" + item["wcks"].ToString()
|
||||
+ "|即时库存:" + item["jskc"].ToString();
|
||||
t = t + "\r\n" + k;
|
||||
}
|
||||
this.View.ShowMessage(t);
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
109
aoyuPlugIn/常成/fhtzd.cs
Normal file
109
aoyuPlugIn/常成/fhtzd.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
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;
|
||||
//using System.Windows.Forms;
|
||||
//using System.Data;
|
||||
|
||||
|
||||
namespace aoyuPlugIn
|
||||
{//AbstractValidator
|
||||
[Description("发货通知单")]
|
||||
public class xs_fhtzd : 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_fhtzd " + 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("FEntity"));
|
||||
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>("FEntity");
|
||||
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>("FEntity");
|
||||
|
||||
//int tol = this.Model.GetEntryRowCount("FEntity");
|
||||
int k=this.Model.GetEntryCurrentRowIndex("FEntity");
|
||||
|
||||
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("FEntity"));
|
||||
int rowNo = 0;
|
||||
foreach(var one in entrys)
|
||||
{
|
||||
colors.Add(new KeyValuePair<int, string>(rowNo, "#80C8FE"));
|
||||
rowNo++;
|
||||
}
|
||||
EntryGrid grid = this.View.GetControl<EntryGrid>("FEntity");
|
||||
grid.SetRowBackcolor(colors);
|
||||
}
|
||||
}
|
||||
}
|
||||
108
aoyuPlugIn/常成/fhtzd_lb.cs
Normal file
108
aoyuPlugIn/常成/fhtzd_lb.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
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.List.PlugIn;
|
||||
|
||||
namespace aoyuPlugIn
|
||||
{
|
||||
[Description("发货通知单列表审核")]
|
||||
public class fhtzd_lb: AbstractListPlugIn
|
||||
{
|
||||
|
||||
//列表菜单事件
|
||||
public override void AfterBarItemClick(AfterBarItemClickEventArgs e)
|
||||
{
|
||||
base.AfterBarItemClick(e);
|
||||
|
||||
if (e.BarItemKey == "tbSplitApprove" || e.BarItemKey == "tbApprove")//审核
|
||||
{
|
||||
return;
|
||||
if (this.ListView.SelectedRowsInfo.Count > 0)
|
||||
|
||||
{
|
||||
|
||||
for (int i = 0; i < this.ListView.SelectedRowsInfo.Count; i++)
|
||||
{
|
||||
//取指定行单据编号
|
||||
string fbillno = this.ListView.SelectedRowsInfo[i].BillNo;
|
||||
string zt = this.ListView.SelectedRowsInfo[i].DataRow["FDOCUMENTSTATUS"].ToString();
|
||||
|
||||
if (zt == "D" || zt == "B")
|
||||
{
|
||||
var sSql = String.Format("EXEC hz_fhtzd " + 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;
|
||||
}
|
||||
this.View.ShowMessage(t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void BeforeDoOperation(BeforeDoOperationEventArgs e)
|
||||
{
|
||||
base.BeforeDoOperation(e);
|
||||
if (e.Operation.FormOperation.Id == "ad221364-f04e-4b31-8a69-debd8f5066bc")//审核
|
||||
{
|
||||
if (this.ListView.SelectedRowsInfo.Count > 0)
|
||||
|
||||
{
|
||||
|
||||
for (int i = 0; i < this.ListView.SelectedRowsInfo.Count; i++)
|
||||
{
|
||||
//取指定行单据编号
|
||||
string fbillno = this.ListView.SelectedRowsInfo[i].BillNo;
|
||||
string zt = this.ListView.SelectedRowsInfo[i].DataRow["FDOCUMENTSTATUS"].ToString();
|
||||
|
||||
if (zt == "D" || zt == "B")
|
||||
{
|
||||
var sSql = String.Format("EXEC hz_fhtzd " + fbillno);
|
||||
var dr = DBServiceHelper.ExecuteDynamicObject(this.Context, sSql);
|
||||
if (dr.Count > 0)
|
||||
{
|
||||
|
||||
string t = "发货数量大于当前库存,不能审核!";
|
||||
foreach (var item in dr)
|
||||
{
|
||||
string k = "单据编号:"+fbillno+"中物料:" + item["FNUMBER"].ToString() + "|未出库数合计:" + item["wcks"].ToString()
|
||||
+ "|即时库存:" + item["jskc"].ToString();
|
||||
t = t + "\r\n" + k;
|
||||
}
|
||||
this.View.ShowMessage(t);
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user