public override bool Update(TransactionManager transactionManager, DictionaryName entity) { SqlDatabase database = new SqlDatabase(this._connectionString); DbCommand command = StoredProcedureProvider.GetCommandWrapper(database, "dbo.DictionaryName_Update", this._useStoredProcedure); database.AddInParameter(command, "@DictionaryNameCode", DbType.AnsiString, entity.DictionaryNameCode); database.AddInParameter(command, "@OriginalDictionaryNameCode", DbType.AnsiString, entity.OriginalDictionaryNameCode); database.AddInParameter(command, "@NAME", DbType.AnsiString, entity.NAME); database.AddInParameter(command, "@ProjectCode", DbType.AnsiString, entity.ProjectCode); database.AddInParameter(command, "@Remark", DbType.AnsiString, entity.Remark); int num = 0; if (transactionManager != null) { num = Utility.ExecuteNonQuery(transactionManager, command); } else { num = Utility.ExecuteNonQuery(database, command); } if (DataRepository.Provider.EnableEntityTracking) { EntityManager.StopTracking(entity.EntityTrackingKey); } entity.OriginalDictionaryNameCode = entity.DictionaryNameCode; entity.AcceptChanges(); return(Convert.ToBoolean(num)); }
private void SetEditArea(DictionaryName dic) { switch (dic) { case DictionaryName.QiProductFamily: this.DivBuAdd.Visible = true; this.DivBuEdit.Visible = true; this.DivParentAdd.Visible = false; this.DivParentEdit.Visible = false; this.DivMailListEdit.Visible = true; //BindHelper.BindBu(this.DdlBuAdd, null, null, null, false); // for bu admin if (ViewState["budata"] != null && (bool)ViewState["budata"]) { this.DdlBuAdd.ClearSelection(); //this.DdlBuAdd.Items.FindByValue(UserHelper.CurrentBu).Selected = true; this.DdlBuAdd.Enabled = false; } break; case DictionaryName.QiRootCause2: this.DivBuAdd.Visible = false; this.DivBuEdit.Visible = false; this.DivParentAdd.Visible = true; this.DivParentEdit.Visible = true; this.DivMailListEdit.Visible = false; //BindHelper.BindQiRootCause1(this.DdlParentAdd, null, null, null, false); break; case DictionaryName.QiRootCause3: this.DivBuAdd.Visible = false; this.DivBuEdit.Visible = false; this.DivParentAdd.Visible = true; this.DivParentEdit.Visible = true; this.DivMailListEdit.Visible = false; //BindHelper.BindQiRootCause2(this.DdlParentAdd, null, null, null, null, false); break; case DictionaryName.RcMailGroup: this.DivBuAdd.Visible = true; this.DivBuEdit.Visible = true; this.DivMailListEdit.Visible = true; //BindHelper.BindBu(this.DdlBuAdd, null, null, null, false); // for bu admin if (ViewState["budata"] != null && (bool)ViewState["budata"]) { this.DdlBuAdd.ClearSelection(); //this.DdlBuAdd.Items.FindByValue(UserHelper.CurrentBu).Selected = true; this.DdlBuAdd.Enabled = false; } break; default: this.DivBuAdd.Visible = false; this.DivBuEdit.Visible = false; this.DivMailListEdit.Visible = false; break; } }
public DictionaryItemBase() { this.inTxn = false; this._dictionaryNameCodeSource = null; this._site = null; this.entityData = new DictionaryItemEntityData(); this.backupData = null; }
/// <summary> /// Creates and returns an initialized version of this struct. /// </summary> /// <param name="dictionary">The dictionary to use to determine which markers will be tracked.</param> /// <param name="markerLength">The length of the markers to be tracked.</param> /// <param name="enabled">Determines if the tracker should currently be enabled or disabled.</param> /// <returns>An initialized version of this struct.</returns> public static Settings Create(DictionaryName dictionary = DictionaryName.DICT_4X4_50, float markerLength = 0.1f, bool enabled = true) { return(new Settings { Dictionary = dictionary, MarkerLength = markerLength, Enabled = enabled }); }
public static DictionaryName CreateDictionaryName(string dictionaryNameDictionaryNameCode, string dictionaryNameNAME, string dictionaryNameProjectCode, string dictionaryNameRemark) { DictionaryName name = new DictionaryName(); name.DictionaryNameCode = dictionaryNameDictionaryNameCode; name.NAME = dictionaryNameNAME; name.ProjectCode = dictionaryNameProjectCode; name.Remark = dictionaryNameRemark; return(name); }
public virtual DictionaryName Copy() { DictionaryName name = new DictionaryName(); name.DictionaryNameCode = this.DictionaryNameCode; name.OriginalDictionaryNameCode = this.OriginalDictionaryNameCode; name.NAME = this.NAME; name.ProjectCode = this.ProjectCode; name.Remark = this.Remark; name.AcceptChanges(); return(name); }
public DictionaryItemBase(string dictionaryItemDictionaryItemCode, string dictionaryItemProjectCode, string dictionaryItemDictionaryNameCode, int?dictionaryItemSortID, string dictionaryItemName) { this.inTxn = false; this._dictionaryNameCodeSource = null; this._site = null; this.entityData = new DictionaryItemEntityData(); this.backupData = null; this.DictionaryItemCode = dictionaryItemDictionaryItemCode; this.ProjectCode = dictionaryItemProjectCode; this.DictionaryNameCode = dictionaryItemDictionaryNameCode; this.SortID = dictionaryItemSortID; this.Name = dictionaryItemName; }
public static string GetDictionaryTableName(DictionaryName dicName) { switch (dicName) { case DictionaryName.SysBu: return "SysBu"; case DictionaryName.QiProductFamily: return "DicQiFamily"; case DictionaryName.QiAttachCategory: return "DicQiAttachCategory"; case DictionaryName.QiProblemType: return "DicQiProblemType"; case DictionaryName.QiRootCause1: return "DicQiRootCause1"; case DictionaryName.QiRootCause2: return "DicQiRootCause2"; case DictionaryName.QiRootCause3: return "DicQiRootCause3"; case DictionaryName.QiCloseLoopCategory: return "DicCloseLoopCategory"; case DictionaryName.QiCloseLoopDepartment: return "DicCloseLoopDepartment"; case DictionaryName.RcMailGroup: return "DicRcMailGroup"; case DictionaryName.EwgInitIssueStatus: return "DicEwgInitIssueStatus"; case DictionaryName.EwgMeetingTeam: return "DicEwgMeetingTeam"; case DictionaryName.EwgFolder: return "DicEwgFolder"; case DictionaryName.EwgInitIssuePhase: return "DicEwgInitIssuePhase"; case DictionaryName.LeDept: return "DicLeDept"; case DictionaryName.LeProblemSource: return "DicLeProblemSource"; case DictionaryName.LeProblemFactory: return "DicLeProblemFactory"; case DictionaryName.LePart: return "DicLePart"; } return null; }
public static void Delete(DataDictionaryEntry entry, DictionaryName dicName) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(String.Format(@"DELETE FROM {1} WHERE [Code] = N'{0}'", entry.Code, GetDictionaryTableName(dicName))); try { db.ExecuteNonQuery(dbCommand); } catch (System.Data.SqlClient.SqlException sex) // 只捕获SqlException,其余抛出继续传播 { DBHelper.ParseSqlException(sex, true); } }
public static void Delete(DataDictionaryEntry entry, DictionaryName dicName) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(String.Format(@"DELETE FROM {1} WHERE [Code] = N'{0}'", entry.Code, GetDictionaryTableName(dicName))); try { db.ExecuteNonQuery(dbCommand); } catch (System.Data.SqlClient.SqlException sex) // 只捕获SqlException,其余抛出继续传播 { DBHelper.ParseSqlException(sex, true); } }
public static void Insert(DataDictionaryEntry entry, DictionaryName dicName) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(String.Format(@"INSERT INTO {4} VALUES (N'{0}', N'{1}', {2}, '{3}', GETDATE(), 0)", entry.Code, entry.Title, entry.Sort, entry.Updator, GetDictionaryTableName(dicName))); try { db.ExecuteNonQuery(dbCommand); } catch (System.Data.SqlClient.SqlException sex) // 只捕获SqlException,其余抛出继续传播 { DBHelper.ParseSqlException(sex, false); } }
public static void Update(DataDictionaryEntry entry, DictionaryName dicName) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(String.Format(@"UPDATE {5} SET [Title] = '{1}' ,[Sort] = {2} ,[Optor] = '{3}',[OpTime] = GETDATE(), [Deleted] = {4} WHERE [Code] = N'{0}'", entry.Code, entry.TitleT, entry.SortT, entry.UpdatorT, entry.VisibleT ? 0 : 1, GetDictionaryTableName(dicName))); try { db.ExecuteNonQuery(dbCommand); } catch (System.Data.SqlClient.SqlException sex) // 只捕获SqlException,其余抛出继续传播 { DBHelper.ParseSqlException(sex, false); } }
public static List <DataDictionaryEntry> GetAll(DictionaryName dicName) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(String.Format(@"SELECT [Code] ,[Title] ,[Sort] ,[Optor] ,[OpTime] ,[Deleted] FROM {0}", GetDictionaryTableName(dicName))); List <DataDictionaryEntry> entries = new List <DataDictionaryEntry>(); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { entries.Add(PopulateEntry(dataReader)); } } return(entries); }
public static List<DataDictionaryEntry> GetAll(DictionaryName dicName) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(String.Format(@"SELECT [Code] ,[Title] ,[Sort] ,[Optor] ,[OpTime] ,[Deleted] FROM {0}", GetDictionaryTableName(dicName))); List<DataDictionaryEntry> entries = new List<DataDictionaryEntry>(); using (IDataReader dataReader = db.ExecuteReader(dbCommand)) { while (dataReader.Read()) { entries.Add(PopulateEntry(dataReader)); } } return entries; }
internal override void DeepLoad(TransactionManager transactionManager, DictionaryItem entity, bool deep, DeepLoadType deepLoadType, Type[] childTypes, ChildEntityTypesList innerList) { if ((entity != null) && (base.CanDeepLoad(entity, "DictionaryName", "DictionaryNameCodeSource", deepLoadType, innerList) && (entity.DictionaryNameCodeSource == null))) { object[] pkItems = new object[] { entity.DictionaryNameCode ?? string.Empty }; DictionaryName name = EntityManager.LocateEntity <DictionaryName>(EntityLocator.ConstructKeyFromPkItems(typeof(DictionaryName), pkItems), DataRepository.Provider.EnableEntityTracking); if (name != null) { entity.DictionaryNameCodeSource = name; } else { entity.DictionaryNameCodeSource = DataRepository.DictionaryNameProvider.GetByDictionaryNameCode(entity.DictionaryNameCode ?? string.Empty); } if (deep && (entity.DictionaryNameCodeSource != null)) { DataRepository.DictionaryNameProvider.DeepLoad(transactionManager, entity.DictionaryNameCodeSource, deep, deepLoadType, childTypes, innerList); } } }
public static void Update(DataDictionaryEntry entry, DictionaryName dicName) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(String.Format(@"UPDATE {5} SET [Title] = '{1}' ,[Sort] = {2} ,[Optor] = '{3}',[OpTime] = GETDATE(), [Deleted] = {4} WHERE [Code] = N'{0}'", entry.Code, entry.TitleT, entry.SortT, entry.UpdatorT, entry.VisibleT ? 0 : 1, GetDictionaryTableName(dicName))); try { db.ExecuteNonQuery(dbCommand); } catch (System.Data.SqlClient.SqlException sex) // 只捕获SqlException,其余抛出继续传播 { DBHelper.ParseSqlException(sex, false); } }
public static void Insert(DataDictionaryEntry entry, DictionaryName dicName) { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand(String.Format(@"INSERT INTO {4} VALUES (N'{0}', N'{1}', {2}, '{3}', GETDATE(), 0)", entry.Code, entry.Title, entry.Sort, entry.Updator, GetDictionaryTableName(dicName))); try { db.ExecuteNonQuery(dbCommand); } catch (System.Data.SqlClient.SqlException sex) // 只捕获SqlException,其余抛出继续传播 { DBHelper.ParseSqlException(sex, false); } }
private void BindData() { DictionaryName dic = (DictionaryName)this.ViewState["DicName"]; SetEditArea(dic); switch (dic) { case DictionaryName.QiProductFamily: if (ViewState["budata"] != null && (bool)ViewState["budata"]) { //this.GvList.DataSource = ProductFamilyDicMgr.Get(UserHelper.CurrentBu, true); } else { this.GvList.DataSource = ProductFamilyDicMgr.Get(true); } break; case DictionaryName.QiAttachCategory: this.GvList.DataSource = QiAttachCategoryDicMgr.Get(true); break; case DictionaryName.QiProblemType: this.GvList.DataSource = QiProblemTypeDicMgr.Get(true); break; case DictionaryName.QiRootCause1: this.GvList.DataSource = QiRootCause1DicMgr.Get(true); break; case DictionaryName.QiRootCause2: this.GvList.DataSource = QiRootCause2DicMgr.Get(true); break; case DictionaryName.QiRootCause3: this.GvList.DataSource = QiRootCause3DicMgr.Get(true); break; case DictionaryName.QiCloseLoopCategory: this.GvList.DataSource = CloseLoopCategoryDicMgr.Get(true); break; case DictionaryName.QiCloseLoopDepartment: this.GvList.DataSource = CloseLoopDepartmentDicMgr.Get(true); break; case DictionaryName.RcMailGroup: if (ViewState["budata"] != null && (bool)ViewState["budata"]) { //this.GvList.DataSource = RcMailGroupDicMgr.Get(UserHelper.CurrentBu, true); } else { this.GvList.DataSource = RcMailGroupDicMgr.Get(true); } break; case DictionaryName.EwgInitIssueStatus: this.GvList.DataSource = EwgInitIssueStatusDicMgr.Get(true); break; case DictionaryName.EwgMeetingTeam: this.GvList.DataSource = EwgMeetingTeamDicMgr.Get(true); break; case DictionaryName.EwgFolder: this.GvList.DataSource = EwgFolderDicMgr.Get(true); break; case DictionaryName.EwgInitIssuePhase: this.GvList.DataSource = EwgInitIssuePhaseDicMgr.Get(true); break; case DictionaryName.LeDept: this.GvList.DataSource = LeDeptDicMgr.Get(true); break; case DictionaryName.LeProblemSource: this.GvList.DataSource = LeProblemSourceDicMgr.Get(true); break; case DictionaryName.LeProblemFactory: this.GvList.DataSource = LeProblemFactoryDicMgr.Get(true); break; case DictionaryName.LePart: this.GvList.DataSource = LePartDicMgr.Get(true); break; } this.GvList.DataBind(); }
/// <summary> /// Get dictionary name's language attribute. /// </summary> /// <param name="dicName">Dictionary name.</param> /// <returns>Language attribute value.</returns> private Language GetDictionaryAttribute(DictionaryName dicName) { System.Reflection.FieldInfo field = typeof(DictionaryName).GetField(dicName.ToString()); object[] attributes = field.GetCustomAttributes(typeof(LanguageAttribute), true); return ((LanguageAttribute)attributes[0]).Language; }
/// <summary> /// Initialize method with specified dictionary. /// </summary> /// <param name="language">Language name.</param> /// <param name="dicName">Dictionary name.</param> private void Initialize(Language language, DictionaryName dicName) { Language lang = Language.Neutral; if (dicName != DictionaryName.All) { lang = GetDictionaryAttribute(dicName); if (lang != language) { string message = Helper.NeutralFormat("{0} is not {1} dictionary.", dicName, language); throw new ArgumentException(message); } } foreach (Type type in _dictionaryTypes) { System.Reflection.FieldInfo fieldInfo = type.GetField("Language"); if ((Language)fieldInfo.GetValue(null) == language) { DictionaryModel dic = (DictionaryModel)Activator.CreateInstance(type); if (lang == Language.Neutral) { _dics.Add(dic); } else { if (dic.GetType().Name.Equals(dicName.ToString(), StringComparison.OrdinalIgnoreCase)) { _dics.Add(dic); } } } } if (_dics.Count == 0) { string message = Helper.NeutralFormat("Not supported dictionary {0} for {1}.", dicName, language); throw new NotSupportedException(message); } }
private void SetEditArea(DictionaryName dic) { switch (dic) { case DictionaryName.QiProductFamily: this.DivBuAdd.Visible = true; this.DivBuEdit.Visible = true; this.DivParentAdd.Visible = false; this.DivParentEdit.Visible = false; this.DivMailListEdit.Visible = true; //BindHelper.BindBu(this.DdlBuAdd, null, null, null, false); // for bu admin if (ViewState["budata"] != null && (bool)ViewState["budata"]) { this.DdlBuAdd.ClearSelection(); //this.DdlBuAdd.Items.FindByValue(UserHelper.CurrentBu).Selected = true; this.DdlBuAdd.Enabled = false; } break; case DictionaryName.QiRootCause2: this.DivBuAdd.Visible = false; this.DivBuEdit.Visible = false; this.DivParentAdd.Visible = true; this.DivParentEdit.Visible = true; this.DivMailListEdit.Visible = false; //BindHelper.BindQiRootCause1(this.DdlParentAdd, null, null, null, false); break; case DictionaryName.QiRootCause3: this.DivBuAdd.Visible = false; this.DivBuEdit.Visible = false; this.DivParentAdd.Visible = true; this.DivParentEdit.Visible = true; this.DivMailListEdit.Visible = false; //BindHelper.BindQiRootCause2(this.DdlParentAdd, null, null, null, null, false); break; case DictionaryName.RcMailGroup: this.DivBuAdd.Visible = true; this.DivBuEdit.Visible = true; this.DivMailListEdit.Visible = true; //BindHelper.BindBu(this.DdlBuAdd, null, null, null, false); // for bu admin if (ViewState["budata"] != null && (bool)ViewState["budata"]) { this.DdlBuAdd.ClearSelection(); //this.DdlBuAdd.Items.FindByValue(UserHelper.CurrentBu).Selected = true; this.DdlBuAdd.Enabled = false; } break; default: this.DivBuAdd.Visible = false; this.DivBuEdit.Visible = false; this.DivMailListEdit.Visible = false; break; } }
public static string GetDictionaryTableName(DictionaryName dicName) { switch (dicName) { case DictionaryName.SysBu: return("SysBu"); case DictionaryName.QiProductFamily: return("DicQiFamily"); case DictionaryName.QiAttachCategory: return("DicQiAttachCategory"); case DictionaryName.QiProblemType: return("DicQiProblemType"); case DictionaryName.QiRootCause1: return("DicQiRootCause1"); case DictionaryName.QiRootCause2: return("DicQiRootCause2"); case DictionaryName.QiRootCause3: return("DicQiRootCause3"); case DictionaryName.QiCloseLoopCategory: return("DicCloseLoopCategory"); case DictionaryName.QiCloseLoopDepartment: return("DicCloseLoopDepartment"); case DictionaryName.RcMailGroup: return("DicRcMailGroup"); case DictionaryName.EwgInitIssueStatus: return("DicEwgInitIssueStatus"); case DictionaryName.EwgMeetingTeam: return("DicEwgMeetingTeam"); case DictionaryName.EwgFolder: return("DicEwgFolder"); case DictionaryName.EwgInitIssuePhase: return("DicEwgInitIssuePhase"); case DictionaryName.LeDept: return("DicLeDept"); case DictionaryName.LeProblemSource: return("DicLeProblemSource"); case DictionaryName.LeProblemFactory: return("DicLeProblemFactory"); case DictionaryName.LePart: return("DicLePart"); } return(null); }
internal TabularDicBl(DictionaryName dicName) { this.dicName = dicName; }
internal TabularDicBl(DictionaryName dicName) { this.dicName = dicName; }
// 私有构造函数 internal protected TabularDicMgr(DictionaryName dicName) { this.dicName = dicName; business = new TabularDicBl(this.dicName); }
/// <summary> /// Called if the next-button is clicked. /// </summary> /// <returns> /// <i>false</i> to abort, otherwise<i>true</i> /// </returns> /// <remarks>Documented by Dev05, 2007-11-21</remarks> /// <remarks>Documented by Dev02, 2008-01-15</remarks> public override bool GoNext() { if (String.IsNullOrEmpty(DictionaryName) || String.IsNullOrEmpty(DictionaryLocation) || (DictionaryName.Trim().Length == 0)) { MessageBox.Show(Resources.NEWDIC_INVALIDINPUT_TEXT, Resources.NEWDIC_INVALIDINPUT_CAPTION, MessageBoxButtons.OK, MessageBoxIcon.Warning); return(false); } return(base.GoNext()); }
/// <summary> /// Initializes a new instance of the OnlineDictionary class with specified Dictionary. /// </summary> /// <param name="language">Language name.</param> /// <param name="dicName">Dictionary name.</param> public OnlineDictionary(Language language, DictionaryName dicName) { _language = language; Initialize(_language, dicName); }