public PlanTaskDto ToDto() { var result = new PlanTaskDto() { Title = Title, CompleteDate = CompleteDate.ToLocalTime(), CreatedDate = CreatedDate.ToLocalTime(), Creator = Creator.ToDto(), Deadline = Deadline.ToLocalTime(), Description = Description, Id = Id, IsTask = IsTask, SelectedForToday = SelectedForToday, Status = this.Status, RemindAt = RemindAt.ToLocalTime(), ReminderSent = ReminderSent, PlannedBeginDate = PlannedBeginDate.ToLocalTime(), AccessRights = (AccessRights == null ? new List <ACLEntryDto>() : AccessRights.Select(x => x.ToDto())).ToList(), IsShared = IsShared, PlannedDateProcessed = PlannedDateProcessed }; if (Parent != null) { result.ParentTaskId = Parent.Id; result.Parent = Parent.ToDto(); } return(result); }
public IEnumerable <ValidationResult> Validate(ValidationContext validationContext) { if (!CompleteDate.IsCompleted) { yield return(new ValidationResult(FinancialGuaranteeAssessmentResources.CompleteDateRequired, new[] { "CompleteDate.Day" })); } if (CompleteDate.AsDateTime() > SystemTime.UtcNow) { yield return(new ValidationResult(FinancialGuaranteeAssessmentResources.CompleteDateNotInFuture, new[] { "CompleteDate.Day" })); } if (CompleteDate.AsDateTime() < ReceivedDate) { yield return(new ValidationResult(FinancialGuaranteeAssessmentResources.CompleteDateNotBeforeReceivedDate, new[] { "CompleteDate.Day" })); } }
public string GetProcedureMapInfo() { return("{" + CompleteDate.ToString("yyyy-MM-dd") + "," + ProcedureName + "," + EmployeeID + "," + Price + "," + Remark + "}"); }
public string UndateSQL() { String sql = "update workorder set productorder = '{0}',type = '{1}',scheduledate='{2}',lenth={3},width = {4}," + "thickness={5},gross={6},done={7},undone={8},completedate='{9}',machinecode='{10}',worker='{11}'," + "worth={12},remark='{13}',status={14} ,receivedate = '{15}',grosswidth = {16} where id = {17} "; return(String.Format(sql, ProductOrder, Type, ScheduleDate.ToString("yyyy-MM-dd"), Length.ToString(), Width.ToString(), Thickness.ToString(), Gross.ToString(), Done.ToString(), Undo.ToString(), CompleteDate.ToString("yyyy-MM-dd"), MachineCode, Worker, Worth.ToString(), Remark, Status.ToString(), ReceiveDate.ToString("yyyy-MM-dd HH:mm:ss"), GrossWidth.ToString(), id.ToString())); }
public string InsertSQL() { String sql = "insert into workorder (productorder,type,scheduledate,lenth,width," + "thickness,gross,done,undone,completedate,machinecode,worker,worth,remark,status,receivedate,grosswidth) " + "values ('{0}','{1}','{2}',{3},{4},{5},{6},{7},{8},'{9}','{10}','{11}',{12},'{13}',{14},'{15}',{16})"; return(String.Format(sql, ProductOrder, Type, ScheduleDate.ToString("yyyy-MM-dd"), Length.ToString(), Width.ToString(), Thickness.ToString(), Gross.ToString(), Done.ToString(), Undo.ToString(), CompleteDate.ToString("yyyy-MM-dd"), MachineCode, Worker, Worth.ToString(), Remark, Status.ToString(), ReceiveDate.ToString("yyyy-MM-dd HH:mm:ss"), GrossWidth.ToString())); }