/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnAdd.Enabled = true; btnAdd.Visible = true; btnDelete.Enabled = true; btnDelete.Visible = true; btnUpdate.Enabled = true; btnUpdate.Visible = true; btnSMSApplication.Enabled = true; btnSMSApplication.Visible = true; } else { btnAdd.Visible = ControlAttributes.BoolControl("btnAdd", "VoiceSetForm", "Visible"); btnAdd.Enabled = ControlAttributes.BoolControl("btnAdd", "VoiceSetForm", "Enabled"); btnDelete.Visible = ControlAttributes.BoolControl("btnDelete", "VoiceSetForm", "Visible"); btnDelete.Enabled = ControlAttributes.BoolControl("btnDelete", "VoiceSetForm", "Enabled"); btnUpdate.Visible = ControlAttributes.BoolControl("btnUpdate", "VoiceSetForm", "Visible"); btnUpdate.Enabled = ControlAttributes.BoolControl("btnUpdate", "VoiceSetForm", "Enabled"); btnSMSApplication.Visible = ControlAttributes.BoolControl("btnSMSApplication", "VoiceSetForm", "Visible"); btnSMSApplication.Enabled = ControlAttributes.BoolControl("btnSMSApplication", "VoiceSetForm", "Enabled"); } }
private ControlAttributeU16(ControlAttributes attr, byte len, BinaryReader reader) : base(attr, 2) { if (len != 2) throw new ArgumentException ("Incorrect length for U16 attribute"); data=(ushort)IPAddress.NetworkToHostOrder(reader.ReadInt16()); }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnSave.Enabled = true; btnSave.Visible = true; btnDel.Enabled = true; btnDel.Visible = true; btnUpdate.Enabled = true; btnUpdate.Visible = true; btnFVN.Enabled = true; btnFVN.Visible = true; btnCamera.Enabled = true; btnCamera.Visible = true; } else { btnSave.Visible = ControlAttributes.BoolControl("btnSave", "DrivewayFrom", "Visible"); btnSave.Enabled = ControlAttributes.BoolControl("btnSave", "DrivewayFrom", "Enabled"); btnDel.Visible = ControlAttributes.BoolControl("btnDel", "DrivewayFrom", "Visible"); btnDel.Enabled = ControlAttributes.BoolControl("btnDel", "DrivewayFrom", "Enabled"); btnUpdate.Visible = ControlAttributes.BoolControl("btnUpdate", "DrivewayFrom", "Visible"); btnUpdate.Enabled = ControlAttributes.BoolControl("btnUpdate", "DrivewayFrom", "Enabled"); btnFVN.Visible = ControlAttributes.BoolControl("btnFVN", "DrivewayFrom", "Visible"); btnFVN.Enabled = ControlAttributes.BoolControl("btnFVN", "DrivewayFrom", "Enabled"); btnCamera.Visible = ControlAttributes.BoolControl("btnCamera", "DrivewayFrom", "Visible"); btnCamera.Enabled = ControlAttributes.BoolControl("btnCamera", "DrivewayFrom", "Enabled"); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnAdd.Enabled = true; btnAdd.Visible = true; btnDel.Enabled = true; btnDel.Visible = true; btnUpdate.Visible = true; btnUpdate.Enabled = true; toolStripLabel1.Enabled = true; toolStripLabel1.Visible = true; } else { btnAdd.Visible = ControlAttributes.BoolControl("btnAdd", "UserRole", "Visible"); btnAdd.Enabled = ControlAttributes.BoolControl("btnAdd", "UserRole", "Enabled"); btnDel.Visible = ControlAttributes.BoolControl("btnDel", "UserRole", "Visible"); btnDel.Enabled = ControlAttributes.BoolControl("btnDel", "UserRole", "Enabled"); btnUpdate.Visible = ControlAttributes.BoolControl("btnUpdate", "UserRole", "Visible"); btnUpdate.Enabled = ControlAttributes.BoolControl("btnUpdate", "UserRole", "Enabled"); toolStripLabel1.Enabled = ControlAttributes.BoolControl("toolStripLabel1", "UserRole", "Visible"); toolStripLabel1.Visible = ControlAttributes.BoolControl("toolStripLabel1", "UserRole", "Enabled"); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnAdd.Enabled = true; btnAdd.Visible = true; btnModify.Enabled = true; btnModify.Visible = true; btnDel.Enabled = true; btnDel.Visible = true; toolStripLabel1.Enabled = true; toolStripLabel1.Visible = true; btnRestPW.Enabled = true; btnRestPW.Visible = true; } else { btnAdd.Visible = ControlAttributes.BoolControl("btnAdd", "UserManagement", "Visible"); btnAdd.Enabled = ControlAttributes.BoolControl("btnAdd", "UserManagement", "Enabled"); btnModify.Visible = ControlAttributes.BoolControl("btnModify", "UserManagement", "Visible"); btnModify.Enabled = ControlAttributes.BoolControl("btnModify", "UserManagement", "Enabled"); btnDel.Visible = ControlAttributes.BoolControl("btnDel", "UserManagement", "Visible"); btnDel.Enabled = ControlAttributes.BoolControl("btnDel", "UserManagement", "Enabled"); toolStripLabel1.Visible = ControlAttributes.BoolControl("toolStripLabel1", "UserManagement", "Visible"); toolStripLabel1.Enabled = ControlAttributes.BoolControl("toolStripLabel1", "UserManagement", "Enabled"); btnRestPW.Visible = ControlAttributes.BoolControl("btnRestPW", "UserManagement", "Visible"); btnRestPW.Enabled = ControlAttributes.BoolControl("btnRestPW", "UserManagement", "Enabled"); } }
private ControlAttributeI32(ControlAttributes attr, byte len, BinaryReader reader) : base(attr, 4) { if (len != 4) throw new ArgumentException ("Incorrect length for I32 attribute"); data = IPAddress.NetworkToHostOrder(reader.ReadInt32()); }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnCancellation.Enabled = true; btnCancellation.Visible = true; btnCall.Enabled = true; btnCall.Visible = true; btnSurIn.Enabled = true; btnSurIn.Visible = true; btnUnu.Enabled = true; btnUnu.Visible = true; } else { btnCancellation.Visible = ControlAttributes.BoolControl("btnCancellation", "QueueForm", "Visible"); btnCancellation.Enabled = ControlAttributes.BoolControl("btnCancellation", "QueueForm", "Enabled"); btnCall.Visible = ControlAttributes.BoolControl("btnCall", "QueueForm", "Visible"); btnCall.Enabled = ControlAttributes.BoolControl("btnCall", "QueueForm", "Enabled"); btnSurIn.Visible = ControlAttributes.BoolControl("btnSurIn", "QueueForm", "Visible"); btnSurIn.Enabled = ControlAttributes.BoolControl("btnSurIn", "QueueForm", "Enabled"); btnUnu.Visible = ControlAttributes.BoolControl("btnUnu", "QueueForm", "Visible"); btnUnu.Enabled = ControlAttributes.BoolControl("btnUnu", "QueueForm", "Enabled"); } }
protected override void Render(HtmlTextWriter output) { if (!string.IsNullOrEmpty(Value)) { var array = Value.Split(','); if (array.Length > 0) { int.TryParse(array[0], out _mapZoomFactor); } if (array.Length > 1) { _mapType = array[1]; } } ParseParameters(Source); if (!string.IsNullOrEmpty(AddressFieldName)) { base.Render(output); var db = Factory.GetDatabase("master") ?? Factory.GetDatabase("web"); var id = !string.IsNullOrEmpty(ItemID) ? ItemID : ControlAttributes.Substring(ControlAttributes.IndexOf("//master/", StringComparison.Ordinal) + 9, 38); var item = new ID(id).ToSitecoreItem(db); //render other control var centre = ""; //get lat lng var location = GetGeoData(item, ref centre); _mapImageCtrl = new Image { ID = ID + "_Img_MapView", CssClass = "imageMapView", Width = MAP_WIDTH, Height = MAP_HEIGHT, ImageUrl = GetGoogleMapImageUrl(location, centre, item) }; _mapImageCtrl.Style.Add("padding-top", "5px"); if (Debug) { output.Write( "<div style='background-color:silver;color:white'>{0}</div>", _mapImageCtrl.ImageUrl); } _mapImageCtrl.RenderControl(output); } }
/// <summary> /// Gets amount of element's attributes /// </summary> private void ClearAttributes() { var element = Element; if (element != null) { element.Attributes.Clear(); } ControlAttributes.Clear(); }
/// <summary> /// Gets attribues enumerator /// </summary> IEnumerator <KeyValuePair <string, string> > IAttributeAccessor.GetEnumerator() { var element = Element; if (element != null) { return(element.Attributes.GetEnumerator()); } else { return(ControlAttributes.GetEnumerator()); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnUpdate.Enabled = true; btnUpdate.Visible = true; btn_Save.Enabled = true; btn_Save.Visible = true; btn_Delete.Enabled = true; btn_Delete.Visible = true; btn_CurrentAdministration.Enabled = true; btn_CurrentAdministration.Visible = true; btn_Administration.Enabled = true; btn_Administration.Visible = true; btn_CarAttribute.Enabled = true; btn_CarAttribute.Visible = true; btn_BusinessType.Enabled = true; btn_BusinessType.Visible = true; } else { btnUpdate.Enabled = ControlAttributes.BoolControl("btnUpdate", "CarTypeForm", "Enabled"); btnUpdate.Visible = ControlAttributes.BoolControl("btnUpdate", "CarTypeForm", "Visible"); btn_Save.Enabled = ControlAttributes.BoolControl("btn_Save", "CarTypeForm", "Enabled"); btn_Save.Visible = ControlAttributes.BoolControl("btn_Save", "CarTypeForm", "Visible"); btn_Delete.Enabled = ControlAttributes.BoolControl("btn_Delete", "CarTypeForm", "Enabled"); btn_Delete.Visible = ControlAttributes.BoolControl("btn_Delete", "CarTypeForm", "Visible"); btn_CurrentAdministration.Enabled = ControlAttributes.BoolControl("btn_CurrentAdministration", "CarTypeForm", "Enabled"); btn_CurrentAdministration.Visible = ControlAttributes.BoolControl("btn_CurrentAdministration", "CarTypeForm", "Visible"); btn_Administration.Enabled = ControlAttributes.BoolControl("btn_Administration", "CarTypeForm", "Enabled"); btn_Administration.Visible = ControlAttributes.BoolControl("btn_Administration", "CarTypeForm", "Visible"); btn_CarAttribute.Enabled = ControlAttributes.BoolControl("btn_CarAttribute", "CarTypeForm", "Enabled"); btn_CarAttribute.Visible = ControlAttributes.BoolControl("btn_CarAttribute", "CarTypeForm", "Visible"); btn_BusinessType.Enabled = ControlAttributes.BoolControl("btn_BusinessType", "CarTypeForm", "Enabled"); btn_BusinessType.Visible = ControlAttributes.BoolControl("btn_BusinessType", "CarTypeForm", "Visible"); } }
/// <summary> /// Gets element attribute /// </summary> private string GetAttribute(string name) { var val = String.Empty; var element = Element; if (element != null) { val = element.Attributes[name]; } else if (!ControlAttributes.TryGetValue(name, out val)) { val = String.Empty; } return(val ?? String.Empty); }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { tsbtnDel.Enabled = true; tsbtnDel.Visible = true; tslbExecl.Enabled = true; tslbExecl.Visible = true; } else { tsbtnDel.Visible = ControlAttributes.BoolControl("tsbtnDel", "CarPicInfoForm", "Visible"); tsbtnDel.Enabled = ControlAttributes.BoolControl("tsbtnDel", "CarPicInfoForm", "Enabled"); tslbExecl.Visible = ControlAttributes.BoolControl("tslbExecl", "CarPicInfoForm", "Visible"); tslbExecl.Enabled = ControlAttributes.BoolControl("tslbExecl", "CarPicInfoForm", "Enabled"); } }
public void AddTriggeredVNC(Client.Model.VncModel vncModel) { pendingVncList.Add(vncModel); ThreadPool.QueueUserWorkItem(s => { Thread.Sleep(1500); // not a safe way if user trigger 2 similar application within 1.5 second if (pendingVncList.Remove(vncModel)) { ControlAttributes attr = mimicWndHolder.GetTopMostControl(); Trace.WriteLine(String.Format("Add triggered vnc in queue: {0}", attr.WindowName)); triggeredVncList.Add(mimicWndHolder.GetTopMostControl(), vncModel); } }); }
//控件权限 public void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnshenqing.Visible = true; btnshenqing.Enabled = true; btn_cz.Visible = true; btn_cz.Enabled = true; } else { btnshenqing.Enabled = ControlAttributes.BoolControl("btnshenqing", "ResetApplication", "Enabled"); btnshenqing.Visible = ControlAttributes.BoolControl("btnshenqing", "ResetApplication", "Visible"); btn_cz.Enabled = ControlAttributes.BoolControl("btn_cz", "ResetApplication", "Enabled"); btn_cz.Visible = ControlAttributes.BoolControl("btn_cz", "ResetApplication", "Visible"); } }
public static ControlAttribute FromBinary(BinaryReader reader) { ControlAttributes attribute = (ControlAttributes) reader.ReadByte (); byte length = reader.ReadByte (); switch (attribute) { case ControlAttributes.UNIQUE_NAME: case ControlAttributes.CALL: return ControlAttributeString.FromBinary (attribute, length, reader); case ControlAttributes.CRATION_DELAY_MS: return ControlAttributeU16.FromBinary (attribute, length, reader); case ControlAttributes.RETURN_VALUE: return ControlAttributeI32.FromBinary (attribute, length, reader); default: return ControlAttributeUnknown.FromBinary (attribute, length, reader); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnExport.Enabled = true; btnExport.Visible = true; btnImport.Enabled = true; btnImport.Visible = true; } else { btnExport.Visible = ControlAttributes.BoolControl("btnExport", "SystemConfig", "Visible"); btnExport.Enabled = ControlAttributes.BoolControl("btnExport", "SystemConfig", "Enabled"); btnImport.Visible = ControlAttributes.BoolControl("btnImport", "SystemConfig", "Visible"); btnImport.Enabled = ControlAttributes.BoolControl("btnImport", "SystemConfig", "Enabled"); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnSave.Enabled = true; btnSave.Visible = true; btnOutPass.Enabled = true; btnOutPass.Visible = true; } else { btnSave.Visible = ControlAttributes.BoolControl("btnSave", "WeighHouseSmalldiscern", "Visible"); btnSave.Enabled = ControlAttributes.BoolControl("btnSave", "WeighHouseSmalldiscern", "Enabled"); btnOutPass.Visible = ControlAttributes.BoolControl("btnOutPass", "WeighHouseSmalldiscern", "Visible"); btnOutPass.Enabled = ControlAttributes.BoolControl("btnOutPass", "WeighHouseSmalldiscern", "Enabled"); } }
//控件权限 public void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { tsbExecl.Visible = true; tsbExecl.Enabled = true; tsbshenpi.Visible = true; tsbshenpi.Enabled = true; } else { tsbExecl.Enabled = ControlAttributes.BoolControl("tsbExecl", "QueueResult", "Enabled"); tsbExecl.Visible = ControlAttributes.BoolControl("tsbExecl", "QueueResult", "Visible"); tsbshenpi.Enabled = ControlAttributes.BoolControl("tsbshenpi", "QueueResult", "Enabled"); tsbshenpi.Visible = ControlAttributes.BoolControl("tsbshenpi", "QueueResult", "Visible"); } }
public void UpdateListContents() { // get all position form mimic holder Dictionary <ControlAttributes, Client.Model.ApplicationModel> tempAppDic = new Dictionary <ControlAttributes, ApplicationModel>(); for (int count = 0; count < triggeredAppList.Count; count++) { KeyValuePair <ControlAttributes, Client.Model.ApplicationModel> content = triggeredAppList.ElementAt(count); ControlAttributes latestAttr = mimicWndHolder.GetControl(content.Key.Id); tempAppDic.Add(latestAttr, content.Value); Trace.WriteLine(String.Format("Application: {0}, pos: {1},{2}, width:{3}, height:{4}", latestAttr.WindowName, latestAttr.Xpos, latestAttr.Ypos, latestAttr.Width, latestAttr.Height)); } triggeredAppList = tempAppDic; Dictionary <ControlAttributes, Client.Model.VncModel> tempVncList = new Dictionary <ControlAttributes, VncModel>(); for (int count = 0; count < triggeredVncList.Count; count++) { KeyValuePair <ControlAttributes, Client.Model.VncModel> content = triggeredVncList.ElementAt(count); ControlAttributes latestAttr = mimicWndHolder.GetControl(content.Key.Id); tempVncList.Add(latestAttr, content.Value); Trace.WriteLine(String.Format("VNC: {0}, pos: {1},{2}, width:{3}, height:{4}", latestAttr.WindowName, latestAttr.Xpos, latestAttr.Ypos, latestAttr.Width, latestAttr.Height)); } triggeredVncList = tempVncList; Dictionary <ControlAttributes, InputAttributes> tempInputList = new Dictionary <ControlAttributes, InputAttributes>(); for (int count = 0; count < triggeredInputList.Count; count++) { KeyValuePair <ControlAttributes, InputAttributes> content = triggeredInputList.ElementAt(count); ControlAttributes latestAttr = mimicWndHolder.GetControl(content.Key.Id); tempInputList.Add(latestAttr, content.Value); Trace.WriteLine(String.Format("Input source: {0}, pos: {1},{2}, width:{3}, height:{4}", latestAttr.WindowName, latestAttr.Xpos, latestAttr.Ypos, latestAttr.Width, latestAttr.Height)); } triggeredInputList = tempInputList; }
public void AddTriggeredApplication(Client.Model.ApplicationModel appModel) { pendingAppList.Add(appModel); ThreadPool.QueueUserWorkItem(s => { Thread.Sleep(1500); // not a safe way if user trigger 2 similar application within 1.5 second if (pendingAppList.Remove(appModel)) { ControlAttributes attr = mimicWndHolder.GetTopMostControl(); Trace.WriteLine(String.Format("Add triggered app in queue: {0}, pos: {1},{2},{3},{4}", attr.WindowName, attr.Xpos, attr.Ypos, attr.Width, attr.Height)); triggeredAppList.Add(attr, appModel); } }); }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnsz.Enabled = true; btnsz.Visible = true; button2.Enabled = true; button2.Visible = true; btnDY.Enabled = true; btnDY.Visible = true; } else { btnsz.Visible = ControlAttributes.BoolControl("btnsz", "StaffInfoForm", "Visible"); btnsz.Enabled = ControlAttributes.BoolControl("btnsz", "StaffInfoForm", "Enabled"); button2.Visible = ControlAttributes.BoolControl("button2", "StaffInfoForm", "Visible"); button2.Enabled = ControlAttributes.BoolControl("button2", "StaffInfoForm", "Enabled"); btnDY.Visible = ControlAttributes.BoolControl("btnDY", "StaffInfoForm", "Visible"); btnDY.Enabled = ControlAttributes.BoolControl("btnDY", "StaffInfoForm", "Enabled"); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnSave.Enabled = true; btnSave.Visible = true; btnDel.Enabled = true; btnDel.Visible = true; btnUpdate.Enabled = true; btnUpdate.Visible = true; } else { btnSave.Visible = ControlAttributes.BoolControl("btnSave", "DictionaryForm", "Visible"); btnSave.Enabled = ControlAttributes.BoolControl("btnSave", "DictionaryForm", "Enabled"); btnDel.Visible = ControlAttributes.BoolControl("btnDel", "DictionaryForm", "Visible"); btnDel.Enabled = ControlAttributes.BoolControl("btnDel", "DictionaryForm", "Enabled"); btnUpdate.Visible = ControlAttributes.BoolControl("btnUpdate", "DictionaryForm", "Visible"); btnUpdate.Enabled = ControlAttributes.BoolControl("btnUpdate", "DictionaryForm", "Enabled"); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { tsbtnDel.Enabled = true; tsbtnDel.Visible = true; btnUpdate.Enabled = true; btnUpdate.Visible = true; tslbExecl.Enabled = true; tslbExecl.Visible = true; } else { tsbtnDel.Visible = ControlAttributes.BoolControl("tsbtnDel", "UnLoadCarManage", "Visible"); tsbtnDel.Enabled = ControlAttributes.BoolControl("tsbtnDel", "UnLoadCarManage", "Enabled"); btnUpdate.Visible = ControlAttributes.BoolControl("btnUpdate", "UnLoadCarManage", "Visible"); btnUpdate.Enabled = ControlAttributes.BoolControl("btnUpdate", "UnLoadCarManage", "Enabled"); tslbExecl.Visible = ControlAttributes.BoolControl("tslbExecl", "UnLoadCarManage", "Visible"); tslbExecl.Enabled = ControlAttributes.BoolControl("tslbExecl", "UnLoadCarManage", "Enabled"); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnupdate.Enabled = true; btnAdd.Enabled = true; btnDelete.Enabled = true; btnupdate.Visible = true; btnAdd.Visible = true; btnDelete.Visible = true; } else { btnupdate.Visible = ControlAttributes.BoolControl("btnupdate", "WeighInfoFrom", "Visible"); btnupdate.Enabled = ControlAttributes.BoolControl("btnupdate", "WeighInfoFrom", "Enabled"); btnAdd.Visible = ControlAttributes.BoolControl("btnAdd", "WeighInfoFrom", "Visible"); btnAdd.Enabled = ControlAttributes.BoolControl("btnAdd", "WeighInfoFrom", "Enabled"); btnDelete.Visible = ControlAttributes.BoolControl("btnDelete", "WeighInfoFrom", "Visible"); btnDelete.Enabled = ControlAttributes.BoolControl("btnDelete", "WeighInfoFrom", "Enabled"); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btn_Add.Enabled = true; btn_Add.Visible = true; btn_Delete.Enabled = true; btn_Delete.Visible = true; btn_Update.Enabled = true; btn_Update.Visible = true; } else { btn_Add.Visible = ControlAttributes.BoolControl("btn_Add", "MenuInfoManager", "Visible"); btn_Add.Enabled = ControlAttributes.BoolControl("btn_Add", "MenuInfoManager", "Enabled"); btn_Delete.Visible = ControlAttributes.BoolControl("btn_Delete", "MenuInfoManager", "Visible"); btn_Delete.Enabled = ControlAttributes.BoolControl("btn_Delete", "MenuInfoManager", "Enabled"); btn_Update.Visible = ControlAttributes.BoolControl("btn_Update", "MenuInfoManager", "Visible"); btn_Update.Enabled = ControlAttributes.BoolControl("btn_Update", "MenuInfoManager", "Enabled"); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btnSet.Enabled = true; btnSet.Visible = true; button1.Enabled = true; button1.Visible = true; button4.Enabled = true; button4.Visible = true; } else { btnSet.Visible = ControlAttributes.BoolControl("btnSet", "BlacklistSet", "Visible"); btnSet.Enabled = ControlAttributes.BoolControl("btnSet", "BlacklistSet", "Enabled"); button1.Visible = ControlAttributes.BoolControl("button1", "BlacklistSet", "Visible"); button1.Enabled = ControlAttributes.BoolControl("button1", "BlacklistSet", "Enabled"); button4.Visible = ControlAttributes.BoolControl("button4", "BlacklistSet", "Visible"); button4.Enabled = ControlAttributes.BoolControl("button4", "BlacklistSet", "Enabled"); } }
/// <summary> /// 用户权限,添加删除,修改 /// </summary> private void userContext() { if (CommonalityEntity.USERNAME.ToLower() == "emewe") { btn_Delete.Enabled = true; btn_Delete.Visible = true; btn_Administration.Enabled = true; btn_Administration.Visible = true; btnUpdate.Enabled = true; btnUpdate.Visible = true; btnUpdate.Enabled = true; } else { btn_Delete.Enabled = ControlAttributes.BoolControl("btn_Delete", "UpdateDrivewayStrategyForm", "Enabled"); btn_Delete.Visible = ControlAttributes.BoolControl("btn_Delete", "UpdateDrivewayStrategyForm", "Visible"); btn_Administration.Enabled = ControlAttributes.BoolControl("btn_Administration", "UpdateDrivewayStrategyForm", "Enabled"); btn_Administration.Visible = ControlAttributes.BoolControl("btn_Administration", "UpdateDrivewayStrategyForm", "Visible"); btnUpdate.Enabled = ControlAttributes.BoolControl("btnUpdate", "UpdateDrivewayStrategyForm", "Enabled"); btnUpdate.Visible = ControlAttributes.BoolControl("btnUpdate", "UpdateDrivewayStrategyForm", "Visible"); } }
public static ControlAttributeUnknown FromBinary(ControlAttributes attr, byte len, BinaryReader reader) { return new ControlAttributeUnknown (attr, len, reader); }
protected void CreateControls() { Controls.Clear(); Item item = null; var published = new List <Item>(); Item[] targets = null; try { var db = Factory.GetDatabase(Constants.Databases.MASTERDB) ?? Factory.GetDatabase(Constants.Databases.WEBDB); var id = !string.IsNullOrEmpty(ItemId) ? ItemId : ControlAttributes.Substring(ControlAttributes.IndexOf("//master/", StringComparison.Ordinal) + 9, 38); item = new ID(id).ToSitecoreItem(db); var targetsRoot = item.Database.GetItem( Constants.Sitecore.PUBLISHING_TARGETS); targets = targetsRoot.GetChildren().ToArray(); foreach (var target in targets) { try { var webItem = item.ID.ToSitecoreItem(Factory.GetDatabase(target[TARGETDATABASE])); if (webItem != null && webItem.Versions.Count != 0) { HelperControls.CreateLitertal("Published Version on " + target[TARGETDATABASE], Controls); HelperControls.CreateSitecoreControl <Integer>("version" + target[TARGETDATABASE], true, true, true, webItem.Version.ToString(), Controls, GetID("version" + target.Name), false, false); published.Add(webItem); } else if (webItem != null && webItem.Versions.Count == 0) { HelperControls.CreateLitertal("Published, but no Versions on " + target[TARGETDATABASE], Controls); } else { HelperControls.CreateLitertal("Not published on " + target[TARGETDATABASE], Controls); } } catch (Exception) { HelperControls.CreateLitertal("Target DB " + target[TARGETDATABASE] + " not found.", Controls); } finally { HelperControls.CreateLitertal("<br />", Controls); } } } catch (Exception ex) { Log.Error(ex.Message, ex, this); } finally { if (item != null) { HelperControls.CreateLitertal("<br />", Controls); HelperControls.CreateLitertal("Number of Versions on master", Controls); HelperControls.CreateSitecoreControl <Integer>("version_master", true, true, true, item.Versions.Count.ToString(), Controls, GetID("version_master"), false, false); HelperControls.CreateLitertal("<br />", Controls); } try { HelperControls.CreateLitertal("<br />", Controls); HelperControls.CreateLitertal( "<table width='100%'><tr><td colspan=7 style='background-color:silver;color:white'><center>Version Details</center></td><td > </td><td style='background-color:silver;color:white'></td></tr><tr><td style='background-color:silver;color:white'><center>Version</center></td><td style='background-color:silver;color:white'><center>Created By</center></td><td style='background-color:silver;color:white'><center>Created Date</center></td><td style='background-color:silver;color:white'><center>Modified By</center></td><td style='background-color:silver;color:white'><center>Modified Date</center></td><td style='background-color:silver;color:white'><center>Languages</center></td><td style='background-color:silver;color:white'><center>Work-Flow State</center></td><td><center> </center></td><td style='background-color:silver;color:white'><center>Published</center></td></tr><tbody>", Controls); if (item != null) { var versions = (from p in item.Versions.GetVersions(true).ToArray() orderby p.Version.Number select p).ToList(); foreach (var version in versions) { DateTime outValCreate; DateTime outValModify; string workFlowName; GetOutValCreate(version, out outValCreate, out outValModify, out workFlowName); var isPublished = false; var pub = (published.Where( p => p.Version.Number == version.Version.Number && p.Languages.Where( l => p.Database.GetItem(p.ID, l) != null && p.Database.GetItem(p.ID, l).Versions.Count > 0) .Select(l => l.Name) .Contains(version.Language.Name))). FirstOrDefault(); if (pub != null) { isPublished = true; } HelperControls.CreateLitertal( "<tr><td style='" + (isPublished ? "background-color:lightgreen;color:black;" : string.Empty) + "'><center>" + version.Version.Number + "</center></td><td" + (isPublished ? " style='background-color:lightgreen;color:black;'" : string.Empty) + "><center>" + version.Fields[FieldIDs.CreatedBy].Value + "</center></td><td" + (isPublished ? " style='background-color:lightgreen;color:black;'" : string.Empty) + "><center>" + (outValCreate == DateTime.MinValue ? string.Empty : outValCreate.ToString("dd MMM yyyy HH:mm")) + "</center></td><td" + (isPublished ? " style='background-color:lightgreen;color:black;'" : string.Empty) + "><center>" + version.Fields[FieldIDs.UpdatedBy].Value + "</center></td><td" + (isPublished ? " style='background-color:lightgreen;color:black;'" : string.Empty) + "><center>" + (outValModify == DateTime.MinValue ? string.Empty : outValModify.ToString("dd MMM yyyy HH:mm")) + "</td><td" + (isPublished ? " style='background-color:lightgreen;color:black;'" : string.Empty) + "><center>" + version.Language.Name + "</center>" + "</td><td" + (isPublished ? " style='background-color:lightgreen;color:black;'" : string.Empty) + "><center>" + workFlowName + "</center></td>" + "</td><td><center></center></td>" + "</td><td><center>" + (isPublished ? "◄" : string.Empty) + "</center></td>" + "</tr>", Controls); } } HelperControls.CreateLitertal("</tbody></table>", Controls); if (targets != null) { foreach (var target in targets) { try { var errMessage = string.Empty; Item webItem; try { webItem = item.ID.ToSitecoreItem(Factory.GetDatabase(target[TARGETDATABASE])); } catch (Exception ex) { errMessage = ex.Message; webItem = null; } if (webItem != null) { DateTime outValCreate; DateTime outValModify; string workFlowName; GetOutValCreate(webItem, out outValCreate, out outValModify, out workFlowName); HelperControls.CreateLitertal("<br />", Controls); HelperControls.CreateLitertal( "<table width='100%'><tr><td colspan=7 style='background-color:silver;color:white'><center>Item Details on " + target[TARGETDATABASE] + "</center></td></tr><tr><td style='background-color:silver;color:white'><center>Version</center></td><td style='background-color:silver;color:white'><center>Created By</center></td><td style='background-color:silver;color:white'><center>Created Date</center></td><td style='background-color:silver;color:white'><center>Modified By</center></td><td style='background-color:silver;color:white'><center>Modified Date</center></td><td style='background-color:silver;color:white'><center>Languages</center></td><td style='background-color:silver;color:white'><center>Work-Flow State</center></td></tr><tbody>", Controls); HelperControls.CreateLitertal( "<tr><td><center>" + webItem.Version.Number + "</center></td><td><center>" + webItem.Fields[FieldIDs.CreatedBy].Value + "</center></td><td><center>" + (outValCreate == DateTime.MinValue ? string.Empty : outValCreate.ToString("dd MMM yyyy HH:mm")) + "</center></td><td><center>" + webItem.Fields[FieldIDs.UpdatedBy].Value + "</td><td><center>" + (outValModify == DateTime.MinValue ? string.Empty : outValModify.ToString("dd MMM yyyy HH:mm")) + "</center>" + "</td><td><center>" + string.Join(",", webItem.Languages.Where(p => webItem.Database.GetItem(webItem.ID, p) != null && webItem.Database.GetItem(webItem.ID, p).Versions.Count > 0).Select(p => p.Name).ToArray()) + "</center></td><td><center>" + workFlowName + "</center></td></tr>", Controls); } else { HelperControls.CreateLitertal("<br />", Controls); HelperControls.CreateLitertal( "<table width='100%'><tr><td style='background-color:silver;color:white'><center>Item Details on " + target[TARGETDATABASE] + "</center></td></tr><tbody>", Controls); HelperControls.CreateLitertal( "<tr><td style='text-align:center;' >No Item Found" + (!string.IsNullOrEmpty(errMessage) ? " ( <span style='color:red;'>" + errMessage + "</span>)" : string.Empty) + "</td></tr>", Controls); } } catch (Exception ex) { Log.Error(ex.Message, ex, this); } finally { HelperControls.CreateLitertal("</tbody></table>", Controls); } } } } catch (Exception ex) { Log.Error(ex.Message, ex, this); } } }