We help IT Professionals succeed at work.
Get Started

C#: Identifier Expected

Software Engineer
on
81 Views
1 Endorsement
Last Modified: 2019-11-26
Hi:

I'm getting "Identifier expected" on lines 37, 38, 39, and 45 of the code below.

I have attached a screenshot to show where these lines are at.

How do I get rid of this error?

Thanks!

John

string dt ="1/1/1900";
if (po.val_Required_Date ==po.val_PO_Date)
{
Console.WriteLine(dt.ToString());
dt = po.val_Required_Date.ToString();
}
//return"";

//PO PreSave for header fields//

if (po.val_Required_Date == Genframe4.Utils.DateTimeExtensions.MinValue)
{
	e.Cancel = true;
	return "Required Date is a required field.";
}
//return String.Empty;

//PO PreSave for line item fields//

//foreach (SalesPad.Bus.PurchaseLineItem pli in po.LineItems)
//{
//if (pli.IsChanged)
//{
//	pli.val_Required_Date = Genframe4.Utils.DateTimeExtensions.MinValue;
//	pli.val_Promised_Ship_Date = Genframe4.Utils.DateTimeExtensions.MinValue;
//	pli.val_Promised_Date = Genframe4.Utils.DateTimeExtensions.MinValue;
//}}

//return "";

foreach (SalesPad.Bus.PurchaseLineItem pli in po.LineItems)
{
if (pli ["xFinal_Site"] == "" )
{
          e.Cancel = true;
          return "Final Site is a required field.";
}
}

//return String.Empty;

foreach (SalesPad.Bus.PurchaseLineItem pli in po.LineItems)
{
if (pli.IsChanged)
{
	pli.["xRequiredDate"] = Genframe4.Utils.DateTimeExtensions.MinValue;
	pli.["xNewPromisedDate"] = Genframe4.Utils.DateTimeExtensions.MinValue;
	pli.["xPromisedDate"] = Genframe4.Utils.DateTimeExtensions.MinValue;
}}
//return "";

foreach (SalesPad.Bus.PurchaseLineItem pli in po.LineItems)
{
if (pli.["xRequiredDate"] == Genframe4.Utils.DateTimeExtensions.MinValue)
{
	e.Cancel = true;
	return "Required Date is a required field.";
}
}
return String.Empty;

/*
if (sd.IsNew &&  sd.val_Sales_Doc_ID.ToString() == "STDORD")
{
	DateTime dt = DateTime.Now;
dt = dt.AddDays(3);
Console.WriteLine(dt.ToString());	
sd.val_Req_Ship_Date =dt;	
foreach (SalesPad.Bus.SalesLineItem sli in sd.LineItems)
{
sli.val_Req_Ship_Date =dt;
}
*/

Open in new window

Identifier expected
Comment
Watch Question
Senior Developer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant

An Experts Exchange subscription includes unlimited access to online courses.

Get Started
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE