동일한 코드가 1 개의 proj에서 작동하고 다른 하나에서는 작동하지 않습니다. 이것을 쓰는 다른 방법. 오류 CS1729 오류가 발생했습니다 : '평가'에 12 개의 인수를 사용하는 생성자가 없습니다. diff 패키지에 복사 할 때도 컴파일되고 잘 작동합니다. 임시 asp.net 파일을 정리하려고했지만 도움이되지 않습니다.오류 cs1729에 생성자가 없습니다.
public class Assessment
{
public Assessment(Guid assessmentId,string applicationId,string assessmentType, Guid requestedBy,DateTime requestedDate,Guid assessmentOwner,string applicationToTest,
bool isCompleted,DateTime dateScheduled,DateTime datePerformed, GuidperformedBy, string uri)
{
this.AssessmentId = assessmentId; this.ApplicationId = applicationId;
this.AssessmentType = assessmentType; this.RequestedBy = requestedBy;
this.RequestedDate = requestedDate; this.AssessmentOwner = assessmentOwner;
this.ApplicationToTest = applicationToTest; this.IsCompleted = isCompleted;
this.DateScheduled = dateScheduled; this.DatePerformed = datePerformed;
this.PerformedBy = performedBy; this.uri = uri;
}
public Assessment()
{
this.AssessmentId = Guid.NewGuid(); this.ApplicationId = string.Empty;
this.AssessmentType = string.Empty; this.RequestedBy = Guid.NewGuid();
this.RequestedDate = DateTime.Now; this.AssessmentOwner = Guid.NewGuid();
this.ApplicationToTest = string.Empty; this.IsCompleted = false;
this.DateScheduled = Convert.ToDateTime(DateScheduled);
this.DatePerformed = Convert.ToDateTime(DatePerformed);
this.PerformedBy = Guid.NewGuid(); this.uri = string.Empty;
}
public Guid AssessmentId { get; set; }
public string ApplicationId {get; set; }
public string AssessmentType {get; set; }
public Guid RequestedBy { get; set; }
public DateTime RequestedDate {get; set; }
public Guid AssessmentOwner {get; set; }
public string ApplicationToTest {get; set; }
public bool IsCompleted { get; set; }
public DateTime DateScheduled {get; set; }
public DateTime DatePerformed { get; set; }
public Guid PerformedBy { get; set; }
public string uri { get; set; }
}
aspx.cs
protected void bnSubmit_Click(object sender, EventArgs e)
{
Assessment asst = new Assessment(Guid.Parse(AssessmentId.Text),
txtApplicationID.Text,
DropDownList1.SelectedValue,
requestedBy,
DateTime.Now,
Guid.Parse(txtAssessmentOwnerEmail.Text),
ddlApplicationToTest.SelectedValue,
false,
CalendarExtender1.SelectedDate.GetValueOrDefault(),
CalendarExtender2.SelectedDate.GetValueOrDefault(),
Guid.Parse(txtPerfomedBy.Text),
txtUri.Text);
db.AddAssessment(asst);
}
누락 된'}'을 추가하고 무슨 일이 일어나는 지 봅니다. – Hogan
죄송합니다.}가 없습니다. 그 세트가 끝나면 닫힙니다. 나는 그것이 길어질 것 인 것에 따라 게시를 daint한다 – user2340141
코드는 멋지다. 그래서 당신의 대원을 다시 시작해라. – aef