//初始化功能命令关系 /// <summary> /// 初始化功能命令关系 /// </summary> private void InitFuncCommands(RightFunction rightFunction) { if (rightFunction == null) { return; } var list = RightLkFunctionCommandBll.QueryRightLkFunctionCommand(new QueryCondition { Resv01 = rightFunction.Sysid }); gridViewCommand.ValueChanging -= gridViewCommand_ValueChanging; _commandsInDb = new List <DictionaryItem>(); foreach (var row in gridViewCommand.Rows) { var command = row.DataBoundItem as DictionaryItem; if (command == null) { continue; } var isChecked = list.FindAll(p => p.CommandSysid == command.Sysid).Count > 0; if (isChecked) { var copiedCommand = Mapper.Map <DictionaryItem, DictionaryItem>(command); _commandsInDb.Add(copiedCommand); } row.Cells[0].Value = isChecked; } gridViewCommand.ValueChanging += gridViewCommand_ValueChanging; }
//新增数据 /// <summary> /// 新增数据 /// </summary> /// <returns></returns> internal override bool Add() { EditEntity = null; pageViewMain.SelectedPage = pageEditData; UI.ClearUi(pageEditData); UI.ReadOnlyUi(pageEditData, false); return(true); }
public Matrix <R> ComputeVariablesJacobian(D input) { var leftJacobian = LeftFunction.ComputeParametersJacobian(input); var rightJacobian = RightFunction.ComputeParametersJacobian(input); var scalar = RightFunction.Compute(input).MultiplicativeInverse; leftJacobian *= scalar; rightJacobian *= -LeftFunction.Compute(input) * scalar * scalar; return(leftJacobian - rightJacobian); }
private void SetRightGrid(RightFunction function) { this.splitMain.Panel2.SuspendLayout(); this.viewData.SuspendLayout(); txtIntroduction.Visible = function == RightFunction.Introduction; viewData.Visible = function == RightFunction.EditTable; lblEmpty.Visible = function == RightFunction.Empty; txtIntroduction.Dock = DockStyle.Fill; viewData.Dock = DockStyle.Fill; lblEmpty.Location = new Point(0, 0); this.viewData.ResumeLayout(false); this.splitMain.Panel2.ResumeLayout(false); this.splitMain.Panel2.PerformLayout(); }
//用编辑框数据填充实体 /// <summary> /// 用编辑框数据填充实体 /// </summary> private void BuildEntity() { if (CurrentOperationStatus == OperationStatus.New) { EditEntity = new RightFunction { Sysid = Sysid.NewId(""), CreatedBy = GloableData.Instance.UserId } } ; EditEntity.ModifiedBy = GloableData.Instance.UserId; EditEntity.FuncCode = UI.GetValue(txtFuncCode); EditEntity.FuncName = UI.GetValue(txtFuncName); EditEntity.FuncParam = UI.GetValue(txtFuncParam); EditEntity.RecordStatus = UI.GetValue(chkIsEnable); }
//删除数据 /// <summary> /// 删除数据 /// </summary> /// <returns></returns> internal override bool Delete() { if (EditEntity == null) { UI.ShowWarn("请选择待删除数据"); return(false); } if (!UI.Confirm("确定要删除吗?")) { return(false); } if (!RightFunctionBll.DeleteRightFunction(EditEntity)) { UI.ShowError("删除失败"); return(false); } EditEntity = null; UI.ClearUi(pageEditData); return(true); }
public virtual TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery) { var values = new List <TypedValue>(); if (ParameterValues != null) { for (int i = 0; i < ParameterValues.Length; i++) { values.Add(new TypedValue(TypeFactory.HeuristicType(ParameterTypes[i].Name), ParameterValues[i], EntityMode.Poco)); } } if (ReturnType != null && InnerCriterion is SimpleExpression) { var simple = InnerCriterion as SimpleExpression; values.Add(new TypedValue(TypeFactory.HeuristicType(ReturnType.Name), simple.Value, EntityMode.Poco)); } if (RightFunction != null) { values.AddRange(RightFunction.GetTypedValues(criteria, criteriaQuery)); } return(values.ToArray()); }
public virtual SqlString ToSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery, IDictionary <string, IFilter> enabledFilters) { var sql = new SqlStringBuilder(); string leftPropertyName = null; string rightPropertyName = null; if (InnerCriterion is SimpleExpression) { leftPropertyName = ((SimpleExpression)InnerCriterion).PropertyName; } else if (InnerCriterion is PropertyExpression) { System.Type type = typeof(PropertyExpression); leftPropertyName = type.GetField("_lhsPropertyName", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(InnerCriterion) as String; rightPropertyName = type.GetField("_rhsPropertyName", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(InnerCriterion) as String; } AddParameters(leftPropertyName, sql, criteria, criteriaQuery); sql.Add(" ").Add(Op).Add(" "); if (RightFunction != null) { RightFunction.AddParameters(rightPropertyName, sql, criteria, criteriaQuery); } else { sql.AddParameter(); } return(sql.ToSqlString()); }
public void GetAllParametersOptimizationScales(R[] buffer, int startIndex) { LeftFunction.GetAllParametersOptimizationScales(buffer, startIndex); RightFunction.GetAllParametersOptimizationScales(buffer, startIndex + LeftFunction.ParametersCount); }
public void SetAllParameters(R[] paramValues, int startIndex) { LeftFunction.SetAllParameters(paramValues, startIndex); RightFunction.SetAllParameters(paramValues, startIndex + LeftFunction.ParametersCount); }
public R Compute(D input) { return(LeftFunction.Compute(input).Divide(RightFunction.Compute(input))); }
public void GetAllParameters(PF[] buffer, int startIndex) { LeftFunction.GetAllParameters(buffer, startIndex); RightFunction.GetAllParameters(buffer, startIndex + LeftFunction.ParametersCount); }
public Matrix <PF> ComputeVariablesJacobian(D input) { return(LeftFunction.ComputeVariablesJacobian(input) - RightFunction.ComputeVariablesJacobian(input)); }
public Matrix <PF> ComputeParametersJacobian(D input) { return(Matrix <PF> .ConcatRows(LeftFunction.ComputeParametersJacobian(input), -RightFunction.ComputeParametersJacobian(input))); }
public R Compute(D input) { return(LeftFunction.Compute(input).Subtract(RightFunction.Compute(input))); }