public static void DeleteSystemValueFromStaticSystemValueList(PublicInterfaces.ISystemValue iSystemValue)
 {
     if (htSystemValueList.Contains(iSystemValue.ValueID))
     {
         htSystemValueList.Remove(iSystemValue.ValueID);
     }
 }
 /// <summary>
 /// 想全局系统变量列表中添加系统变量。若ID重复,则不添加。
 /// </summary>
 /// <param name="iSystemValue">系统变量。</param>
 public static void AddSystemValueToStaticSystemValueList(PublicInterfaces.ISystemValue iSystemValue)
 {
     if (iSystemValue == null)
     {
         return;
     }
     if (!htSystemValueList.Contains(iSystemValue.ValueID))
     {
         htSystemValueList.Add(iSystemValue.ValueID, iSystemValue);
     }
 }
        private ToolStripMenuItem NewToolStripMenuItem(PublicInterfaces.ISystemValue systemValue)
        {
            ToolStripMenuItem t = new ToolStripMenuItem();

            Objects.Column column = new QuickReportCore.Objects.Column();
            column.ID   = Managers.Functions.GetSQLCode(systemValue.ValueID, QuickReportCore.Managers.Functions.SQLCodeType.System);
            column.Name = systemValue.ValueName;
            t.Name      = column.ID;
            t.Text      = column.Name;
            t.Tag       = column;
            return(t);
        }
        private PublicInterfaces.ISystemValue GetSystemValueFromFp(int i)
        {
            string dllName   = (fpInterfaces_Sheet1.Cells[i, 0].CellType as FarPoint.Win.Spread.CellType.HyperLinkCellType).Text;
            string className = fpInterfaces_Sheet1.Cells[i, 1].Text;

            if (dllName == string.Empty || className == string.Empty)
            {
                return(null);
            }
            PublicInterfaces.ISystemValue iSystemValue = Managers.Functions.CreateInstance(dllName, className) as PublicInterfaces.ISystemValue;
            fpInterfaces_Sheet1.Rows[i].Tag = iSystemValue;
            return(iSystemValue);
        }
 private void fpInterfaces_EditChange(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
 {
     if (e.Column == 1)
     {
         PublicInterfaces.ISystemValue iSystemValue = GetSystemValueFromFp(e.Row);
         if (iSystemValue != null)
         {
             Forms.frmToolBoxSystemValue.AddSystemValueToStaticSystemValueList(iSystemValue);
             Forms.frmToolBoxSystemValue.SystemValueListHasBeenChanged = true;
         }
     }
     if (HaveBeenChanged != null)
     {
         HaveBeenChanged(sender, null);
     }
 }
        public static void GetAllSystemValue()
        {
            htSystemValueList = new Hashtable();
            assembly          = Assembly.LoadFrom("QuickReportCore.dll");
            Type[]      types    = assembly.GetTypes();
            List <Type> typeList = new List <Type>();

            for (int i = 0; i < types.Length; i++)
            {
                if (types[i].GetInterface(typeof(PublicInterfaces.ISystemValue).FullName) == null)
                {
                    continue;
                }
                PublicInterfaces.ISystemValue iSystemValue = System.Activator.CreateInstance(types[i]) as PublicInterfaces.ISystemValue;
                AddSystemValueToStaticSystemValueList(iSystemValue);
            }
        }
 private void AddSystemValue(PublicInterfaces.ISystemValue systemValue)
 {
     if (systemValue.SystemValueType == QuickReportCore.Objects.SystemValues.SystemValueType.Date)
     {
         Date.DropDownItems.Add(NewToolStripMenuItem(systemValue));
     }
     if (systemValue.SystemValueType == QuickReportCore.Objects.SystemValues.SystemValueType.DateTime)
     {
         DateTime.DropDownItems.Add(NewToolStripMenuItem(systemValue));
     }
     if (systemValue.SystemValueType == QuickReportCore.Objects.SystemValues.SystemValueType.Oper)
     {
         Oper.DropDownItems.Add(NewToolStripMenuItem(systemValue));
     }
     if (systemValue.SystemValueType == QuickReportCore.Objects.SystemValues.SystemValueType.Dept)
     {
         Dept.DropDownItems.Add(NewToolStripMenuItem(systemValue));
     }
 }
 private void Init()
 {
     foreach (DictionaryEntry de in QuickReportCore.Forms.frmToolBoxSystemValue.htSystemValueList)
     {
         PublicInterfaces.ISystemValue i = de.Value as PublicInterfaces.ISystemValue;
         if (i.SystemValueType == QuickReportCore.Objects.SystemValues.SystemValueType.Date)
         {
             cmbSystemDataValue.Items.Add(i);
             string valueID = Managers.Functions.GetSQLCode(i.ValueID, QuickReportCore.Managers.Functions.SQLCodeType.System);
             if (!htSystemDataValue.Contains(valueID))
             {
                 htSystemDataValue.Add(valueID, i.ValueName);
             }
         }
     }
     if (cmbSystemDataValue.Items.Count > 0)
     {
         cmbSystemDataValue.SelectedIndex = 0;
     }
     cmbAddOrSub.Text = "+";
 }
 private void tbDelete_Click(object sender, EventArgs e)
 {
     if (fpInterfaces_Sheet1.ActiveCell == null)
     {
         return;
     }
     if (fpInterfaces_Sheet1.RowCount > 0)
     {
         PublicInterfaces.ISystemValue iSystemValue = fpInterfaces_Sheet1.Rows[fpInterfaces_Sheet1.ActiveRowIndex].Tag as PublicInterfaces.ISystemValue;
         string valueID = string.Empty;
         if (iSystemValue != null)
         {
             valueID = iSystemValue.ValueID;
         }
         fpInterfaces_Sheet1.Rows.Remove(fpInterfaces_Sheet1.ActiveCell.Row.Index, 1);
         if (valueID == string.Empty)
         {
             return;
         }
         bool needRefresh = true;
         for (int i = 0; i < fpInterfaces_Sheet1.Rows.Count; i++)
         {
             PublicInterfaces.ISystemValue tempI = fpInterfaces_Sheet1.Rows[i].Tag as PublicInterfaces.ISystemValue;
             if (tempI == null)
             {
                 continue;
             }
             if (tempI.ValueID == iSystemValue.ValueID)
             {
                 needRefresh = false;
                 break;
             }
         }
         if (needRefresh)
         {
             Forms.frmToolBoxSystemValue.DeleteSystemValueFromStaticSystemValueList(iSystemValue);
             Forms.frmToolBoxSystemValue.SystemValueListHasBeenChanged = true;
         }
     }
 }
        private List <PublicInterfaces.ISystemValue> GetSystemValueFromFp()
        {
            List <PublicInterfaces.ISystemValue> list = new List <QuickReportCore.PublicInterfaces.ISystemValue>();

            for (int i = 0; i < fpInterfaces_Sheet1.Rows.Count; i++)
            {
                string dllName   = (fpInterfaces_Sheet1.Cells[i, 0].CellType as FarPoint.Win.Spread.CellType.HyperLinkCellType).Text;
                string className = fpInterfaces_Sheet1.Cells[i, 1].Text;
                if (dllName == string.Empty || className == string.Empty)
                {
                    continue;
                }
                PublicInterfaces.ISystemValue iSystemValue = Managers.Functions.CreateInstance(dllName, className) as PublicInterfaces.ISystemValue;
                if (iSystemValue == null)
                {
                    continue;
                }
                fpInterfaces_Sheet1.Rows[i].Tag = iSystemValue;
                list.Add(iSystemValue);
            }
            return(list);
        }