SVN r799
SVN-Revision: r799
This commit is contained in:
@@ -860,17 +860,37 @@ namespace Lskj.PubBillSpecial
|
||||
}
|
||||
}
|
||||
|
||||
//获取红蓝单据
|
||||
string DocumentColor = this.rdBlue.Checked ? "0" : this.rdRed.Checked ? "1" : "";
|
||||
|
||||
|
||||
if ((rowItem["orderid"] + "").Equals("999"))
|
||||
{
|
||||
string ModuleCode = model.DllParam2;
|
||||
FrmSource frmSource = new FrmSource(ModuleCode, SysModel, model.MaxWindow);
|
||||
FrmSource frmSource = new FrmSource(ModuleCode, SysModel, model.MaxWindow,false);
|
||||
frmSource.PrimaryKey = this.BillModel.PrimaryKey;
|
||||
frmSource.PrimaryValue = this.lblOrderNo.Text;
|
||||
frmSource.DocumentColor = DocumentColor;
|
||||
frmSource.Text = model.MenuName;
|
||||
if (frmSource.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
string billNo = this.lblOrderNo.Text = frmSource.PrimaryValue;
|
||||
this.SetBillStatus(BillImpl.GetDataRowResult(string.Format("select * from {0} where {1}='{2}'", BillModel.MasterTable, BillModel.PrimaryKey, billNo)));
|
||||
this.lblOrderNo.Text = frmSource.ReturnPrimaryValue;
|
||||
}
|
||||
this.SetBillStatus(BillImpl.GetDataRowResult(string.Format("select * from {0} where {1}='{2}'", BillModel.MasterTable, BillModel.PrimaryKey, this.lblOrderNo.Text)));
|
||||
}
|
||||
else if ((rowItem["orderid"] + "").Equals("888"))
|
||||
{
|
||||
string ModuleCode = model.DllParam2;
|
||||
FrmSource frmSource = new FrmSource(ModuleCode, SysModel, model.MaxWindow,true);
|
||||
frmSource.PrimaryKey = this.BillModel.PrimaryKey;
|
||||
frmSource.PrimaryValue = this.lblOrderNo.Text;
|
||||
frmSource.DocumentColor = DocumentColor;
|
||||
frmSource.Text = model.MenuName;
|
||||
if (frmSource.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
this.lblOrderNo.Text = frmSource.ReturnPrimaryValue;
|
||||
}
|
||||
this.SetBillStatus(BillImpl.GetDataRowResult(string.Format("select * from {0} where {1}='{2}'", BillModel.MasterTable, BillModel.PrimaryKey, this.lblOrderNo.Text)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6534,10 +6554,6 @@ namespace Lskj.PubBillSpecial
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
switch (Type.ToUpper())
|
||||
{
|
||||
case "A":
|
||||
@@ -6612,7 +6628,7 @@ namespace Lskj.PubBillSpecial
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// 执行扫码的存储过程
|
||||
/// </summary>
|
||||
/// <param name="MainRowItem">明细选中行</param>
|
||||
///<param name="Quantity">数量</param>
|
||||
@@ -6778,4 +6794,43 @@ namespace Lskj.PubBillSpecial
|
||||
if (rightEdge > maxRightEdge)
|
||||
{
|
||||
maxRightEdge = rightEdge;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (minLeft == int.MaxValue) minLeft = 0;
|
||||
|
||||
|
||||
int MovingDistance = (Screen.PrimaryScreen.WorkingArea.Width - maxRightEdge) / 2;
|
||||
|
||||
if (dataTable.Columns.Contains("controlLeft") && MovingDistance > 0)
|
||||
{
|
||||
foreach (DataRow item in dataTable.Rows)
|
||||
{
|
||||
item["controlLeft"] = int.Parse(item["controlLeft"] + "") + MovingDistance - minLeft;
|
||||
|
||||
}
|
||||
}
|
||||
return dataTable;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断是不是数值
|
||||
/// </summary>
|
||||
/// <param name="oText"></param>
|
||||
/// <returns></returns>
|
||||
private bool IsNumberic(string oText)
|
||||
{
|
||||
try
|
||||
{
|
||||
int var1 = Convert.ToInt32(oText);
|
||||
return true;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -90,7 +90,7 @@ namespace Lskj.PubBillSpecial
|
||||
// simpleButton1
|
||||
//
|
||||
this.simpleButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.simpleButton1.Appearance.Font = new System.Drawing.Font("宋体", 9F);
|
||||
this.simpleButton1.Appearance.Font = new System.Drawing.Font("宋体", 10F);
|
||||
this.simpleButton1.Appearance.Options.UseFont = true;
|
||||
this.simpleButton1.Location = new System.Drawing.Point(999, 6);
|
||||
this.simpleButton1.Margin = new System.Windows.Forms.Padding(4);
|
||||
|
||||
@@ -52,9 +52,21 @@ namespace Lskj.PubBillSpecial
|
||||
/// </summary>
|
||||
public string PrimaryKey;
|
||||
/// <summary>
|
||||
/// 主键值
|
||||
/// 主键字段
|
||||
/// </summary>
|
||||
public string PrimaryValue;
|
||||
/// <summary>
|
||||
/// 返回主键值
|
||||
/// </summary>
|
||||
public string ReturnPrimaryValue;
|
||||
/// <summary>
|
||||
/// 红蓝单据
|
||||
/// </summary>
|
||||
public string DocumentColor;
|
||||
/// <summary>
|
||||
/// 隐藏固定按钮(继续制单)
|
||||
/// </summary>
|
||||
public bool isHideButton;
|
||||
|
||||
public FrmSource()
|
||||
{
|
||||
@@ -62,9 +74,10 @@ namespace Lskj.PubBillSpecial
|
||||
|
||||
}
|
||||
|
||||
public FrmSource(string moduleCode, DynamicModel dyncModel, bool MaxWindow)
|
||||
public FrmSource(string moduleCode, DynamicModel dyncModel, bool MaxWindow, bool ishidebutton=false)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.isHideButton = ishidebutton;
|
||||
this.WindowState = MaxWindow ? FormWindowState.Maximized : FormWindowState.Normal;
|
||||
this.Model = dyncModel;
|
||||
//根据传入的模块号获取模块信息
|
||||
@@ -92,6 +105,11 @@ namespace Lskj.PubBillSpecial
|
||||
this.gcMain.SetReadOnlyColumns(mainGridColumns, GridCustomColumnStruct.BaseMainGridView + this.SysModel.FormKey);//主表列配置
|
||||
DataTable RightMenus = BaseModuleImpl.GetBaseGridRightMenus(this.SysModel.ModeCode);//右键
|
||||
int j = 0, x = simpleButton1.Left;
|
||||
if (isHideButton)
|
||||
{
|
||||
x = simpleButton1.Left + simpleButton1.Width;
|
||||
this.simpleButton1.Visible = false;
|
||||
}
|
||||
foreach (DataRow item in RightMenus.Rows)
|
||||
{
|
||||
SimpleButton itemCommon = new SimpleButton();
|
||||
@@ -104,10 +122,10 @@ namespace Lskj.PubBillSpecial
|
||||
itemCommon.Size = new System.Drawing.Size(90, 30);
|
||||
itemCommon.Font = new Font("宋体", 10);
|
||||
itemCommon.Click += new EventHandler(itemCommon_Click);
|
||||
itemCommon.Location = new Point(simpleButton1.Left-100, simpleButton1.Top);
|
||||
itemCommon.Location = new Point(x-100, simpleButton1.Top);
|
||||
itemCommon.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
||||
plm_bottom.Controls.Add(itemCommon);
|
||||
x += 100;
|
||||
x -= 100;
|
||||
if (RightMenus.Columns.Contains("menuCond"))
|
||||
{
|
||||
itemCommon.Enabled = ValidateCond(item["menuCond"] + "", null);
|
||||
@@ -151,16 +169,18 @@ namespace Lskj.PubBillSpecial
|
||||
DataRow TagItem = btn.Tag as DataRow;
|
||||
GridRightMenuModel model = new GridRightMenuModel(TagItem);
|
||||
CommonMenu menu = new CommonMenu(this.Model, this.SearchMainObj, this.gcMain);
|
||||
menu.ApplyBefore += new CommonToolApplyEventHandler(OnMenuApplyBefore);
|
||||
if ((TagItem["orderid"]+"").Equals("8888"))
|
||||
{
|
||||
menu.ReturnStoredProcedureValue += Menu_ReturnStoredProcedureValue;
|
||||
}
|
||||
menu.Apply(TagItem);
|
||||
if (model != null && model.Refresh)
|
||||
{
|
||||
this.SearchMainObj.SearchLastGrid();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -169,6 +189,39 @@ namespace Lskj.PubBillSpecial
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 替换参数前执行
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
private void OnMenuApplyBefore(ApplyArgs e)
|
||||
{
|
||||
string[] paramList = new string[e.MemuModel.ParamList.Count];
|
||||
|
||||
for (int i = 0; i < e.MemuModel.ParamList.Count; i++)
|
||||
{
|
||||
string item = e.MemuModel.ParamList[i];
|
||||
List<string> condition = ReplaceHelper.GetParamFields(item);
|
||||
foreach (string cond in condition)
|
||||
{
|
||||
if (cond.Equals("{DocumentColor}", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
item = ReplaceHelper.ReplaceParamToValue(item, cond, this.DocumentColor);
|
||||
}
|
||||
if (cond.Equals("{" + this.PrimaryKey + "}", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
item = ReplaceHelper.ReplaceParamToValue(item, cond, this.PrimaryValue);
|
||||
}
|
||||
}
|
||||
paramList[i] = item;
|
||||
}
|
||||
e.MemuModel.ParamList = paramList.ToList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 判断按钮条件
|
||||
@@ -698,4 +751,19 @@ namespace Lskj.PubBillSpecial
|
||||
}
|
||||
else if (dataRow == null)
|
||||
{
|
||||
|
||||
result = ReplaceHelper.EvalCond(cond);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = ReplaceHelper.ReplaceRowParamCond(dataRow, cond);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
///
|
||||
Reference in New Issue
Block a user