/// <summary> /// 根据反馈单VGUID获取反馈单明细信息 /// </summary> /// <param name="vguid"></param> /// <returns></returns> public Business_RideCheckFeedback_Item GetRideCheckFeedbackInfo(Guid vguid) { Business_RideCheckFeedback_Item rideCheckFeedback = new Business_RideCheckFeedback_Item(); using (SqlSugarClient _dbMsSql = SugarDao_MsSql.GetInstance()) { rideCheckFeedback = _dbMsSql.Queryable <Business_RideCheckFeedback_Item>().Where(i => i.RideCheckFeedbackVGUID == vguid).SingleOrDefault(); //rideCheckFeedback.Attachments = _dbMsSql.Queryable<Business_RideCheckFeedback_Attachment>().Where(c => c.RideCheckFeedbackVGUID == vguid).ToList(); } return(rideCheckFeedback); }
public bool SaveBusiness_RideCheckFeedbackItem(string user, Guid rideCheckFeedbackVguid, int feedbackNumber, string answer1, string answer2, string answer3, string answer4, string answer5, string answer6, string answer7) { Business_RideCheckFeedback_Item item = new Business_RideCheckFeedback_Item(); using (SqlSugarClient _dbMsSql = SugarDao_MsSql.GetInstance()) { item = _dbMsSql.Queryable <Business_RideCheckFeedback_Item>().Where(c => c.RideCheckFeedbackVGUID == rideCheckFeedbackVguid && c.FeedbackNumber == feedbackNumber).FirstOrDefault(); if (item == null) { item = new Business_RideCheckFeedback_Item(); item.VGUID = Guid.NewGuid(); item.RideCheckFeedbackVGUID = rideCheckFeedbackVguid; item.ChangeUser = item.CreateUser = user; item.ChangeDate = item.CreateDate = DateTime.Now; item.FeedbackNumber = feedbackNumber; item.FeedbackAnswer1 = answer1; item.FeedbackAnswer2 = answer2; item.FeedbackAnswer3 = answer3; item.FeedbackAnswer4 = answer4; item.FeedbackAnswer5 = answer5; item.FeedbackAnswer6 = answer6; item.FeedbackAnswer7 = answer7; _dbMsSql.Insert(item); } else { item.FeedbackAnswer1 = answer1; item.FeedbackAnswer2 = answer2; item.FeedbackAnswer3 = answer3; item.FeedbackAnswer4 = answer4; item.FeedbackAnswer5 = answer5; item.FeedbackAnswer6 = answer6; item.FeedbackAnswer7 = answer7; _dbMsSql.Update(item); } } return(true); }