public GitTfsRemote(RemoteOptions remoteOptions, Globals globals, ITfsHelper tfsHelper, TextWriter stdout) { this.remoteOptions = remoteOptions; this.globals = globals; this.stdout = stdout; Tfs = tfsHelper; }
public InitBranch(TextWriter stdout, Globals globals, Help helper, AuthorsFile authors) { _stdout = stdout; _globals = globals; _helper = helper; _authors = authors; }
public static Color GetConvictionColor(Globals.Conviction conviction) { Color color = Color.white; switch(conviction){ case Globals.Conviction.anger: color = GetMoodColor(Globals.Mood.lustful); break; case Globals.Conviction.envy: color = GetMoodColor(Globals.Mood.obsessed); break; case Globals.Conviction.gluttony: color = GetMoodColor(Globals.Mood.bitter); break; case Globals.Conviction.greed: color = GetMoodColor(Globals.Mood.idealistic); break; case Globals.Conviction.lust: color = Color.blue; break; case Globals.Conviction.pride: color = GetMoodColor(Globals.Mood.conservative); break; case Globals.Conviction.sloth: color = GetMoodColor(Globals.Mood.lovestruck); // Debug.Log(color); break; } // Debug.Log("getting color " + color + " for conviction " + conviction.ToString()); return color; }
public ListRemoteBranches(Globals globals, TextWriter stdout, ITfsHelper tfsHelper, RemoteOptions remoteOptions) { this.globals = globals; this.stdout = stdout; this.tfsHelper = tfsHelper; this.remoteOptions = remoteOptions; }
public Bootstrap(RemoteOptions remoteOptions, Globals globals, TextWriter stdout, Bootstrapper bootstrapper) { _remoteOptions = remoteOptions; _globals = globals; _stdout = stdout; _bootstrapper = bootstrapper; }
public Clone(Globals globals, Fetch fetch, Init init, InitBranch initBranch) { this.fetch = fetch; this.init = init; this.globals = globals; this.initBranch = initBranch; }
public Shelve(CheckinOptions checkinOptions, TfsWriter writer, Globals globals) { _globals = globals; _checkinOptions = checkinOptions; _checkinOptionsFactory = new CheckinOptionsFactory(_globals); _writer = writer; }
public void load(Globals globals, string solutionName) { lock (this) { issues.Clear(); solutionName = ParameterSerializer.getKeyFromSolutionName(solutionName); int count = ParameterSerializer.loadParameter(globals, RECENTLY_VIEWED_COUNT + solutionName, -1); if (count != -1) { try { if (count > MAX_ITEMS) count = MAX_ITEMS; for (int i = 1; i <= count; ++i) { string guidStr = ParameterSerializer.loadParameter(globals, RECENTLY_VIEWED_ISSUE_SERVER_GUID + solutionName + "_" + i, null); Guid guid = new Guid(guidStr); string key = ParameterSerializer.loadParameter(globals, RECENTLY_VIEWED_ISSUE_KEY + solutionName + "_" + i, null); RecentlyViewedIssue issue = new RecentlyViewedIssue(guid, key); issues.Add(issue); } } catch (Exception e) { Debug.WriteLine(e); } } changedSinceLoading = false; } }
public Rcheckin(TextWriter stdout, CheckinOptions checkinOptions, TfsWriter writer, Globals globals) { _stdout = stdout; _checkinOptions = checkinOptions; _checkinOptionsFactory = new CommitSpecificCheckinOptionsFactory(_stdout, globals); _writer = writer; }
void Start() { Globals[] globals = GameObject.FindObjectsOfType<Globals> (); for (int c = 1; c < globals.Length; c++) { Destroy(globals[c].gameObject); } global = globals [0]; }
protected void Parse(StringReader rdr, DepthScanner scanner, Globals globals) { int currentLine = 0; ParseNamespace(rdr, globals, scanner, ref currentLine, false); // Resolve incomplete names foreach (string key in globals.GetPropertyNames()) { TypeInfo t = globals.GetProperty(key, true) as TypeInfo; if (t != null) { if (!t.IsComplete) globals.AddProperty(key, globals.GetTypeInfo(t.Name), -1, ""); if (t is TemplateInst) { TemplateInst ti = t as TemplateInst; if (!ti.WrappedType.IsComplete) ti.WrappedType = globals.GetTypeInfo(ti.WrappedType.Name); } } } foreach (FunctionInfo f in globals.GetFunctions(null, true)) { f.ResolveIncompletion(globals); } foreach (TypeInfo type in globals.TypeInfo) { type.ResolveIncompletion(globals); } }
public GameServer(int port, Globals.LoggerDelegate logger) { m_IP = "0.0.0.0"; m_port = port; m_logger = logger; m_Player = new Player[NPLAYER]; m_Player[0] = new Player(); m_Player[1] = new Player(); reacive_t = new Thread[NPLAYER]; connection_t = new Thread((limitConnection)); connection_t.Start(); //reacive_t[0] = new Thread( try { listener = new TcpListener(IPAddress.Parse(m_IP), m_port); //listner } catch (ArgumentNullException) { m_logger("caught ArgumentNullException"); } catch (ArgumentOutOfRangeException) { m_logger("caught ArgumentOutOfRangeException"); } }
void Awake() { globals = Globals.GetInstance(); XPBarSlider = XPBarSliderGO.GetComponent<UISlider>(); maxWidth = XPBarSlider.foreground.localScale.x; if(XPBarSlider == null) { Debug.LogError("Couldn't get the UISlider component in XPBar Script."); } XPMaximum = globals.XPMaximum; if(XPMaximum == 0) { globals.XPPoints = 0; PlayerPrefs.SetInt("XP", 0); XPMaximum = 100; globals.XPMaximum = 100; PlayerPrefs.SetInt("XPMaximum", 100); Debug.Log("This is the first time XP bar is used."); } //XPBar.pixelInset.width = globals.XPPoints / (globals.XPMaximum / 100); XPPoints = globals.XPPoints; UpdateDisplay((XPPoints / XPMaximum)); player = GameObject.FindWithTag("Player"); }
public static string GetGlobalVariable(Globals globals, string varName, string defaultValue) { string result; if (globals == null) { result = defaultValue; } else { object[] array = (object[])globals.VariableNames; if (globals.get_VariableExists(varName)) { object[] array2 = array; for (int i = 0; i < array2.Length; i++) { object obj = array2[i]; if (obj.ToString() == varName) { result = (string)globals[varName]; return result; } } } result = defaultValue; } return result; }
/// <summary> /// Creates a TerrainType of the type specified in t. /// </summary> /// <param name="t">A type of Globals.TerrainTypes.</param> public TerrainType(Globals.TerrainTypes t) { this.type = t; switch (t) { case (Globals.TerrainTypes.Membrane): { this.dmgMod = 0; this.spdMod = 10; this.rscMod = 0; break; } case (Globals.TerrainTypes.Mucus): { this.dmgMod = 0; this.spdMod = 8; this.rscMod = 4; break; } case (Globals.TerrainTypes.Slow): { this.dmgMod = 0; this.spdMod = 5; this.rscMod = 0; break; } case (Globals.TerrainTypes.Infected): { this.dmgMod = 5; this.spdMod = 10; this.rscMod = 0; break; } } }
public Subtree(Fetch fetch, QuickFetch quickFetch, Globals globals, RemoteOptions remoteOptions) { _fetch = fetch; _quickFetch = quickFetch; _globals = globals; _remoteOptions = remoteOptions; }
public bool ProcessCombo(int id, Globals.HazardColors color, CenterLeafScript cls) { //Debug.Log("id: " + id); bool result = false; if(cls != null){ if (id == comboCount + 1 ) { comboCount = id; result = true; cls.MakeSpecialEffect(); } else {comboCount = -1;} if( comboCount == bugs.Length ){ CreateReward(color); comboCount = -1; if(color == Globals.HazardColors.WHITE){ CreateReward(color); CreateReward(color); } } } if(result){Globals.stateManager.audioSource.PlayOneShot(comboSound); return true;} else{Globals.stateManager.audioSource.PlayOneShot(notComboSound); return false;} }
public Fetch(Globals globals, RemoteOptions remoteOptions, AuthorsFile authors, Labels labels) { this.remoteOptions = remoteOptions; this.globals = globals; this.authors = authors; this.labels = labels; }
public static CheckinOptions Clone(this CheckinOptions source, Globals globals) { CheckinOptions clone = new CheckinOptions(); clone.CheckinComment = source.CheckinComment; clone.NoGenerateCheckinComment = source.NoGenerateCheckinComment; clone.NoMerge = source.NoMerge; clone.OverrideReason = source.OverrideReason; clone.Force = source.Force; clone.OverrideGatedCheckIn = source.OverrideGatedCheckIn; clone.WorkItemsToAssociate.AddRange(source.WorkItemsToAssociate); clone.WorkItemsToResolve.AddRange(source.WorkItemsToResolve); clone.AuthorTfsUserId = source.AuthorTfsUserId; try { string re = globals.Repository.GetConfig(GitTfsConstants.WorkItemAssociateRegexConfigKey); if (String.IsNullOrEmpty(re)) clone.WorkItemAssociateRegex = GitTfsConstants.TfsWorkItemAssociateRegex; else clone.WorkItemAssociateRegex = new Regex(re); } catch (Exception) { clone.WorkItemAssociateRegex = null; } foreach (var note in source.CheckinNotes) { clone.CheckinNotes[note.Key] = note.Value; } return clone; }
public Verify(Globals globals, TreeVerifier verifier, TextWriter stdout, Help helper) { _globals = globals; _verifier = verifier; _stdout = stdout; _helper = helper; }
public bool ProcessCombo(int id, int total, Globals.HazardColors color, CenterLeafScript cls) { //Debug.Log("id: " + id); bool result = false; if(cls != null){ if( (id == comboCount + 1 && totalComboCount == total) || id == 1) { comboCount = id; result = true; cls.MakeSpecialEffect(); flashyTextTimer = 0.3f; } else {comboCount = 0;} totalComboCount = total; if( comboCount == total ){ CreateReward(color); comboCount = 0; } } if(result){Globals.stateManager.audioSource.PlayOneShot(comboSound); return true;} else{Globals.stateManager.audioSource.PlayOneShot(notComboSound); return false;} }
/// <summary> /// /// </summary> public frmStep2b() { // This call is required by the Windows Form Designer. InitializeComponent(); globals = Globals.Instance(); }
public void load(Globals globals) { int count = ParameterSerializer.loadParameter(globals, SERVER_COUNT, -1); if (count != -1) { try { for (int i = 1; i <= count; ++i) { string guidStr = ParameterSerializer.loadParameter(globals, SERVER_GUID + i, null); Guid guid = new Guid(guidStr); string sName = ParameterSerializer.loadParameter(globals, SERVER_NAME + guidStr, null); string url = ParameterSerializer.loadParameter(globals, SERVER_URL + guidStr, null); JiraServer server = new JiraServer(guid, sName, url, null, null); server.UserName = CredentialsVault.Instance.getUserName(server); server.Password = CredentialsVault.Instance.getPassword(server); addServer(server); } changedSinceLoading = false; } catch (Exception e) { Debug.WriteLine(e); } } }
void CreateReward(Globals.HazardColors color) { RewardScript rewardObjTemp; Globals.stateManager.audioSource.PlayOneShot(rewardAppearsSound); rewardObjTemp = Utils.InstanceCreate<RewardScript>(Utils.OUT_OF_SCREEN, rewardObj); rewardObjTemp.color = color; }
public Subtree(TextWriter stdout, Fetch fetch, QuickFetch quickFetch, Globals globals, RemoteOptions remoteOptions) { this._stdout = stdout; this._fetch = fetch; this._quickFetch = quickFetch; this._globals = globals; this._remoteOptions = remoteOptions; }
public GitRepository(TextWriter stdout, string gitDir, IContainer container, Globals globals) : base(stdout, container) { _container = container; _globals = globals; GitDir = gitDir; _repository = new Repository(new DirectoryInfo(gitDir)); }
public Fetch(Globals globals, TextWriter stdout, RemoteOptions remoteOptions, AuthorsFile authors, Labels labels) { this.globals = globals; this.stdout = stdout; this.remoteOptions = remoteOptions; this.authors = authors; this.labels = labels; }
public GitRepository(TextWriter stdout, string gitDir, IContainer container, Globals globals) : base(stdout, container) { _container = container; _globals = globals; GitDir = gitDir; _repository = new LibGit2Sharp.Repository(GitDir); }
/// <summary> /// Initializes a new instance of the Version class. /// </summary> /// <param name="stdout"></param> /// <param name="versionProvider"></param> public Version(Globals globals, TextWriter stdout, IGitTfsVersionProvider versionProvider) { this.globals = globals; this.stdout = stdout; this.versionProvider = versionProvider; this.OptionSet = globals.OptionSet; }
public Clone(Globals globals, Fetch fetch, Init init, InitBranch initBranch, TextWriter stdout) { this.fetch = fetch; this.init = init; this.globals = globals; this.initBranch = initBranch; this.stdout = stdout; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (Request.IsAuthenticated) { //if a Login Page has not been specified for the portal if (Globals.IsAdminControl()) { //redirect to current page Response.Redirect(Globals.NavigateURL(), true); } else //make module container invisible if user is not a page admin { if (!TabPermissionController.CanAdminPage()) { ContainerControl.Visible = false; } } } if (UseCaptcha) { captchaRow.Visible = true; ctlCaptcha.ErrorMessage = Localization.GetString("InvalidCaptcha", LocalResourceFile); ctlCaptcha.Text = Localization.GetString("CaptchaText", LocalResourceFile); } if (UseAuthProviders && String.IsNullOrEmpty(AuthenticationType)) { foreach (AuthenticationLoginBase authLoginControl in _loginControls) { socialLoginControls.Controls.Add(authLoginControl); } } //Display relevant message userHelpLabel.Text = Localization.GetSystemMessage(PortalSettings, "MESSAGE_REGISTRATION_INSTRUCTIONS"); switch (PortalSettings.UserRegistration) { case (int)Globals.PortalRegistrationType.PrivateRegistration: userHelpLabel.Text += Localization.GetString("PrivateMembership", Localization.SharedResourceFile); break; case (int)Globals.PortalRegistrationType.PublicRegistration: userHelpLabel.Text += Localization.GetString("PublicMembership", Localization.SharedResourceFile); break; case (int)Globals.PortalRegistrationType.VerifiedRegistration: userHelpLabel.Text += Localization.GetString("VerifiedMembership", Localization.SharedResourceFile); break; } userHelpLabel.Text += Localization.GetString("Required", LocalResourceFile); userHelpLabel.Text += Localization.GetString("RegisterWarning", LocalResourceFile); userForm.DataSource = User; if (!Page.IsPostBack) { userForm.DataBind(); } }
protected override void OnInit(EventArgs e) { base.OnInit(e); if (RegistrationFormType == 0) { //UserName if (!UseEmailAsUserName) { AddField("Username", String.Empty, true, String.IsNullOrEmpty(UserNameValidator) ? ExcludeTerms : UserNameValidator, TextBoxMode.SingleLine); } //Password if (!RandomPassword) { AddField("Password", "Membership", true, String.Empty, TextBoxMode.Password); if (RequirePasswordConfirm) { AddField("PasswordConfirm", "Membership", true, String.Empty, TextBoxMode.Password); } } //Password Q&A if (MembershipProviderConfig.RequiresQuestionAndAnswer) { AddField("PasswordQuestion", "Membership", true, String.Empty, TextBoxMode.SingleLine); AddField("PasswordAnswer", "Membership", true, String.Empty, TextBoxMode.SingleLine); } //DisplayName if (String.IsNullOrEmpty(DisplayNameFormat)) { //DisplayName has an additional validator AddField("DisplayName", String.Empty, true, String.Empty, TextBoxMode.SingleLine); } else { AddField("FirstName", String.Empty, true, String.Empty, TextBoxMode.SingleLine); AddField("LastName", String.Empty, true, String.Empty, TextBoxMode.SingleLine); } //Email AddField("Email", String.Empty, true, EmailValidator, TextBoxMode.SingleLine); if (RequireValidProfile) { foreach (ProfilePropertyDefinition property in User.Profile.ProfileProperties) { if (property.Required) { AddProperty(property); } } } } else { string[] fields = RegistrationFields.Split(','); foreach (string field in fields) { var trimmedField = field.Trim(); switch (trimmedField) { case "Username": AddField("Username", String.Empty, true, String.IsNullOrEmpty(UserNameValidator) ? ExcludeTerms : UserNameValidator, TextBoxMode.SingleLine); break; case "Email": AddField("Email", String.Empty, true, EmailValidator, TextBoxMode.SingleLine); break; case "Password": case "PasswordConfirm": AddField(trimmedField, "Membership", true, String.Empty, TextBoxMode.Password); break; case "PasswordQuestion": case "PasswordAnswer": AddField(trimmedField, "Membership", true, String.Empty, TextBoxMode.SingleLine); break; case "DisplayName": //DisplayName has an additional validator AddField(trimmedField, String.Empty, true, ExcludeTerms, TextBoxMode.SingleLine); break; default: ProfilePropertyDefinition property = User.Profile.GetProperty(trimmedField); if (property != null) { AddProperty(property); } break; } } } //Verify that the current user has access to this page if (PortalSettings.UserRegistration == (int)Globals.PortalRegistrationType.NoRegistration && Request.IsAuthenticated == false) { Response.Redirect(Globals.NavigateURL("Access Denied"), true); } cancelButton.Click += cancelButton_Click; registerButton.Click += registerButton_Click; if (UseAuthProviders) { List <AuthenticationInfo> authSystems = AuthenticationController.GetEnabledAuthenticationServices(); foreach (AuthenticationInfo authSystem in authSystems) { try { var authLoginControl = (AuthenticationLoginBase)LoadControl("~/" + authSystem.LoginControlSrc); if (authSystem.AuthenticationType != "DNN") { BindLoginControl(authLoginControl, authSystem); //Check if AuthSystem is Enabled if (authLoginControl.Enabled && authLoginControl.SupportsRegistration) { authLoginControl.Mode = AuthMode.Register; //Add Login Control to List _loginControls.Add(authLoginControl); } } } catch (Exception ex) { Exceptions.LogException(ex); } } } }
private void getLocalPlayer() { localPlayer = PhotonNetwork.LocalPlayer; playerID = Globals.convert(localPlayer.ActorNumber); }
protected void Page_Load(object sender, System.EventArgs e) { ExpressSet expressSet = ExpressHelper.GetExpressSet(); this.hdHasNewKey.Value = "0"; this.hdExpressUrl.Value = ""; if (expressSet != null) { if (!string.IsNullOrEmpty(expressSet.NewKey)) { this.hdHasNewKey.Value = "1"; } if (!string.IsNullOrEmpty(expressSet.Url.Trim())) { this.hdExpressUrl.Value = expressSet.Url.Trim(); } } string a = Globals.RequestFormStr("posttype"); if (a == "modifyRefundMondy") { base.Response.ContentType = "application/json"; string s = "{\"type\":\"0\",\"tips\":\"操作失败!\"}"; decimal num = 0m; decimal.TryParse(Globals.RequestFormStr("price"), out num); int num2 = Globals.RequestFormNum("pid"); string text = Globals.RequestFormStr("oid"); if (num > 0m && num2 > 0 && !string.IsNullOrEmpty(text)) { if (RefundHelper.UpdateRefundMoney(text, num2, num)) { s = "{\"type\":\"1\",\"tips\":\"操作成功!\"}"; } } else if (num <= 0m) { s = "{\"type\":\"0\",\"tips\":\"退款金额需大于0!\"}"; } base.Response.Write(s); base.Response.End(); return; } this.reurl = "OrderDetails.aspx?OrderId=" + this.orderId + "&t=" + System.DateTime.Now.ToString("HHmmss"); this.btnMondifyPay.Click += new System.EventHandler(this.btnMondifyPay_Click); this.btnCloseOrder.Click += new System.EventHandler(this.btnCloseOrder_Click); this.btnRemark.Click += new System.EventHandler(this.btnRemark_Click); this.order = OrderHelper.GetOrderInfo(this.orderId); if (this.order != null) { if (!base.IsPostBack) { if (string.IsNullOrEmpty(this.orderId)) { base.GotoResourceNotFound(); return; } this.hdfOrderID.Value = this.orderId; this.litOrderDate.Text = this.order.OrderDate.ToString("yyyy-MM-dd HH:mm:ss"); if (this.order.PayDate.HasValue) { this.litPayDate.Text = System.DateTime.Parse(this.order.PayDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.ShippingDate.HasValue) { this.litShippingDate.Text = System.DateTime.Parse(this.order.ShippingDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } if (this.order.FinishDate.HasValue) { this.litFinishDate.Text = System.DateTime.Parse(this.order.FinishDate.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); } this.lblOrderStatus.OrderStatusCode = this.order.OrderStatus; switch (this.order.OrderStatus) { case OrderStatus.WaitBuyerPay: this.ProcessClass2 = "active"; if (this.order.Gateway != "hishop.plugins.payment.podrequest") { this.btnConfirmPay.Visible = true; } this.btnModifyAddr.Attributes.Add("onclick", "DialogFrame('../trade/ShipAddress.aspx?action=update&OrderId=" + this.orderId + "','修改收货地址',620,410)"); this.btnModifyAddr.Visible = true; break; case OrderStatus.BuyerAlreadyPaid: this.ProcessClass2 = "ok"; this.ProcessClass3 = "active"; this.btnModifyAddr.Attributes.Add("onclick", "DialogFrame('../trade/ShipAddress.aspx?action=update&OrderId=" + this.orderId + "','修改收货地址',620,410)"); this.btnModifyAddr.Visible = true; break; case OrderStatus.SellerAlreadySent: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "active"; break; case OrderStatus.Finished: this.ProcessClass2 = "ok"; this.ProcessClass3 = "ok"; this.ProcessClass4 = "ok"; break; } if (this.order.ManagerMark.HasValue) { this.OrderRemarkImageLink.ManagerMarkValue = (int)this.order.ManagerMark.Value; this.litManagerRemark.Text = this.order.ManagerRemark; } else { this.divRemarkShow.Visible = false; } this.litRemark.Text = this.order.Remark; string text2 = this.order.OrderId; string orderMarking = this.order.OrderMarking; if (!string.IsNullOrEmpty(orderMarking)) { text2 = string.Concat(new string[] { text2, " (", this.order.PaymentType, "流水号:", orderMarking, ")" }); } this.litOrderId.Text = text2; this.litUserName.Text = this.order.Username; this.litPayType.Text = this.order.PaymentType; this.litShipToDate.Text = this.order.ShipToDate; this.litRealName.Text = this.order.ShipTo; this.litUserTel.Text = (string.IsNullOrEmpty(this.order.CellPhone) ? this.order.TelPhone : this.order.CellPhone); this.litShippingRegion.Text = this.order.ShippingRegion; this.litFreight.Text = Globals.FormatMoney(this.order.AdjustedFreight); if (this.order.ReferralUserId == 0) { this.litSiteName.Text = "主站"; } else { DistributorsInfo distributorInfo = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (distributorInfo != null) { this.litSiteName.Text = distributorInfo.StoreName; } } System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder(); if (!string.IsNullOrEmpty(this.order.ActivitiesName)) { this.otherDiscountPrice += this.order.DiscountAmount; stringBuilder.Append(string.Concat(new string[] { "<p>", this.order.ActivitiesName, ":¥", this.order.DiscountAmount.ToString("F2"), "</p>" })); } if (!string.IsNullOrEmpty(this.order.ReducedPromotionName)) { this.otherDiscountPrice += this.order.ReducedPromotionAmount; stringBuilder.Append(string.Concat(new string[] { "<p>", this.order.ReducedPromotionName, ":¥", this.order.ReducedPromotionAmount.ToString("F2"), "</p>" })); } if (!string.IsNullOrEmpty(this.order.CouponName)) { this.otherDiscountPrice += this.order.CouponAmount; stringBuilder.Append(string.Concat(new string[] { "<p>", this.order.CouponName, ":¥", this.order.CouponAmount.ToString("F2"), "</p>" })); } if (!string.IsNullOrEmpty(this.order.RedPagerActivityName)) { this.otherDiscountPrice += this.order.RedPagerAmount; stringBuilder.Append(string.Concat(new string[] { "<p>", this.order.RedPagerActivityName, ":¥", this.order.RedPagerAmount.ToString("F2"), "</p>" })); } if (this.order.PointToCash > 0m) { this.otherDiscountPrice += this.order.PointToCash; stringBuilder.Append("<p>积分抵现:¥" + this.order.PointToCash.ToString("F2") + "</p>"); } this.order.GetAdjustCommssion(); decimal d = 0m; decimal num3 = 0m; foreach (LineItemInfo current in this.order.LineItems.Values) { if (current.IsAdminModify) { d += current.ItemAdjustedCommssion; } else { num3 += current.ItemAdjustedCommssion; } } if (d != 0m) { if (d > 0m) { stringBuilder.Append("<p>管理员调价减:¥" + d.ToString("F2") + "</p>"); } else { stringBuilder.Append("<p>管理员调价加:¥" + (d * -1m).ToString("F2") + "</p>"); } } if (num3 != 0m) { if (num3 > 0m) { stringBuilder.Append("<p>分销商调价减:¥" + num3.ToString("F2") + "</p>"); } else { stringBuilder.Append("<p>分销商调价加:¥" + (num3 * -1m).ToString("F2") + "</p>"); } } this.litActivityShow.Text = stringBuilder.ToString(); if ((int)this.lblOrderStatus.OrderStatusCode != 4) { this.lbCloseReason.Visible = false; } else { this.divOrderProcess.Visible = false; this.lbReason.Text = this.order.CloseReason; } if (this.order.OrderStatus == OrderStatus.BuyerAlreadyPaid || (this.order.OrderStatus == OrderStatus.WaitBuyerPay && this.order.Gateway == "hishop.plugins.payment.podrequest")) { this.btnSendGoods.Visible = true; } else { this.btnSendGoods.Visible = false; } if ((this.order.OrderStatus == OrderStatus.SellerAlreadySent || this.order.OrderStatus == OrderStatus.Finished) && !string.IsNullOrEmpty(this.order.ExpressCompanyAbb)) { this.pLoginsticInfo.Visible = true; this.btnViewLogistic.Visible = true; if (Express.GetExpressType() == "kuaidi100" && this.power != null) { this.power.Visible = true; } } if (this.order.OrderStatus == OrderStatus.WaitBuyerPay) { this.btnClocsOrder.Visible = true; this.btnModifyPrice.Visible = true; } else { this.btnClocsOrder.Visible = false; this.btnModifyPrice.Visible = false; } this.btnModifyPrice.Attributes.Add("onclick", string.Concat(new string[] { "DialogFrame('../trade/EditOrder.aspx?OrderId=", this.orderId, "&reurl=", base.Server.UrlEncode(this.reurl), "','修改订单价格',900,450)" })); this.BindRemark(this.order); this.ddlpayment.DataBind(); this.ddlpayment.SelectedValue = new int?(this.order.PaymentTypeId); this.rptItemList.DataSource = this.order.LineItems.Values; this.rptItemList.DataBind(); string oldAddress = this.order.OldAddress; string text3 = string.Empty; if (!string.IsNullOrEmpty(this.order.ShippingRegion)) { text3 = this.order.ShippingRegion.Replace(',', ' '); } if (!string.IsNullOrEmpty(this.order.Address)) { text3 += this.order.Address; } if (!string.IsNullOrEmpty(this.order.ShipTo)) { text3 = text3 + "," + this.order.ShipTo; } if (!string.IsNullOrEmpty(this.order.TelPhone)) { text3 = text3 + "," + this.order.TelPhone; } if (!string.IsNullOrEmpty(this.order.CellPhone)) { text3 = text3 + "," + this.order.CellPhone; } if (string.IsNullOrEmpty(oldAddress)) { this.lblOriAddress.Text = text3; this.pNewAddress.Visible = false; } else { this.lblOriAddress.Text = oldAddress; this.litAddress.Text = text3; } if (this.order.OrderStatus == OrderStatus.Finished || this.order.OrderStatus == OrderStatus.SellerAlreadySent) { string text4 = this.order.RealModeName; if (string.IsNullOrEmpty(text4)) { text4 = this.order.ModeName; } this.litModeName.Text = text4; this.litShipOrderNumber.Text = this.order.ShipOrderNumber; } else { this.litModeName.Text = this.order.ModeName; } if (!string.IsNullOrEmpty(this.order.ExpressCompanyName)) { this.litCompanyName.Text = this.order.ExpressCompanyName; this.hdCompanyCode.Value = this.order.ExpressCompanyAbb; } MemberInfo member = MemberProcessor.GetMember(this.order.UserId, true); if (member != null) { if (!string.IsNullOrEmpty(member.OpenId)) { this.litWeiXinNickName.Text = member.UserName; } if (!string.IsNullOrEmpty(member.UserBindName)) { this.litUserName.Text = member.UserBindName; } } if (this.order.ReferralUserId > 0) { stringBuilder = new System.Text.StringBuilder(); stringBuilder.Append("<div class=\"commissionInfo mb20\"><h3>佣金信息</h3><div class=\"commissionInfoInner\">"); decimal d2 = 0m; decimal num4 = 0m; decimal d3 = 0m; decimal d4 = 0m; if (this.order.OrderStatus != OrderStatus.Closed) { num4 = this.order.GetTotalCommssion(); d3 = this.order.GetSecondTotalCommssion(); d4 = this.order.GetThirdTotalCommssion(); } d2 += num4; string text5 = string.Empty; DistributorsInfo distributorInfo2 = DistributorsBrower.GetDistributorInfo(this.order.ReferralUserId); if (distributorInfo2 != null) { text5 = distributorInfo2.StoreName; if (this.order.ReferralPath != null && this.order.ReferralPath.Length > 0) { string[] array = this.order.ReferralPath.Trim().Split(new char[] { '|' }); if (array.Length > 1) { int num5 = Globals.ToNum(array[0]); if (num5 > 0) { distributorInfo2 = DistributorsBrower.GetDistributorInfo(num5); if (distributorInfo2 != null) { d2 += d4; stringBuilder.Append(string.Concat(new string[] { "<p class=\"mb5\"><span>上二级分销商:</span> ", distributorInfo2.StoreName, "<i> ¥", d4.ToString("F2"), "</i></p>" })); } } num5 = Globals.ToNum(array[1]); if (num5 > 0) { distributorInfo2 = DistributorsBrower.GetDistributorInfo(num5); if (distributorInfo2 != null) { d2 += d3; stringBuilder.Append(string.Concat(new string[] { "<p class=\"mb5\"><span>上一级分销商:</span> ", distributorInfo2.StoreName, "<i> ¥", d3.ToString("F2"), "</i></p>" })); } } } else if (array.Length == 1) { int num5 = Globals.ToNum(array[0]); if (num5 > 0) { distributorInfo2 = DistributorsBrower.GetDistributorInfo(num5); if (distributorInfo2 != null) { stringBuilder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); d2 += d3; stringBuilder.Append(string.Concat(new string[] { "<p class=\"mb5\"><span>上一级分销商:</span>", distributorInfo2.StoreName, " <i> ¥", d3.ToString("F2"), "</i></p>" })); } } } } else { stringBuilder.Append("<p class=\"mb5\"><span>上二级分销商:</span>-</p>"); stringBuilder.Append("<p class=\"mb5\"><span>上一级分销商:</span>-</p>"); } } stringBuilder.Append("<div class=\"clearfix\">"); if (num3 > 0m) { string text6 = " (改价让利¥" + num3.ToString("F2") + ")"; stringBuilder.Append(string.Concat(new string[] { "<p><span>成交店铺:</span> ", text5, " <i>¥", (num4 - num3).ToString("F2"), "</i>", text6, "</p>" })); stringBuilder.Append("<p><span>佣金总额:</span><i>¥" + (d2 - num3).ToString("F2") + "</i></p>"); } else { stringBuilder.Append(string.Concat(new string[] { "<p><span>成交店铺:</span> ", text5, " <i>¥", num4.ToString("F2"), "</i></p>" })); stringBuilder.Append("<p><span>佣金总额:</span><i>¥" + d2.ToString("F2") + "</i></p>"); } stringBuilder.Append("</div></div></div>"); this.litCommissionInfo.Text = stringBuilder.ToString(); } System.Data.DataTable orderItemsReFundByOrderID = RefundHelper.GetOrderItemsReFundByOrderID(this.orderId); if (orderItemsReFundByOrderID.Rows.Count > 0) { this.rptRefundList.DataSource = orderItemsReFundByOrderID; this.rptRefundList.DataBind(); return; } } } else { base.Response.Write("原订单已删除!"); base.Response.End(); } }
public void btnRefer_Click(object sender, System.EventArgs e) { if (!Hidistro.Membership.Context.HiContext.Current.CheckVerifyCode(this.txtLeaveCode.Value)) { this.ShowMessage("验证码不正确", false); } else { if (this.ValidateConvert() && (Hidistro.Membership.Context.HiContext.Current.User.UserRole == Hidistro.Membership.Core.Enums.UserRole.Member || Hidistro.Membership.Context.HiContext.Current.User.UserRole == Hidistro.Membership.Core.Enums.UserRole.Underling || this.userRegion(this.txtLeaveUserName.Value, this.txtLeavePsw.Value))) { LeaveCommentInfo leaveCommentInfo = new LeaveCommentInfo(); leaveCommentInfo.UserName = Globals.HtmlEncode(this.txtUserName.Text); leaveCommentInfo.UserId = new int?(Hidistro.Membership.Context.HiContext.Current.User.UserId); leaveCommentInfo.Title = Globals.HtmlEncode(this.txtTitle.Text); leaveCommentInfo.PublishContent = Globals.HtmlEncode(this.txtContent.Text); ValidationResults validationResults = Validation.Validate <LeaveCommentInfo>(leaveCommentInfo, new string[] { "Refer" }); string text = string.Empty; if (!validationResults.IsValid) { foreach (ValidationResult current in (System.Collections.Generic.IEnumerable <ValidationResult>)validationResults) { text += Formatter.FormatErrorMessage(current.Message); } this.ShowMessage(text, false); } else { if (CommentProcessor.InsertLeaveComment(leaveCommentInfo)) { this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "success", string.Format("<script>alert(\"{0}\");window.location.href=\"{1}\"</script>", "留言成功,管理员回复后即可显示", Globals.GetSiteUrls().UrlData.FormatUrl("LeaveComments"))); } else { this.ShowMessage("留言失败", false); } this.txtTitle.Text = string.Empty; this.txtContent.Text = string.Empty; } } } }
public void GetActivityInfo(HttpContext context) { int activityId = context.Request["ActivityId"].ToInt(0); ActivityInfo activityInfo = ActivityHelper.GetActivityInfo(activityId); if (activityInfo == null) { this.ReturnError(context, 1007, "活动不存在!"); } else { ActivityJsonModel activityJsonModel = new ActivityJsonModel(); MemberInfo user = HiContext.Current.User; DateTime dateTime; if (user.UserId == 0) { activityJsonModel.FreeTimes = activityInfo.FreeTimes; } else { activityJsonModel.FreeTimes = activityInfo.FreeTimes; ActivityJoinStatisticsInfo currUserActivityStatisticsInfo = ActivityHelper.GetCurrUserActivityStatisticsInfo(user.UserId, activityId); if (currUserActivityStatisticsInfo == null) { activityJsonModel.FreeTimes = activityInfo.FreeTimes; } else if (activityInfo.ResetType == 2) { dateTime = DateTime.Now; DateTime date = dateTime.Date; dateTime = currUserActivityStatisticsInfo.LastJoinDate; if (date == dateTime.Date) { activityJsonModel.FreeTimes = activityInfo.FreeTimes - currUserActivityStatisticsInfo.FreeNum; } else { activityJsonModel.FreeTimes = activityInfo.FreeTimes; } } else { Globals.AppendLog("5", "", "", ""); activityJsonModel.FreeTimes = activityInfo.FreeTimes - currUserActivityStatisticsInfo.FreeNum; } } activityJsonModel.ResetType = activityInfo.ResetType; activityJsonModel.ActivityId = activityInfo.ActivityId; activityJsonModel.ActivityName = activityInfo.ActivityName; activityJsonModel.ActivityType = activityInfo.ActivityType; activityJsonModel.ConsumptionIntegral = activityInfo.ConsumptionIntegral; activityJsonModel.Description = activityInfo.Description; ActivityJsonModel activityJsonModel2 = activityJsonModel; dateTime = activityInfo.EndDate; activityJsonModel2.EndDate = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); ActivityJsonModel activityJsonModel3 = activityJsonModel; dateTime = activityInfo.StartDate; activityJsonModel3.StartDate = dateTime.ToString("yyyy-MM-dd HH:mm:ss"); if (DateTime.Now < activityInfo.StartDate) { activityJsonModel.Statu = 1; } else if (DateTime.Now > activityInfo.EndDate) { activityJsonModel.Statu = 2; } else { activityJsonModel.Statu = 0; } activityJsonModel.AwardList = new List <AwardItemInfo>(); List <ActivityAwardItemInfo> activityItemList = ActivityHelper.GetActivityItemList(activityId); foreach (ActivityAwardItemInfo item in activityItemList) { AwardItemInfo awardItemInfo = new AwardItemInfo(); awardItemInfo.ActivityId = item.ActivityId; awardItemInfo.AwardGrade = this.CapitalLetters(item.AwardGrade); awardItemInfo.AwardId = item.AwardId; awardItemInfo.PrizeType = item.PrizeType; if (item.PrizeType == 2) { CouponInfo coupon = CouponHelper.GetCoupon(item.PrizeValue); if (coupon != null) { awardItemInfo.AwardName = coupon.Price.F2ToString("f2") + "元"; } else { awardItemInfo.AwardName = ""; } awardItemInfo.AwardPic = ""; } else if (item.PrizeType == 3) { GiftInfo giftDetails = GiftHelper.GetGiftDetails(item.PrizeValue); if (giftDetails != null) { awardItemInfo.AwardName = giftDetails.Name; awardItemInfo.AwardPic = giftDetails.ThumbnailUrl60; } else { awardItemInfo.AwardName = "礼品"; awardItemInfo.AwardPic = ""; } } else { awardItemInfo.AwardPic = ""; awardItemInfo.AwardName = item.PrizeValue.ToString(); } activityJsonModel.AwardList.Add(awardItemInfo); } string s = JsonConvert.SerializeObject(new { Result = activityJsonModel }); context.Response.Write(s); context.Response.End(); } }
protected string GetHtml(TabInfo tab) { string returnValue = string.Empty; if ((_groupTabID > -1 && _groupTabID != tab.ParentId)) { _groupTabID = -1; if ((!tab.DisableLink)) { returnValue = "<br style=\"clear:both;\" /><br />"; } } if ((tab.DisableLink)) { const string headerHtml = "<br style=\"clear:both;\" /><br /><h1><span class=\"TitleHead\">{0}</span></h1><br style=\"clear:both\" />"; returnValue += string.Format(headerHtml, tab.TabName); _groupTabID = tab.TabID; } else { var sb = new StringBuilder(); if (tab.TabID == PortalSettings.ActiveTab.TabID) { sb.Append("<div class=\"active console-none \">"); } else { sb.Append("<div class=\"console-none \">"); } sb.Append("<a href=\"{0}\">"); if (DefaultSize != "IconNone" || (AllowSizeChange || AllowViewChange)) { sb.Append("<img src=\"{1}\" alt=\"{3}\" width=\"16px\" height=\"16px\"/>"); sb.Append("<img src=\"{2}\" alt=\"{3}\" width=\"32px\" height=\"32px\"/>"); } sb.Append("</a>"); sb.Append("<h3>{3}</h3>"); sb.Append("<div>{4}</div>"); sb.Append("</div>"); //const string contentHtml = "<div>" + "<a href=\"{0}\"><img src=\"{1}\" alt=\"{3}\" width=\"16px\" height=\"16px\"/><img src=\"{2}\" alt=\"{3}\" width=\"32px\" height=\"32px\"/></a>" + "<h3>{3}</h3>" + "<div>{4}</div>" + "</div>"; var tabUrl = tab.FullUrl; if (ProfileUserId > -1) { tabUrl = Globals.NavigateURL(tab.TabID, "", "UserId=" + ProfileUserId.ToString(CultureInfo.InvariantCulture)); } if (GroupId > -1) { tabUrl = Globals.NavigateURL(tab.TabID, "", "GroupId=" + GroupId.ToString(CultureInfo.InvariantCulture)); } returnValue += string.Format(sb.ToString(), tabUrl, GetIconUrl(tab.IconFile, "IconFile"), GetIconUrl(tab.IconFileLarge, "IconFileLarge"), tab.LocalizedTabName, tab.Description); } return(returnValue); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (Visible) { try { if (LegacyMode) { loginLink.Visible = true; loginGroup.Visible = false; } else { loginLink.Visible = false; loginGroup.Visible = true; } if (!String.IsNullOrEmpty(CssClass)) { loginLink.CssClass = CssClass; enhancedLoginLink.CssClass = CssClass; } if (Request.IsAuthenticated) { if (!String.IsNullOrEmpty(LogoffText)) { if (LogoffText.IndexOf("src=") != -1) { LogoffText = LogoffText.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } loginLink.Text = LogoffText; enhancedLoginLink.Text = LogoffText; } else { loginLink.Text = Localization.GetString("Logout", Localization.GetResourceFile(this, MyFileName)); enhancedLoginLink.Text = loginLink.Text; loginLink.ToolTip = loginLink.Text; enhancedLoginLink.ToolTip = loginLink.Text; } loginLink.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Logoff"); enhancedLoginLink.NavigateUrl = loginLink.NavigateUrl; } else { if (!String.IsNullOrEmpty(Text)) { if (Text.IndexOf("src=") != -1) { Text = Text.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } loginLink.Text = Text; enhancedLoginLink.Text = Text; } else { loginLink.Text = Localization.GetString("Login", Localization.GetResourceFile(this, MyFileName)); enhancedLoginLink.Text = loginLink.Text; loginLink.ToolTip = loginLink.Text; enhancedLoginLink.ToolTip = loginLink.Text; } string returnUrl = HttpContext.Current.Request.RawUrl; if (returnUrl.IndexOf("?returnurl=") != -1) { returnUrl = returnUrl.Substring(0, returnUrl.IndexOf("?returnurl=")); } returnUrl = HttpUtility.UrlEncode(returnUrl); loginLink.NavigateUrl = Globals.LoginURL(returnUrl, (Request.QueryString["override"] != null)); enhancedLoginLink.NavigateUrl = loginLink.NavigateUrl; //avoid issues caused by multiple clicks of login link var oneclick = "this.disabled=true;"; if (Request.UserAgent != null && Request.UserAgent.Contains("MSIE 8.0") == false) { loginLink.Attributes.Add("onclick", oneclick); enhancedLoginLink.Attributes.Add("onclick", oneclick); } if (PortalSettings.EnablePopUps && PortalSettings.LoginTabId == Null.NullInteger && !HasSocialAuthenticationEnabled()) { //To avoid duplicated encodes of URL var clickEvent = "return " + UrlUtils.PopUpUrl(HttpUtility.UrlDecode(loginLink.NavigateUrl), this, PortalSettings, true, false, 300, 650); loginLink.Attributes.Add("onclick", clickEvent); enhancedLoginLink.Attributes.Add("onclick", clickEvent); } } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } } }
public static object GetGlobal(string globalName, DTE dte) { Globals globals = dte.Globals; return(globals.VariableExists[globalName] ? globals[globalName] : null); }
protected override void OnClick() { ConfigUtil.type = "gas"; try { List <ESRI.ArcGIS.Geometry.IPoint> Flags; List <ESRI.ArcGIS.Geometry.IPoint> Barriers; IWorkspace pWS; IFields pFields; IPoint pNPt; Globals.getFlagsBarriers(ArcMap.Application, out Flags, out Barriers); // Open the Workspace if ((pWS = Globals.GetInMemoryWorkspaceFromTOC(ArcMap.Document.FocusMap)) == null) { pWS = Globals.CreateInMemoryWorkspace(); } pFields = Globals.createFeatureClassFields(ArcMap.Document.FocusMap.SpatialReference, esriGeometryType.esriGeometryPoint, null, null); IFeatureClass pFlagsFC = Globals.createFeatureClassInMemory(A4LGSharedFunctions.Localizer.GetString("ExportFlagsName"), pFields, pWS, esriFeatureType.esriFTSimpleJunction); IFeatureClass pBarriersFC = Globals.createFeatureClassInMemory(A4LGSharedFunctions.Localizer.GetString("ExportBarriersName"), pFields, pWS, esriFeatureType.esriFTSimpleJunction); IFeatureCursor pntInsertCurs = pFlagsFC.Insert(true); IFeatureBuffer pFBuf; IFeature pFeat; foreach (ESRI.ArcGIS.Geometry.IPoint pnt in Flags) // Loop through List with foreach { pFBuf = pFlagsFC.CreateFeatureBuffer(); pFeat = (IFeature)pFBuf; pNPt = new ESRI.ArcGIS.Geometry.PointClass(); pNPt.X = pnt.X; pNPt.Y = pnt.Y; pFeat.Shape = pNPt; pntInsertCurs.InsertFeature(pFBuf); } pntInsertCurs = pBarriersFC.Insert(true); foreach (ESRI.ArcGIS.Geometry.IPoint pnt in Barriers) // Loop through List with foreach { pFBuf = pBarriersFC.CreateFeatureBuffer(); pFeat = (IFeature)pFBuf; pNPt = new ESRI.ArcGIS.Geometry.PointClass(); pNPt.X = pnt.X; pNPt.Y = pnt.Y; pFeat.Shape = pNPt; pntInsertCurs.InsertFeature(pFBuf); } IFeatureLayer pFlagsLayer = new FeatureLayerClass(); pFlagsLayer.FeatureClass = pFlagsFC; pFlagsLayer.Name = A4LGSharedFunctions.Localizer.GetString("ExportFlagsName"); IFeatureLayer pBarriersLayer = new FeatureLayerClass(); pBarriersLayer.FeatureClass = pBarriersFC; pBarriersLayer.Name = A4LGSharedFunctions.Localizer.GetString("ExportBarriersName"); ArcMap.Document.FocusMap.AddLayer(pFlagsLayer); ArcMap.Document.FocusMap.AddLayer(pBarriersLayer); ArcMap.Document.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewAll, null, null); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { } }
public ConnectionChecker() { m_Editor = Globals.getEditor(ArcMap.Application); ConfigUtil.type = "gas"; }
public DisconnectSelected() { m_Editor = Globals.getEditor(ArcMap.Application); ConfigUtil.type = "gas"; }
public FlowAccumulation() { m_Editor = Globals.getEditor(ArcMap.Application); ConfigUtil.type = "gas"; }
public static void SetGlobal(string globalName, object value, DTE dte) { Globals globals = dte.Globals; globals[globalName] = value; }
public HttpResponseMessage SwitchSite(SwitchSiteDTO dto) { if (UserController.Instance.GetCurrentUserInfo().IsSuperUser) { try { if ((!string.IsNullOrEmpty(dto.Site))) { int selectedPortalID = int.Parse(dto.Site); var portalAliases = PortalAliasController.Instance.GetPortalAliasesByPortalId(selectedPortalID).ToList(); if ((portalAliases.Count > 0 && (portalAliases[0] != null))) { return(Request.CreateResponse(HttpStatusCode.OK, new { RedirectURL = Globals.AddHTTP(((PortalAliasInfo)portalAliases[0]).HTTPAlias) })); } } } catch (System.Threading.ThreadAbortException) { //Do nothing we are not logging ThreadAbortxceptions caused by redirects } catch (Exception ex) { Exceptions.LogException(ex); } } return(Request.CreateResponse(HttpStatusCode.InternalServerError)); }
//--------------------------------------------------------------------- public override void Initialize() { PlugIn.ModelCore.UI.WriteLine("Initializing " + Names.ExtensionName + " version " + typeof(PlugIn).Assembly.GetName().Version); Cohort.DeathEvent += DeathEvent; Globals.InitializeCore(ModelCore, ((Parameter <ushort>)Names.GetParameter(Names.IMAX)).Value); EcoregionData.Initialize(); SiteVars.Initialize(); Landis.Utilities.Directory.EnsureExists("output"); Timestep = ((Parameter <int>)Names.GetParameter(Names.Timestep)).Value; Parameter <string> CohortBinSizeParm = null; if (Names.TryGetParameter(Names.CohortBinSize, out CohortBinSizeParm)) { if (Int32.TryParse(CohortBinSizeParm.Value, out CohortBinSize)) { if (CohortBinSize < Timestep) { throw new System.Exception("CohortBinSize cannot be smaller than Timestep."); } else { PlugIn.ModelCore.UI.WriteLine("Succession timestep = " + Timestep + "; CohortBinSize = " + CohortBinSize + "."); } } else { throw new System.Exception("CohortBinSize is not an integer value."); } } else { CohortBinSize = Timestep; } string Parallel = ((Parameter <string>)Names.GetParameter(Names.Parallel)).Value; if (Parallel == "false") { ParallelThreads = 1; PlugIn.ModelCore.UI.WriteLine(" MaxParallelThreads = " + ParallelThreads.ToString() + "."); } else if (Parallel == "true") { ParallelThreads = -1; PlugIn.ModelCore.UI.WriteLine(" MaxParallelThreads determined by system."); } else { if (Int32.TryParse(Parallel, out ParallelThreads)) { if (ParallelThreads < 1) { throw new System.Exception("Parallel cannot be < 1."); } else { PlugIn.ModelCore.UI.WriteLine(" MaxParallelThreads = " + ParallelThreads.ToString() + "."); } } else { throw new System.Exception("Parallel must be 'true', 'false' or an integer >= 1."); } } this.ThreadCount = ParallelThreads; FTimeStep = 1.0F / Timestep; //Latitude = ((Parameter<float>)PlugIn.GetParameter(Names.Latitude, 0, 90)).Value; // Now an ecoregion parameter ObservedClimate.Initialize(); SpeciesPnET = new SpeciesPnET(); Landis.Library.PnETCohorts.SpeciesParameters.LoadParameters(SpeciesPnET); Hydrology.Initialize(); SiteCohorts.Initialize(); string PARunits = ((Parameter <string>)Names.GetParameter(Names.PARunits)).Value; if (PARunits != "umol" && PARunits != "W/m2") { throw new System.Exception("PARunits are not 'umol' or 'W/m2'."); } InitializeClimateLibrary(); // John McNabb: initialize climate library after EcoregionPnET has been initialized //EstablishmentProbability.Initialize(Timestep); // Not used // Initialize Reproduction routines: Reproduction.SufficientResources = SufficientResources; Reproduction.Establish = Establish; Reproduction.AddNewCohort = AddNewCohort; Reproduction.MaturePresent = MaturePresent; Reproduction.PlantingEstablish = PlantingEstablish; SeedingAlgorithms SeedAlgorithm = (SeedingAlgorithms)Enum.Parse(typeof(SeedingAlgorithms), Names.parameters["SeedingAlgorithm"].Value); base.Initialize(ModelCore, SeedAlgorithm); StartDate = new DateTime(((Parameter <int>)Names.GetParameter(Names.StartYear)).Value, 1, 15); PlugIn.ModelCore.UI.WriteLine("Spinning up biomass or reading from maps..."); string InitialCommunitiesTXTFile = Names.GetParameter(Names.InitialCommunities).Value; string InitialCommunitiesMapFile = Names.GetParameter(Names.InitialCommunitiesMap).Value; InitialCommunitiesSpinup = Names.GetParameter(Names.InitialCommunitiesSpinup).Value; Parameter <string> LitterMapFile; bool litterMapFile = Names.TryGetParameter(Names.LitterMap, out LitterMapFile); Parameter <string> WoodyDebrisMapFile; bool woodyDebrisMapFile = Names.TryGetParameter(Names.WoodyDebrisMap, out WoodyDebrisMapFile); InitializeSites(InitialCommunitiesTXTFile, InitialCommunitiesMapFile, ModelCore); if (litterMapFile) { MapReader.ReadLitterFromMap(LitterMapFile.Value); } if (woodyDebrisMapFile) { MapReader.ReadWoodyDebrisFromMap(WoodyDebrisMapFile.Value); } // Convert PnET cohorts to biomasscohorts ISiteVar <Landis.Library.BiomassCohorts.ISiteCohorts> biomassCohorts = PlugIn.ModelCore.Landscape.NewSiteVar <Landis.Library.BiomassCohorts.ISiteCohorts>(); foreach (ActiveSite site in PlugIn.ModelCore.Landscape) { biomassCohorts[site] = SiteVars.SiteCohorts[site]; if (SiteVars.SiteCohorts[site] != null && biomassCohorts[site] == null) { throw new System.Exception("Cannot convert PnET SiteCohorts to biomass site cohorts"); } } ModelCore.RegisterSiteVar(biomassCohorts, "Succession.BiomassCohorts"); ISiteVar <Landis.Library.AgeOnlyCohorts.ISiteCohorts> AgeCohortSiteVar = PlugIn.ModelCore.Landscape.NewSiteVar <Landis.Library.AgeOnlyCohorts.ISiteCohorts>(); ISiteVar <ISiteCohorts> PnETCohorts = PlugIn.ModelCore.Landscape.NewSiteVar <ISiteCohorts>(); foreach (ActiveSite site in PlugIn.ModelCore.Landscape) { AgeCohortSiteVar[site] = SiteVars.SiteCohorts[site]; PnETCohorts[site] = SiteVars.SiteCohorts[site]; SiteVars.FineFuels[site] = SiteVars.Litter[site].Mass; IEcoregionPnET ecoregion = EcoregionData.GetPnETEcoregion(PlugIn.ModelCore.Ecoregion[site]); IHydrology hydrology = new Hydrology(ecoregion.FieldCap); SiteVars.PressureHead[site] = hydrology.GetPressureHead(ecoregion); if (UsingClimateLibrary) { SiteVars.ExtremeMinTemp[site] = ((float)Enumerable.Min(Climate.Future_MonthlyData[Climate.Future_MonthlyData.Keys.Min()][ecoregion.Index].MonthlyTemp) - (float)(3.0 * ecoregion.WinterSTD)); } else { SiteVars.ExtremeMinTemp[site] = 999; } } ModelCore.RegisterSiteVar(AgeCohortSiteVar, "Succession.AgeCohorts"); ModelCore.RegisterSiteVar(PnETCohorts, "Succession.CohortsPnET"); }
protected void Page_Load(object sender, EventArgs e) { SortedDictionary <string, string> requestPost = this.GetRequestPost(); if (requestPost.Count > 0) { Notify notify = new Notify(); if (notify.Verify(requestPost, base.Request.Form["notify_id"], base.Request.Form["sign"])) { string str = base.Request.Form["success_details"]; try { if (!string.IsNullOrEmpty(str)) { foreach (string str2 in str.Split(new char[] { '|' })) { string[] strArray2 = str2.Split(new char[] { '^' }); if (strArray2.Length >= 8) { MemberAmountRequestInfo amountRequestDetail = MemberAmountProcessor.GetAmountRequestDetail(int.Parse(strArray2[0])); if ((amountRequestDetail != null) && (amountRequestDetail.State != RequesState.已发放)) { int[] serialids = new int[] { int.Parse(strArray2[0]) }; MemberAmountProcessor.SetAmountRequestStatus(serialids, 2, "支付宝付款:流水号" + strArray2[6] + ",支付时间:" + strArray2[7], "", ManagerHelper.GetCurrentManager().UserName); string url = Globals.FullPath("/Vshop/MemberAmountRequestDetail.aspx?Id=" + amountRequestDetail.Id); try { Messenger.SendWeiXinMsg_MemberAmountDrawCashRelease(amountRequestDetail, url); } catch { } } } } } string str4 = base.Request.Form["fail_details"]; if (!string.IsNullOrEmpty(str4)) { foreach (string str5 in str4.Split(new char[] { '|' })) { string[] strArray4 = str5.Split(new char[] { '^' }); if (strArray4.Length >= 8) { MemberAmountRequestInfo info2 = MemberAmountProcessor.GetAmountRequestDetail(int.Parse(strArray4[0])); if (((info2 != null) && (info2.State != RequesState.已发放)) && (info2.State != RequesState.驳回)) { int[] numArray2 = new int[] { int.Parse(strArray4[0]) }; MemberAmountProcessor.SetAmountRequestStatus(numArray2, 3, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + strArray4[5] + strArray4[6], strArray4[3], ManagerHelper.GetCurrentManager().UserName); } } } } } catch (Exception exception) { try { Globals.Debuglog(DateTime.Now.ToString("[yyyy-MM-dd HH:mm:ss]") + "验证成功,写入数据库失败->" + base.Request.Form.ToString() + "||" + exception.ToString(), "_DebugLogAlipaynotify_url.txt"); } catch (Exception) { } } base.Response.Write("success"); } else { base.Response.Write("fail"); try { Globals.Debuglog(DateTime.Now.ToString("[yyyy-MM-dd HH:mm:ss]") + "验证失败1,写入数据库失败->" + base.Request.Form.ToString(), "_DebugLogAlipaynotify_url.txt"); } catch (Exception) { } } } else { base.Response.Write("无通知参数"); } }
protected void OnSaveClick(object sender, EventArgs e) { const bool redirect = true; try { // get content var htmlContent = GetLatestHTMLContent(); var aliases = from PortalAliasInfo pa in PortalAliasController.Instance.GetPortalAliasesByPortalId(PortalSettings.PortalId) select pa.HTTPAlias; string content; if (phEdit.Visible) { content = txtContent.Text; } else { content = hfEditor.Value; } if (Request.QueryString["nuru"] == null) { content = HtmlUtils.AbsoluteToRelativeUrls(content, aliases); } htmlContent.Content = content; var draftStateID = _workflowStateController.GetFirstWorkflowStateID(WorkflowID); var publishedStateID = _workflowStateController.GetLastWorkflowStateID(WorkflowID); switch (CurrentWorkflowType) { case WorkflowType.DirectPublish: _htmlTextController.UpdateHtmlText(htmlContent, _htmlTextController.GetMaximumVersionHistory(PortalId)); break; case WorkflowType.ContentStaging: if (chkPublish.Checked) { //if it's already published set it to draft if (htmlContent.StateID == publishedStateID) { htmlContent.StateID = draftStateID; } else { htmlContent.StateID = publishedStateID; //here it's in published mode } } else { //if it's already published set it back to draft if ((htmlContent.StateID != draftStateID)) { htmlContent.StateID = draftStateID; } } _htmlTextController.UpdateHtmlText(htmlContent, _htmlTextController.GetMaximumVersionHistory(PortalId)); break; } } catch (Exception exc) { Exceptions.LogException(exc); UI.Skins.Skin.AddModuleMessage(Page, "Error occurred: ", exc.Message, ModuleMessage.ModuleMessageType.RedError); return; } // redirect back to portal if (redirect) { Response.Redirect(Globals.NavigateURL(), true); } }
protected override void Render(HtmlTextWriter writer) { SiteSettings masterSettings = SettingsManager.GetMasterSettings(); string domainName = Globals.DomainName; string text = HttpContext.Current.Request.UserAgent; bool flag = false; flag = (masterSettings.OpenWap == 1 && true); if (string.IsNullOrEmpty(text)) { text = ""; } if (text.ToLower().IndexOf("micromessenger") > -1 && masterSettings.OpenVstore == 1) { flag = true; } HiContext current = HiContext.Current; bool flag2 = false; if (masterSettings.OpenMultStore) { flag2 = true; } string imageServerUrl = Globals.GetImageServerUrl(); writer.Write("<script language=\"javascript\" type=\"text/javascript\"> \r\n var HasWapRight = {0};\r\n var IsOpenStores = {1};\r\n var ClientPath = \"{2}\";\r\n var ImageServerUrl = \"{3}\";\r\n var ImageUploadPath = \"{4}\";\r\n var StoreDefaultPage = \"{5}\";\r\n var qqMapAPIKey = \"{6}\";\r\n </script>", flag ? "true" : "false", flag2.ToString().ToLower(), HiContext.Current.GetClientPath, imageServerUrl, string.IsNullOrEmpty(imageServerUrl) ? "/admin/UploadHandler.ashx?action=newupload" : "/admin/UploadHandler.ashx?action=remoteupdateimages", masterSettings.Store_PositionRouteTo, string.IsNullOrEmpty(masterSettings.QQMapAPIKey) ? "SYJBZ-DSLR3-IWX3Q-3XNTM-ELURH-23FTP" : masterSettings.QQMapAPIKey); string text2 = HttpContext.Current.Request.Url.ToString().ToLower(); if ((text2.Contains("/groupbuyproductdetails") || text2.Contains("/countdownproductsdetails") || (text2.Contains("/productdetails") && !text2.Contains("/appshop")) || text2.Contains("/membercenter") || text2.Contains("/membergroupdetails") || text2.Contains("/membergroupdetailsstatus") || text2.Contains("/fightgroupactivitydetails") || text2.Contains("/fightgroupactivitydetailssoon") || text2.Contains("/fightgroupdetails") || text2.Contains("/productlist") || text2.Contains("/default") || text2.Contains("/storehome") || text2.Contains("/storelist") || text2.Contains("/storeproductdetails") || text2.Contains("/presaleproductdetails") || text2.Contains("countdownstoreproductsdetails")) && masterSettings.MeiQiaActivated == "1") { string empty = string.Empty; string empty2 = string.Empty; int productId = 0; string text3 = masterSettings.MeiQiaUnitid.ToNullString(); string text4 = string.Empty; string text5 = string.Empty; string empty3 = string.Empty; string text6 = string.Empty; string empty4 = string.Empty; string empty5 = string.Empty; string empty6 = string.Empty; string empty7 = string.Empty; string empty8 = string.Empty; string text7 = string.Empty; string text8 = string.Empty; string text9 = string.Empty; string text10 = string.Empty; string empty9 = string.Empty; string empty10 = string.Empty; string text11 = string.Empty; string text12 = string.Empty; string text13 = string.Empty; string text14 = string.Empty; string text15 = string.Empty; MemberInfo user = HiContext.Current.User; if (user != null) { text4 = user.RealName.ToNullString(); empty8 = text4; empty7 = user.UserName.ToNullString(); empty5 = ((user.Picture == null) ? "" : (masterSettings.SiteUrl + user.Picture)); text5 = ((user.Gender != Gender.Female) ? ((user.Gender != Gender.Male) ? "保密" : "男") : "女"); empty3 = user.BirthDate.ToNullString(); object obj; if (!user.BirthDate.HasValue) { obj = ""; } else { DateTime dateTime = DateTime.Now; int year = dateTime.Year; dateTime = user.BirthDate.Value; obj = (year - dateTime.Year).ToString(); } text6 = (string)obj; text7 = user.CellPhone.ToNullString(); text8 = user.Email.ToNullString(); text9 = RegionHelper.GetFullRegion(user.RegionId, "", true, 0) + user.Address; text10 = user.QQ.ToNullString(); text11 = user.WeChat.ToNullString(); text12 = user.Wangwang.ToNullString(); DateTime createDate = user.CreateDate; text13 = ((user.CreateDate < new DateTime(1000, 1, 1)) ? "" : user.CreateDate.ToNullString()); MemberGradeInfo memberGrade = MemberHelper.GetMemberGrade(user.GradeId); text14 = ((memberGrade == null) ? "" : memberGrade.Name.ToNullString()); } if (int.TryParse(this.Page.Request.QueryString["productId"], out productId)) { SiteSettings masterSettings2 = SettingsManager.GetMasterSettings(); ProductInfo productSimpleInfo = ProductBrowser.GetProductSimpleInfo(productId); if (productSimpleInfo != null && productSimpleInfo.SaleStatus != 0) { text15 = ",'商品名称': '{0}'\r\n ,'售价': '{1}'\r\n ,'市场价': '{2}'\r\n ,'品牌': '{3}'\r\n ,'商品编号': '{4}'\r\n ,'商品货号': '{5}'\r\n ,'浏览次数': '{6}'\r\n ,'重量': '{7}'\r\n ,'已经出售': '{8}'"; string empty11 = string.Empty; empty11 = ((!(productSimpleInfo.MinSalePrice == productSimpleInfo.MaxSalePrice)) ? (productSimpleInfo.MinSalePrice.F2ToString("f2") + " - " + productSimpleInfo.MaxSalePrice.F2ToString("f2")) : productSimpleInfo.MinSalePrice.F2ToString("f2")); string empty12 = string.Empty; empty12 = ((!(productSimpleInfo.Weight > decimal.Zero)) ? "无" : string.Format("{0} g", productSimpleInfo.Weight.F2ToString("f2"))); string obj2 = string.Empty; if (productSimpleInfo.BrandId.HasValue) { BrandCategoryInfo brandCategory = CatalogHelper.GetBrandCategory(productSimpleInfo.BrandId.Value); if (brandCategory != null) { obj2 = brandCategory.BrandName; } } text15 = string.Format(text15, productSimpleInfo.ProductName.ToNullString(), empty11, productSimpleInfo.MarketPrice.ToNullString(), obj2.ToNullString(), productSimpleInfo.ProductCode.ToNullString(), productSimpleInfo.SKU.ToNullString(), productSimpleInfo.VistiCounts.ToNullString(), empty12, productSimpleInfo.ShowSaleCounts.ToNullString()); } } empty = "<script type='text/javascript'>\r\n (function (m, ei, q, i, a, j, s) {\r\n m[a] = m[a] || function () {\r\n (m[a].a = m[a].a || []).push(arguments)\r\n };\r\n j = ei.createElement(q),\r\n s = ei.getElementsByTagName(q)[0];\r\n j.async = true;\r\n j.charset = 'UTF-8';\r\n j.src = i;\r\n s.parentNode.insertBefore(j, s)\r\n })(window, document, 'script', '//eco-api.meiqia.com/dist/meiqia.js', '_MEIQIA');\r\n _MEIQIA('entId', " + text3 + ");\r\n _MEIQIA('metadata', { \r\n address: '" + text9 + "', // 地址\r\n age: '" + text6 + "', // 年龄\r\n comment: '" + empty6 + "', // 备注\r\n email: '" + text8 + "', // 邮箱\r\n gender: '" + text5 + "', // 性别\r\n name: '" + text4 + "', // 名字\r\n qq: '" + text10 + "', // QQ\r\n tel: '" + text7 + "', // 电话\r\n weibo: '" + empty9 + "', // 微博\r\n weixin: '" + empty10 + "', // 微信 \r\n '会员等级': '" + text14 + "',\r\n 'MSN': '" + text11 + "',\r\n '旺旺': '" + text12 + "',\r\n '账号创建时间': '" + text13 + "' " + text15 + "\r\n });\r\n </script>"; writer.Write(empty); } writer.WriteLine(); }
protected void btnAgreeConfirm_Click(object sender, System.EventArgs e) { decimal num = 0m; decimal.TryParse(this.txtMoney.Text.Trim(), out num); int num2 = 0; int num3 = Globals.ToNum(this.hdProductID.Value); int returnsid = Globals.ToNum(this.hdReturnsId.Value); this.hdSkuID.Value.Trim(); if (num3 > 0) { RefundInfo orderReturnsByReturnsID = RefundHelper.GetOrderReturnsByReturnsID(returnsid); if (orderReturnsByReturnsID != null) { orderReturnsByReturnsID.AdminRemark = this.txtMemo.Text.Trim(); orderReturnsByReturnsID.HandleTime = System.DateTime.Now; orderReturnsByReturnsID.RefundTime = System.DateTime.Now.ToString(); orderReturnsByReturnsID.HandleStatus = RefundInfo.Handlestatus.Refunded; orderReturnsByReturnsID.Operator = Globals.GetCurrentManagerUserId().ToString(); if (num > 0m) { orderReturnsByReturnsID.RefundMoney = num; orderReturnsByReturnsID.RefundId = orderReturnsByReturnsID.ReturnsId; if (RefundHelper.UpdateByReturnsId(orderReturnsByReturnsID)) { OrderInfo orderInfo = OrderHelper.GetOrderInfo(orderReturnsByReturnsID.OrderId); string text = null; string stock = null; foreach (LineItemInfo current in orderInfo.LineItems.Values) { if ((!string.IsNullOrEmpty(orderReturnsByReturnsID.SkuId) && current.SkuId == orderReturnsByReturnsID.SkuId) || (current.ProductId == orderReturnsByReturnsID.ProductId && string.IsNullOrEmpty(current.SkuId))) { text = current.SkuId; stock = current.Quantity.ToString(); current.OrderItemsStatus = OrderStatus.Refunded; break; } } if (!RefundHelper.UpdateOrderGoodStatu(this.hdfOrderID.Value, text, 9, orderReturnsByReturnsID.OrderItemID)) { return; } RefundHelper.UpdateRefundOrderStock(stock, text); foreach (LineItemInfo current2 in orderInfo.LineItems.Values) { if (current2.OrderItemsStatus.ToString() == OrderStatus.Refunded.ToString() || current2.OrderItemsStatus.ToString() == OrderStatus.Returned.ToString()) { num2++; } } OrderHelper.UpdateOrderAmount(orderInfo); if (orderInfo.LineItems.Values.Count == num2) { this.CloseOrder(this.hdfOrderID.Value); } OrderHelper.UpdateCalculadtionCommission(this.hdfOrderID.Value); this.ShowMsgAndReUrl("同意退款成功!", true, "OrderDetails.aspx?OrderId=" + this.hdfOrderID.Value + "&t=" + System.DateTime.Now.ToString("HHmmss")); try { this.myNotifier.updateAction = UpdateAction.OrderUpdate; this.myNotifier.actionDesc = "同意退款成功"; this.myNotifier.RecDateUpdate = (orderInfo.PayDate.HasValue ? orderInfo.PayDate.Value : System.DateTime.Today); this.myNotifier.DataUpdated += new StatisticNotifier.DataUpdatedEventHandler(this.myEvent.Update); this.myNotifier.UpdateDB(); return; } catch (System.Exception ex) { Globals.Debuglog(ex.Message, "_Debuglog.txt"); return; } } this.ShowMsg("退款失败,请重试。", false); return; } this.ShowMsg("输入的金额格式不正确", false); return; } } else { this.ShowMsg("服务器错误,请刷新页面重试!", false); } }
protected override void AttachChildControls() { if (!int.TryParse(this.Page.Request.QueryString["helpId"], out this.helpId)) { base.GotoResourceNotFound(); } this.litHelpAddedDate = (FormatedTimeLabel)this.FindControl("litHelpAddedDate"); this.litHelpDescription = (Literal)this.FindControl("litHelpDescription"); this.litHelpContent = (Literal)this.FindControl("litHelpContent"); this.litHelpTitle = (Literal)this.FindControl("litHelpTitle"); this.lblFront = (Label)this.FindControl("lblFront"); this.lblNext = (Label)this.FindControl("lblNext"); this.lblFrontTitle = (Label)this.FindControl("lblFrontTitle"); this.lblNextTitle = (Label)this.FindControl("lblNextTitle"); this.aFront = (HtmlAnchor)this.FindControl("front"); this.aNext = (HtmlAnchor)this.FindControl("next"); if (!this.Page.IsPostBack) { HelpInfo help = CommentBrowser.GetHelp(this.helpId); if (help != null) { PageTitle.AddSiteNameTitle(help.Title, HiContext.Current.Context); if (!string.IsNullOrEmpty(help.MetaKeywords)) { MetaTags.AddMetaKeywords(help.MetaKeywords, HiContext.Current.Context); } if (!string.IsNullOrEmpty(help.MetaDescription)) { MetaTags.AddMetaDescription(help.MetaDescription, HiContext.Current.Context); } this.litHelpTitle.Text = help.Title; this.litHelpDescription.Text = help.Description; string str = HiContext.Current.HostPath + Globals.GetSiteUrls().UrlData.FormatUrl("HelpDetails", new object[] { this.helpId }); this.litHelpContent.Text = help.Content.Replace("href=\"#\"", "href=\"" + str + "\""); this.litHelpAddedDate.Time = help.AddedDate; HelpInfo info2 = CommentBrowser.GetFrontOrNextHelp(this.helpId, help.CategoryId, "Front"); if ((info2 != null) && (info2.HelpId > 0)) { if (this.lblFront != null) { this.lblFront.Visible = true; this.aFront.HRef = "HelpDetails.aspx?helpId=" + info2.HelpId; this.lblFrontTitle.Text = info2.Title; } } else if (this.lblFront != null) { this.lblFront.Visible = false; } HelpInfo info3 = CommentBrowser.GetFrontOrNextHelp(this.helpId, help.CategoryId, "Next"); if ((info3 != null) && (info3.HelpId > 0)) { if (this.lblNext != null) { this.lblNext.Visible = true; this.aNext.HRef = "HelpDetails.aspx?helpId=" + info3.HelpId; this.lblNextTitle.Text = info3.Title; } } else if (this.lblNext != null) { this.lblNext.Visible = false; } } } }
public EstablishFlowDigitized() { m_Editor = Globals.getEditor(ArcMap.Application); ConfigUtil.type = "gas"; }
protected override void OnClick() { ConfigUtil.type = "gas"; //string ISOvalveFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Valve_FeatureLayer", ""); //string ISOsourceFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Source_FeatureLayer", ""); //string ISOoperableFieldNameValves = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Valves", ""); //string ISOoperableFieldNameSources = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Sources", ""); //string[] ISOoperableValues = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Values", "").Split('|'); //double SnapTol = ConfigUtil.GetConfigValue("Trace_Click_Point_Tolerence", 5); //if (GeoNetTools.ToggleOperableStatus(ArcMap.Application, null, false, ISOvalveFeatureLayerName, ISOsourceFeatureLayerName, // ISOoperableFieldNameValves, ISOoperableFieldNameSources, // ISOoperableValues, SnapTol) != null) //{ // gnTools.TraceNetwork(GeometricNetworkToolsFunc.TraceType.SecondaryIsolation); //} //else //{ // // MessageBox.Show("Please select some valves to proceed"); //} string selectFeatures = ConfigUtil.GetConfigValue("Trace_Return_Selection", "false"); bool selectEdges; if (selectFeatures.ToUpper() == "true".ToUpper() && Control.ModifierKeys == Keys.Control) { selectEdges = false; } else if (selectFeatures.ToUpper() == "true".ToUpper()) { selectEdges = true; } else if (selectFeatures.ToUpper() == "false".ToUpper() && Control.ModifierKeys == Keys.Control) { selectEdges = true; } else { selectEdges = false; } bool traceIndeterminate = ConfigUtil.GetConfigValue("TraceFlow_Interminate", false); string ISOsourceFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Source_FeatureLayer", ""); string ISOvalveFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Valve_FeatureLayer", ""); string ISOoperableFieldNameValves = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Valves", ""); string ISOoperableFieldNameSources = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Sources", ""); string[] ISOoperableValues = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Values", "").Split('|'); string ISOvalveAddSQL = ConfigUtil.GetConfigValue("TraceIsolation_Valve_AddSQL", ""); double SnapTol = ConfigUtil.GetConfigValue("Trace_Click_Point_Tolerence", 5.0); string ClearFlagBeforeIso = ConfigUtil.GetConfigValue("TraceIsolation_ClearFlagsOnClick", "true"); string closedValveQuery = ConfigUtil.GetConfigValue("TraceIsolation_Valve_ClosedValveQuery", ""); if (GeoNetTools.ToggleOperableStatus(ArcMap.Application, null, false, ISOvalveFeatureLayerName, ISOsourceFeatureLayerName, ISOoperableFieldNameValves, ISOoperableFieldNameSources, ISOoperableValues, SnapTol) != null) { Globals.RemoveTraceGraphics(((IMxDocument)ArcMap.Application.Document).FocusMap, false); Globals.ClearSelected(ArcMap.Application, false); IPolyline mergedLines; List <int> procoids; bool addFlagBarScreen = ConfigUtil.GetConfigValue("TraceIsolation_AddResultsAsLayers", "false") == "false" ? false : true; string returnVal = GeoNetTools.TraceIsolation(null, null, ArcMap.Application, ISOsourceFeatureLayerName, ISOvalveFeatureLayerName, ISOoperableFieldNameValves, ISOoperableFieldNameSources, SnapTol, true, ISOoperableValues, ISOvalveAddSQL, traceIndeterminate, true, selectEdges, "", "", "", closedValveQuery, null, out mergedLines, out procoids, addFlagBarScreen); } else { // MessageBox.Show("Please select some valves to proceed"); } }
public TraceSummaryIsolation() { m_Editor = Globals.getEditor(ArcMap.Application); ConfigUtil.type = "gas"; }
public EstablishFlowAncillary() { m_Editor = Globals.getEditor(ArcMap.Application); ConfigUtil.type = "gas"; }
private void CboIconCollectionSelectedIndexChanged(object sender, EventArgs e) { string path = Globals.GetIconsPath(); path += cboIconCollection.Text; if (Directory.Exists(path)) { iconControl1.CellWidth = 32; iconControl1.CellHeight = 32; try { string[] files = Directory.GetFiles(path); foreach (string name in files) { string ext = Path.GetExtension(name); if (ext == ".png") //ext == ".bmp" || { Bitmap bmp = new Bitmap(name); if (bmp.Width <= 16 || bmp.Height <= 16) { // do nothing - use 32 } else if (bmp.Width < 48 && bmp.Height < 48) { iconControl1.CellWidth = bmp.Height < bmp.Width ? bmp.Height + 16 : bmp.Width + 16; iconControl1.CellHeight = iconControl1.CellWidth; } else { iconControl1.CellWidth = 48 + 16; iconControl1.CellHeight = iconControl1.CellWidth; } break; } } } catch {} } iconControl1.FilePath = path; //lblCopyright.Text = ""; //string filename = path + @"\copyright.txt"; //if (File.Exists(filename)) //{ // StreamReader reader = null; // try // { // reader = new StreamReader(filename); // lblCopyright.Text = reader.ReadLine(); // } // finally // { // if (reader != null) // reader.Close(); // } //} }
public ToggleOperableStatus() { m_Editor = Globals.getEditor(ArcMap.Application); ConfigUtil.type = "gas"; }
protected override void OnMouseDown(MouseEventArgs arg) { ConfigUtil.type = "gas"; string selectFeatures = ConfigUtil.GetConfigValue("Trace_Return_Selection", "false"); bool selectEdges; if (selectFeatures.ToUpper() == "true".ToUpper() && Control.ModifierKeys == Keys.Control) { selectEdges = false; } else if (selectFeatures.ToUpper() == "true".ToUpper()) { selectEdges = true; } else if (selectFeatures.ToUpper() == "false".ToUpper() && Control.ModifierKeys == Keys.Control) { selectEdges = true; } else { selectEdges = false; } bool traceIndeterminate = ConfigUtil.GetConfigValue("TraceFlow_Interminate", false); string ISOsourceFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Source_FeatureLayer", ""); string ISOvalveFeatureLayerName = ConfigUtil.GetConfigValue("TraceIsolation_Valve_FeatureLayer", ""); string ISOoperableFieldNameValves = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Valves", ""); string ISOoperableFieldNameSources = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Field_Sources", ""); string[] ISOoperableValues = ConfigUtil.GetConfigValue("TraceIsolation_Operable_Values", "").Split('|'); string ISOvalveAddSQL = ConfigUtil.GetConfigValue("TraceIsolation_Valve_AddSQL", ""); double SnapTol = ConfigUtil.GetConfigValue("Trace_Click_Point_Tolerence", 5.0); string ClearFlagBeforeIso = ConfigUtil.GetConfigValue("TraceIsolation_ClearFlagsOnClick", "true"); string closedValveQuery = ConfigUtil.GetConfigValue("TraceIsolation_Valve_ClosedValveQuery", ""); Globals.RemoveTraceGraphics(((IMxDocument)ArcMap.Application.Document).FocusMap, false); Globals.ClearSelected(ArcMap.Application, false); if (ClearFlagBeforeIso.ToUpper() == "TRUE") { Globals.ClearGNFlags(ArcMap.Application, Globals.GNTypes.Flags); } IPolyline mergedLines = new PolylineClass(); List <int> procoids = new List <int>(); IPoint point = ArcMap.Document.CurrentLocation; bool addFlagBarScreen = ConfigUtil.GetConfigValue("TraceIsolation_AddResultsAsLayers", "false") == "false" ? false : true; string returnVal = GeoNetTools.TraceIsolation(new double[] { point.X }, new double[] { point.Y }, ArcMap.Application, ISOsourceFeatureLayerName, ISOvalveFeatureLayerName, ISOoperableFieldNameValves, ISOoperableFieldNameSources, SnapTol, true, ISOoperableValues, ISOvalveAddSQL, traceIndeterminate, true, selectEdges, "", "", "", closedValveQuery, null, out mergedLines, out procoids, addFlagBarScreen); if (returnVal != null) { string[] retVals = returnVal.Split('_'); switch (retVals.Length) { case 1: break; case 2: MessageBox.Show(retVals[1]); break; case 3: break; default: break; } } point = null; }
public void StopServer(Player player, string message) { Globals.StopServer(message); }
public HttpResponseMessage Notifications(int afterNotificationId, int numberOfRecords) { try { var portalId = PortalController.GetEffectivePortalId(UserController.Instance.GetCurrentUserInfo().PortalID); var notificationsDomainModel = NotificationsController.Instance.GetNotifications(UserInfo.UserID, portalId, afterNotificationId, numberOfRecords); var notificationsViewModel = new NotificationsViewModel { TotalNotifications = NotificationsController.Instance.CountNotifications(UserInfo.UserID, portalId), Notifications = new List <NotificationViewModel>(notificationsDomainModel.Count) }; foreach (var notification in notificationsDomainModel) { var user = UserController.Instance.GetUser(PortalSettings.PortalId, notification.SenderUserID); var displayName = (user != null ? user.DisplayName : ""); var notificationViewModel = new NotificationViewModel { NotificationId = notification.NotificationID, Subject = notification.Subject, From = notification.From, Body = notification.Body, DisplayDate = Common.Utilities.DateUtils.CalculateDateForDisplay(notification.CreatedOnDate), SenderAvatar = UserController.Instance.GetUserProfilePictureUrl(notification.SenderUserID, 64, 64), SenderProfileUrl = Globals.UserProfileURL(notification.SenderUserID), SenderDisplayName = displayName, Actions = new List <NotificationActionViewModel>() }; var notificationType = NotificationsController.Instance.GetNotificationType(notification.NotificationTypeID); var notificationTypeActions = NotificationsController.Instance.GetNotificationTypeActions(notification.NotificationTypeID); foreach (var notificationTypeAction in notificationTypeActions) { var notificationActionViewModel = new NotificationActionViewModel { Name = LocalizeActionString(notificationTypeAction.NameResourceKey, notificationType.DesktopModuleId), Description = LocalizeActionString(notificationTypeAction.DescriptionResourceKey, notificationType.DesktopModuleId), Confirm = LocalizeActionString(notificationTypeAction.ConfirmResourceKey, notificationType.DesktopModuleId), APICall = notificationTypeAction.APICall }; notificationViewModel.Actions.Add(notificationActionViewModel); } if (notification.IncludeDismissAction) { notificationViewModel.Actions.Add(new NotificationActionViewModel { Name = Localization.GetString("Dismiss.Text"), Description = Localization.GetString("DismissNotification.Text"), Confirm = "", APICall = "API/InternalServices/NotificationsService/Dismiss" }); } notificationsViewModel.Notifications.Add(notificationViewModel); } return(Request.CreateResponse(HttpStatusCode.OK, notificationsViewModel)); } catch (Exception exc) { Logger.Error(exc); return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc)); } }