Example #1
0
        public static void TestConvert()
        {
            var pivoter = TP(bp => RV2ToXY(V2V2F(PX(BPYRepo.T())(bp), PY(BPYRepo.P())(bp), BPYRepo.X()(bp))));
            var bpi     = new ParametricInfo(Vector2.left * 30, 4, 0, 3.5f);

            VecEq(pivoter(bpi), new V2RV2(3.5f, 0, 0, 4, -30).TrueLocation);
        }
 public void FieldVerifying(PX.Data.PXCache sender, PX.Data.PXFieldVerifyingEventArgs e)
 {
     if(e.NewValue == null || !((string) e.NewValue).StartsWith("MRU-"))
     { 
         throw new PXSetPropertyException("Serial Number must start with MRU-");
     }
 }
Example #3
0
	protected void grid_RowDataBound(object sender, PX.Web.UI.PXGridRowEventArgs e)
	{
		/*EmployeeClaimsApproval.EPExpenseClaimOwned item = e.Row.DataItem as EmployeeClaimsApproval.EPExpenseClaimOwned;
		if (item == null) return;
		if (item.Escalated == true)
			e.Row.Style.CssClass = "CssEscalated";*/
	}
Example #4
0
	protected void grid_RowDataBound(object sender, PX.Web.UI.PXGridRowEventArgs e)
	{
		EPApprovalProcess.EPOwned item = e.Row.DataItem as EPApprovalProcess.EPOwned;
		if (item == null) return;
		if (item.Escalated > 0)		
			e.Row.Style.CssClass = "CssEscalated";		
	}
Example #5
0
	public void uploadPanel_Upload(PX.Web.UI.UserControls.PXUploadFilePanel.PXFileUploadedEventArgs args)
	{
		PXAdapter adapter = new PXAdapter(this.ds.DataGraph.Views[ds.PrimaryView]);
		adapter.Parameters = new object[] { args.BinData, args.FileName };
		IEnumerator iterator = ds.DataGraph.Actions["ImportToDITA"].Press(adapter).GetEnumerator();
		while(iterator.MoveNext()) { }
	}
        public void ProduceThresholdImage()
        {
            HueLow  = (int)(tBar_HLo.Value);
            HueHigh = (int)tBar_HHi.Value;
            SatLow  = (int)tBar_SLo.Value;
            SatHigh = (int)tBar_SHi.Value;
            ValLow  = (int)tBar_VLo.Value;
            ValHigh = (int)tBar_VHi.Value;

            PX = (int)tBar_PX.Value;
            IX = (int)tBar_IX.Value;
            DX = (int)tBar_DX.Value;
            PY = (int)tBar_PY.Value;
            IY = (int)tBar_IY.Value;
            DY = (int)tBar_DY.Value;

            SetPointX = (int)tBar_SetPointX.Value;
            SetPointY = (int)tBar_SetPointY.Value;

            tbl_HueLow.Text    = HueLow.ToString();
            tbl_HueHigh.Text   = HueHigh.ToString();
            tbl_SatLow.Text    = SatLow.ToString();
            tbl_SatHigh.Text   = SatHigh.ToString();
            tbl_ValLow.Text    = ValLow.ToString();
            tbl_ValHigh.Text   = ValHigh.ToString();
            tbl_PX.Text        = PX.ToString();
            tbl_IX.Text        = IX.ToString();
            tbl_DX.Text        = DX.ToString();
            tbl_PY.Text        = PY.ToString();
            tbl_IY.Text        = IY.ToString();
            tbl_DY.Text        = DY.ToString();
            tbl_SetPointX.Text = SetPointX.ToString();
            tbl_SetPointY.Text = SetPointY.ToString();
        }
Example #7
0
        /// <summary>
        /// 将参数加入到案例文件
        /// </summary>
        public static void setParam(this XElement _xe, XElement ParamList)
        {
            if (ParamList == null)
            {
                return;
            }
            var Params = from ele in _xe.Descendants("ParamBinding")
                         select ele;

            var vParams = from ele in ParamList.Descendants("ParamBinding")
                          select ele;

            //获得定义的变量
            foreach (XElement PX in Params)//遍历ParamBinding
            {
                string TempValue = PX.Attribute("value").Value;
                foreach (var v in vParams)//遍历变量
                {
                    string name  = v.Attribute("name").Value;
                    string value = v.Attribute("value").Value;
                    TempValue = TempValue.Replace("{" + name + "}", value);//进行替换
                }
                PX.Attribute("value").Value = TempValue;
            }
        }
Example #8
0
	protected void gridVersions_RowDataBound(object sender, PX.Web.UI.PXGridRowEventArgs e)
	{
		//DummyProjRevision item = e.Row.DataItem as DummyProjRevision;
		//if (item == null) return;
		//if(item.ID == Guid.Empty)
		//    e.Row.Style.CssClass = "CssCurrent";
	}
Example #9
0
	protected void tlbMain_CallBack(object sender, PX.Web.UI.PXCallBackEventArgs e)
	{
		PX.SM.PortalMapMaint graph = ds.DataGraph as PX.SM.PortalMapMaint;
		graph.Persist();
		graph.Caches[typeof(PX.SM.PortalMap)].IsDirty = false;
		graph.Children.View.RequestRefresh();
	}
Example #10
0
 protected void ProjectStatusGrid_RowDataBound(object sender, PX.Web.UI.PXGridRowEventArgs e)
 {
     ProjectEntry.PMProjectBalanceRecord item = e.Row.DataItem as ProjectEntry.PMProjectBalanceRecord;
     if (item != null && item.RecordID < 0)
     {
         e.Row.Style.CssClass = "BoldText";
     }
 }
Example #11
0
        public double LOperator(MathFunction yx, double x)
        {
            MathFunction der2 = yx.Derivative(2),
                         der1 = yx.Derivative(1);

            return(der2.Calculate(x) + PX.Calculate(x) * der1.Calculate(x) +
                   QX.Calculate(x) * yx.Calculate(x));
        }
Example #12
0
        private void btnPhieuXuat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            frmPhieuXuat PX = null;

            if (PX == null || PX.IsDisposed)
            {
                PX = new frmPhieuXuat();
            }
            PX.ShowDialog();
        }
Example #13
0
	protected void grid_RowDataBoundApprovals(object sender, PX.Web.UI.PXGridRowEventArgs e)
	{
		/*PXResult record = e.Row.DataItem as PXResult;
		if (record == null) return;
		EPView viewInfo = (EPView)record[typeof(EPView)];
		bool isBold = viewInfo != null && (viewInfo.Status == null || viewInfo.Status == EPViewStatusAttribute.NOTVIEWED);
		EPExpenseClaim item = (EPExpenseClaim)record[typeof(EPExpenseClaim)];
		if (item..Length > 35)
			item.Subject = item.Subject.Substring(0, 35) + "...";
		if (isBold) e.Row.Style.CssClass = "BaseBold";*/
	}
Example #14
0
	protected void OnFileUploadFinished(PX.Web.UI.UserControls.PXUploadFilePanel.PXFileUploadedEventArgs e)
	{
		UpdateMaint graph = (UpdateMaint)this.ds.DataGraph;
		try
		{
			graph.OnPackageUploaded(e.FileName, e.Password, e.BinData);
		}
		catch (PXException ex)
		{
			this.ClientScript.RegisterClientScriptBlock(this.GetType(), "uploadErr", "window.uploadErr = \"Error during file upload: " + ex.MessageNoPrefix.Replace('"', '\'') + "\";", true);
		}
	}
Example #15
0
        public override string ToString()
        {
            string result = string.Format("Equation:\ny''[x] + {0} * y'[x] + {1} * y[x] = {2}\n",
                                          PX.ToString(), QX.ToString(), FX.ToString());

            result += string.Format("Range: [{0}, {1}]\n", Math.Round(Boundaries.Key, 2), Math.Round(Boundaries.Value, 2));

            result += string.Format("Conditions:\n{0} * y[{1}] + {2} * y'[{1}] = {3}\n",
                                    alpha0, a, alpha1, A);
            result += string.Format("{0} * y[{1}] + {2} * y'[{1}] = {3}\n",
                                    betta0, b, betta1, B);

            return(result);
        }
Example #16
0
	protected void grid_RowDataBound(object sender, PX.Web.UI.PXGridRowEventArgs e)
	{
		PXResult record = e.Row.DataItem as PXResult;
		if (record == null) return;

		EPView viewInfo = (EPView)record[typeof(EPView)];
		bool isBold = viewInfo != null && (viewInfo.Status == null || viewInfo.Status == EPViewStatusAttribute.NOTVIEWED);

		EPActivity item = (EPActivity)record[typeof(EPActivity)];

		if (isBold) e.Row.Style.CssClass = "BaseBold";
		if (item.CategoryID != null && coloredCategories.Contains(item.CategoryID ?? 0))
		{
			if (item.IsOverdue == true)
				e.Row.Style.CssClass = (isBold ? "CssBoldOver" : "CssOver") + item.CategoryID;
			else
				e.Row.Style.CssClass = (isBold ? "CssBold" : "Css") + item.CategoryID;
		}
		else
		{
			if (item.IsOverdue == true)
				e.Row.Style.CssClass = (isBold ? "CssOverdueBold" : "CssOverdue");
		}
	}
Example #17
0
	/// <summary>
	/// The grid and tree toolbar callback event handler.
	/// </summary>
	protected void tbCommand_CallBack(object sender, PX.Web.UI.PXCallBackEventArgs e)
	{
		var tree = sp1.FindControl("tree") as PXTreeView;
		var grid = sp1.FindControl("grid") as PXGrid;		

		PX.SM.FavoritesMaintenance fv = ds.DataGraph as PX.SM.FavoritesMaintenance;
		Guid selectedNode;
		if (PX.Common.GUID.TryParse(tree.SelectedValue, out selectedNode))
		{
			PXAdapter adapter = new PXAdapter(fv.Views[ds.PrimaryView]);
			adapter.SortColumns = null;
			adapter.Descendings = null;
			adapter.Parameters = new object[] { selectedNode, grid.DataValues["NodeID"] };
			adapter.Searches = null;
			adapter.Filters = null;
			adapter.StartRow = 0;
			adapter.MaximumRows = grid.PageSize;
			adapter.TotalRequired = true;
			switch (e.Command.Name)
			{
				case "left":
					foreach (object r in fv.RowLeft.Press(adapter)) { break; }
					break;
				case "right":
					foreach (object r in fv.RowRight.Press(adapter)) { break; }
					break;
				case "up":
					foreach (object r in fv.RowUp.Press(adapter)) { break; }
					break;
				case "down":
					foreach (object r in fv.RowDown.Press(adapter)) { break; }
					break;
			}
			e.Result = "1";
		}
	}
	void viewer_EmailSend(PX.Reports.Mail.GroupMessage message, IList<FileInfo> files)
	{
		try
		{
			object emailParams = _sendEmailParamsCtor.Invoke(new object[0]);
			_fromMethod.SetValue(emailParams, message.From, null);
			_toMethod.SetValue(emailParams, message.Addressee.To, null);
			_ccMethod.SetValue(emailParams, message.Addressee.Cc, null);
			_bccMethod.SetValue(emailParams, message.Addressee.Bcc, null);
			_subjectMethod.SetValue(emailParams, message.Content.Subject, null);
			_bodyMethod.SetValue(emailParams, message.Content.Body, null);
			_activitySourceMethod.SetValue(emailParams, message.Relationship.ActivitySource, null);
			_parentSourceMethod.SetValue(emailParams, message.Relationship.ParentSource, null);
			_templateIDMethod.SetValue(emailParams, message.TemplateID, null);
			/*_reportNameMethod.SetValue(emailParams, message.ReportName, null);
			_reportFormatMethod.SetValue(emailParams, message.ReportFormat, null);
			_reportDataMethod.SetValue(emailParams, message.ReportData, null);*/
			IList<FileInfo> attachments = (IList<FileInfo>)_attachmentsMethod.GetValue(emailParams, null);
			foreach (FileInfo file in files)
				attachments.Add(file);
			_sendEmailMethod.Invoke(null, new object[] { emailParams });
		}
		catch (TargetInvocationException ex)
		{
			if (ex.InnerException != null && ex.InnerException is PXPopupRedirectException)
				new PXDataSource.RedirectHelper(ds).TryRedirect((PXPopupRedirectException)ex.InnerException);
		}
	}
Example #19
0
		public static void UpdateSOInvoiceState(IBqlTable aDoc, PX.CCProcessing.CCTranType aLastOperation)
		{
			SOInvoiceEntry graph = PXGraph.CreateInstance<SOInvoiceEntry>();
			graph.UpdateDocState(aDoc as SOInvoice, aLastOperation);
		}
Example #20
0
        public virtual void UpdateDocState(SOInvoice doc, PX.CCProcessing.CCTranType lastOperation)
        {
            this.Document.Current = Document.Search<ARInvoice.refNbr>(doc.RefNbr, doc.DocType);

            bool needUpdate = CCPaymentEntry.UpdateCapturedState<SOInvoice>(doc, this.ccProcTran.Select());

            if (needUpdate)
            {
                //doc.PreAuthTranNumber = null;
                doc = this.SODocument.Update(doc);
                Document.Search<ARInvoice.refNbr>(doc.RefNbr, doc.DocType);
				if (doc.IsCCCaptured == true) 
				{
					foreach (CCProcTran tran in this.ccProcTran.Select()) 
					{
						if (String.IsNullOrEmpty(tran.RefNbr) || String.IsNullOrEmpty(tran.DocType)) 
						{
							tran.DocType = doc.DocType;
							tran.RefNbr = doc.RefNbr;
							this.ccProcTran.Update(tran);
						}
					}
				}
                this.Save.Press();
            }
        }
	private static void LoadParameters(object sender, PX.Reports.Controls.Report report, object passed)
	{
		var pars = passed as Dictionary<string, string>;

		if (pars != null)
			foreach (PX.Reports.ReportParameter p in report.Parameters)
			{
				string val;
				if (pars.TryGetValue(p.Name, out val))
				{
					p.Value = val;
					pars.Remove(p.Name);
				}
			}
		SoapNavigator nav = (SoapNavigator)((PXReportViewer)sender).GetNavigator();
		foreach (PX.Reports.ViewerField f in report.ViewerFields)
		{
			if (String.IsNullOrEmpty(f.Description) && !String.IsNullOrEmpty(f.Name))
			{
				string name = null;
				string alias = null;
				int idx = f.Name.IndexOf('.');
				if (idx <= 1)
				{
					if (report.Tables.Count > 1)
					{
						continue;
					}
					name = report.Tables[0].Name + "." + f.Name;
				}
				else
				{
					alias = f.Name.Substring(0, idx);
					foreach (PX.Reports.ReportRelation rel in report.Relations)
					{
						if (rel.ParentTable != null &&
							String.Compare(rel.ParentAlias, alias, StringComparison.OrdinalIgnoreCase) == 0)
						{
							name = rel.ParentTable.Name + "." + f.Name.Substring(idx + 1);
							break;
						}
						if (rel.ChildTable != null &&
							String.Compare(rel.ChildAlias, alias, StringComparison.OrdinalIgnoreCase) == 0)
						{
							name = rel.ChildTable.Name + "." + f.Name.Substring(idx + 1);
							break;
						}
					}
				}
				if (name != null)
				{
					name = nav.GetDisplayName(name) as string;
					if (name != null && alias != null)
					{
						idx = name.IndexOf('.');
						if (idx > 1)
						{
							name = alias + name.Substring(idx);
						}
					}
				}
				else
				{
					name = nav.GetDisplayName(f.Name) as string;
				}
				if (name != null)
				{
					f.Description = name;
				}
			}
		}
		if (pars != null && pars.Count > 0)
		{
			int DesignFilterCount = report.Filters.Count;
			if (DesignFilterCount > 0)
			{
				report.Filters[0].OpenBraces++;
				report.Filters[DesignFilterCount - 1].CloseBraces++;
				report.Filters[DesignFilterCount - 1].Operator = PX.Reports.FilterOperator.And;
			}
			int DynamicFilterCount = report.DynamicFilters.Count;
			if (DynamicFilterCount > 0)
			{
				report.DynamicFilters[0].OpenBraces++;
				report.DynamicFilters[DynamicFilterCount - 1].CloseBraces++;
				report.DynamicFilters[DynamicFilterCount - 1].Operator = PX.Reports.FilterOperator.And;
			}

			foreach (PX.Reports.ViewerField f in report.ViewerFields)
			{
				string val;
				if (!String.IsNullOrEmpty(f.Description) && pars.TryGetValue(f.Description, out val) || pars.TryGetValue(f.Name, out val))
				{
					PX.Reports.FilterExp exp = new PX.Reports.FilterExp(f.Name, PX.Reports.FilterCondition.Equal);
					exp.Value = val;
					report.DynamicFilters.Add(exp);
					pars.Remove(f.Description);
					pars.Remove(f.Name);
				}
			}

			int oldCount = report.DynamicFilters.Count - 1;
			for (int i = 0; oldCount < report.DynamicFilters.Count; i++)
			{
				bool skipDeactiv = false;
				oldCount = report.DynamicFilters.Count;
				foreach (PX.Reports.ViewerField f in report.ViewerFields)
				{
					string val;
					string fieldName = f.Name.StartsWith("Row") ? f.Name.Substring(3) : f.Name;

					StringBuilder sbName = new StringBuilder(fieldName);
					sbName.Append(Convert.ToString(i));
					StringBuilder sbDescr = new StringBuilder((f.Description == null) ? fieldName : f.Description);
					sbDescr.Append(Convert.ToString(i));

					#region deactivate some Filters
					//deactivate some Filters conditions that are passed in the session(or other).
					//Because new conditions will be added in DynamicFilters conditions.
					if (!skipDeactiv)
					{
						foreach (PX.Reports.FilterExp exp in report.Filters)
						{
							if (exp.DataField == fieldName)
							{
								if ((pars.TryGetValue(sbDescr.ToString(), out val) || pars.TryGetValue(sbName.ToString(), out val)) && (exp.Condition == PX.Reports.FilterCondition.Equal))
								{
									exp.Condition = PX.Reports.FilterCondition.IsNotNull;
									exp.Value = exp.Value2 = "";
								}
							}
						}
					}
					#endregion

					if (pars.TryGetValue(sbDescr.ToString(), out val) || pars.TryGetValue(sbName.ToString(), out val))
					{
						PX.Reports.FilterExp exp = new PX.Reports.FilterExp(f.Name, PX.Reports.FilterCondition.Equal);
						exp.Value = val;
						exp.Operator = PX.Reports.FilterOperator.And;
						report.DynamicFilters.Add(exp);
						pars.Remove(sbDescr.ToString());
						pars.Remove(sbName.ToString());
					}
				}
				skipDeactiv = true;
				if (oldCount < report.DynamicFilters.Count)
				{
					report.DynamicFilters[report.DynamicFilters.Count - 1].Operator = PX.Reports.FilterOperator.Or;
				}
			}

			if (DesignFilterCount > 0 && report.DynamicFilters.Count > DynamicFilterCount)
			{
				report.DynamicFilters[0].OpenBraces++;
				report.DynamicFilters[report.DynamicFilters.Count - 1].CloseBraces++;
			}
		}
		//find invalid parameters
		if (pars != null && pars.Count > 0)
		{
			string stpars = string.Empty;
			foreach (KeyValuePair<string, string> pair in pars)
			{
				if (!string.Equals(pair.Key, PXUrl.PopupParameter, StringComparison.OrdinalIgnoreCase)
					&& !string.Equals(pair.Key, PXUrl.PopupParameter, StringComparison.OrdinalIgnoreCase)
					&& !string.Equals(pair.Key, PXUrl.HideScriptParameter, StringComparison.OrdinalIgnoreCase)
					&& !string.Equals(pair.Key, PXUrl.TimeStamp, StringComparison.OrdinalIgnoreCase)
					&& !string.Equals(pair.Key, PX.Reports.Messages.Action, StringComparison.OrdinalIgnoreCase)
					&& !string.Equals(pair.Key, PX.Reports.Messages.Max, StringComparison.OrdinalIgnoreCase)
					&& !string.Equals(pair.Key, PX.Reports.Messages.Unum, StringComparison.OrdinalIgnoreCase)
					&& !string.Equals(pair.Key, _REPORTID_PARAM_KEY, StringComparison.OrdinalIgnoreCase))
				{
					stpars += pair.Key + ", ";
				}
			}
			if (!string.IsNullOrEmpty(stpars))
			{
				stpars = stpars.Trim();
				if (stpars.EndsWith(","))
					stpars = stpars.Substring(0, stpars.Length - 1);
			}
			if (!string.IsNullOrEmpty(stpars))
			{
				throw new PXException(string.Format(ErrorMessages.ReportDoesNotContainParameters, stpars));
			}
		}
	}
Example #22
0
        public string featuresToString()
        {
            String features = "";
            String SrcIP2   = "";
            String DestIP2  = "";
            String SrcMAC2  = "";
            String DestMAC2 = "";

            Utilities convertor = new Utilities();

            if (SrcMAC != null)
            {
                SrcMAC2 = convertor.convertMACtoString(SrcMAC);
            }

            if (DestMAC != null)
            {
                DestMAC2 = convertor.convertMACtoString(DestMAC);
            }
            //DestMAC[0].ToString() + "-" + DestMAC[1].ToString() + "-" + DestMAC[2].ToString() + "-" + DestMAC[3].ToString()+ "-" + DestMAC[4].ToString() + "-" + DestMAC[5].ToString();

            if (SrcIP != null)
            {
                SrcIP2 = convertor.convertIPtoString(SrcIP);
            }
            //SrcIP[0].ToString() + "." + SrcIP[1].ToString() + "." + SrcIP[2].ToString()+"." + SrcIP[3].ToString();

            if (DestIP != null)
            {
                DestIP2 = convertor.convertIPtoString(DestIP);
            }


            features += SrcMAC2 + "," + DestMAC2 + "," + SrcIP2 + "," + DestIP2 + "," + SrcPort.ToString() + "," + DestPort.ToString() + "," + Protocol.ToString() + "," + TBT.ToString() + "," + FPS.ToString() + "," +
                        APL.ToString() + "," + AB.ToString() + "," + BS.ToString() + "," + PS.ToString() + "," + DPL.ToString() + "," + PPS.ToString() + "," + PV.ToString() + "," + PX.ToString() + "," +
                        NNP.ToString() + "," + NSP.ToString() + "," + PSP.ToString() + "," + Duration.ToString() + "," + this.Type.ToString() + "," + IOPR + "," + AIT + "," + Reconnect;

            return(features);
        }
Example #23
0
	protected void UploadDialog_FileUploadFinished(object sender, PX.Web.UI.PXFileUploadEventArgs e)
	{
		//PX.Web.Customization.API.ApiImportGraph.Upload(e.UploadedFile.Name, e.UploadedFile.Comment, e.UploadedFile.BinData);
	}
Example #24
0
	protected void btnCalendarUpLoad_Click(PX.Web.UI.UserControls.PXUploadFilePanel.PXFileUploadedEventArgs e)
	{
		((EPEventEnq)ds.DataGraph).Import(e.BinData, e.FileExtension);
	}
Example #25
0
	public void uploadPanel_Upload(PX.Web.UI.UserControls.PXUploadFilePanel.PXFileUploadedEventArgs args)
	{
		ProjectMaintenance.OnUploadPackage(args.FileName, args.BinData);

	}
Example #26
0
	private void MoveRow(PX.SM.WikiPageMapMaintenance graph, bool moveDown)
	{
        var tree = sp1.FindControl("tree") as PXTreeView;
        var grid = sp1.FindControl("grid") as PXGrid;
		PXAdapter adapter = new PXAdapter(graph.Views[ds.PrimaryView]);
		adapter.SortColumns = null;
		adapter.Descendings = null;
		adapter.Parameters = new object[] { tree.SelectedValue, grid.DataValues["PageID"] };
		adapter.Searches = null;
		adapter.Filters = null;
		adapter.StartRow = 0;
		adapter.MaximumRows = grid.PageSize;
		adapter.TotalRequired = true;

		foreach (PX.SM.WikiPage map in graph.Children.Select(PX.Common.GUID.CreateGuid(tree.SelectedValue)))
		{
			if (map.PageID.Value == PX.Common.GUID.CreateGuid((string)grid.DataValues["PageID"]))
			{
				graph.Children.Current = map;
				break;
			}
		}

		if (moveDown)
			foreach (PX.SM.WikiPage item in graph.RowDown.Press(adapter)) { break; }
		else
			foreach (PX.SM.WikiPage item in graph.RowUp.Press(adapter)) { break; }
		graph.Children.Cache.IsDirty = false;
	}