public ActionResult GetProblemMarker(int pProblemID) { ProblemObject problemobj = new ProblemObject(); ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); ProblemEngine probEngine = new ProblemEngine(); string response = probEngine.GetProblemDetailsByIdJSON(Request.Cookies["sessionkey"].Value, pProblemID.ToString(), false); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); problemobj = (ProblemObject)Serializer.JSONStringToObject<ProblemObject>(responseObject.ResultObjectJSON); return PartialView("_ProblemMarkerDetail", problemobj.individualproblem); //ProblemListViewModel model = new ProblemListViewModel(); //model.ProblemID = 1; //model.Address1 = "15-c/shubham flats"; //model.Address2 = "citylight"; //model.City = "Ahmedabad"; //model.State = "Gujarat"; //model.Country = "India"; //model.Pincode = "666-0444-02"; //model.ProblemImageCount = 4; //model.ProblemVideoCount = 2; //model.ProblemTitle = "Washing Machine"; //model.ProblemImageName = "~/upload/problem-image/1.JPG"; //model.Description = "To troubleshoot your product, enter the model number in the search box below. After entering your model number, we’ll list the most common symptoms for your product. Once you select a symptom, we’ll identify the model-specific parts and/or conditions that are associated with that symptom."; //return PartialView("_ProblemMarkerDetail",model); }
/// <summary> /// Action for get detail of a Problem /// </summary> /// <param name="id">id of a problem for which detail needs to be get</param> /// <returns></returns> public ActionResult ProblemDetail(int id) { ViewBag.ActiveMenu = "LiMyProblems"; ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); ProblemEngine probEngine = new ProblemEngine(); ProblemObject problemobj = new ProblemObject(); string response = probEngine.GetProblemDetailsByIdJSON(Request.Cookies["sessionkey"].Value, id.ToString(), false); responseObject = (ResponseObjectForAnything)Serializer.JSONStringToObject<ResponseObjectForAnything>(response); if (responseObject.ResultCode == "SUCCESS" && !string.IsNullOrEmpty(responseObject.ResultObjectJSON)) problemobj = (ProblemObject)Serializer.JSONStringToObject<ProblemObject>(responseObject.ResultObjectJSON); else { Common.DTO.Alert alert = new Common.DTO.Alert(); alert.AlertType = Common.DTO.Alert.ALERTTYPE.Info; alert.Message = responseObject.ResultMessage; alert.MessageType = Common.DTO.Alert.ALERTMESSAGETYPE.OnlyText; } ViewBag.QuotesNextPageIndex = 2; ViewBag.QuotesPageSize = QuotesPageSize; return View(problemobj); //UserProblemDetailComplexViewModel model = new UserProblemDetailComplexViewModel(); //model.ProblemViewModel.ID = 1; //model.ProblemViewModel.UserID = 1; //model.ProblemViewModel.ProblemHeading = "Washing maching balancing Problem"; //model.ProblemViewModel.Description = "Washing machine won’t spin or agitate? Not draining, filling or leaks water? This video provides information on how a washing cloths. Washer not spinning or draining? This demonstrates how to test a three terminal switch on a washing machine. The lid switch not works."; //model.ProblemViewModel.CompanyRelated = true; //model.ProblemViewModel.CompanyID = 1; //model.ProblemViewModel.CompanyName = "ProbFox pvt Ltd."; //model.ProblemViewModel.CategoryID = 1; //model.ProblemViewModel.SubCategoryID = 3; //model.ProblemViewModel.CategoryName = "Electronics"; //model.ProblemViewModel.SubCategoryName = "Motor"; //model.ProblemViewModel.ProductID = 1; //model.ProblemViewModel.ProductName = "Washing Machine"; //model.ProblemViewModel.ModelNo = "Prob-Ind-2106"; //model.ProblemViewModel.ProductStatusID = 2; //model.ProblemViewModel.ProductStatusName = "In Warranty"; //model.ProblemViewModel.PurchaseMonth = "November"; //model.ProblemViewModel.PurchaseYear = "2015"; //model.ProblemViewModel.ResolutionNeededBy = DateTime.Now; //model.ProblemViewModel.CreatedDate = DateTime.Now; //model.ProblemViewModel.UpdatedDate = DateTime.Now; //model.ProblemLocationViewModel.ID = 1; //model.ProblemLocationViewModel.ProblemID = 1; //model.ProblemLocationViewModel.Address1 = "Shiv Shakti Nager"; //model.ProblemLocationViewModel.Address2 = "Adajan"; //model.ProblemLocationViewModel.Address3 = ""; //model.ProblemLocationViewModel.City = "Ahmedabad"; //model.ProblemLocationViewModel.StateID = 1; //model.ProblemLocationViewModel.StateName = "Gujarat"; //model.ProblemLocationViewModel.CountryID = 1; //model.ProblemLocationViewModel.CountryName = "India"; //model.ProblemLocationViewModel.Pincode = "395006"; //model.ProblemLocationViewModel.Latitude = 21.192786M; //model.ProblemLocationViewModel.Longitude = 72.799809M; //ProblemMediaViewModel problemMediaViewModel = null; //for (int i = 1; i < 5; i++) //{ // problemMediaViewModel = new ProblemMediaViewModel(); // problemMediaViewModel.ID = i; // problemMediaViewModel.ProblemID = 1; // problemMediaViewModel.IsImage = true; // problemMediaViewModel.MediaPath = ServerSettings.WebApplicationURL + "/upload/problem-image/" + i.ToString() + ".JPG"; // model.ProblemMediaViewModelList.Add(problemMediaViewModel); //} //for (int i = 5; i < 7; i++) //{ // problemMediaViewModel = new ProblemMediaViewModel(); // problemMediaViewModel.ID = i; // problemMediaViewModel.ProblemID = 1; // problemMediaViewModel.IsImage = false; // problemMediaViewModel.MediaPath = ServerSettings.WebApplicationURL + "/upload/video/robotic.mp4"; // model.ProblemMediaViewModelList.Add(problemMediaViewModel); //} //ProblemHashTagsViewModel problemHashTagsViewModel = null; //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 1; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "Washing machine"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 2; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "Electronic Items"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 3; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "elctronic"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 4; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "Motor Problem"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 5; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "Expert needed"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 6; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "videocon"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //problemHashTagsViewModel = new ProblemHashTagsViewModel(); //problemHashTagsViewModel.ID = 7; //problemHashTagsViewModel.ProblemID = 1; //problemHashTagsViewModel.Name = "videocon machine"; //model.ProblemHashTagsViewModelList.Add(problemHashTagsViewModel); //BidSummaryListViewModel bidSummaryListViewModel = null; //bidSummaryListViewModel = new BidSummaryListViewModel(); //bidSummaryListViewModel.ID = 1; //bidSummaryListViewModel.ProblemID = 1; //bidSummaryListViewModel.UserID = 1; //bidSummaryListViewModel.ProfileImagePath = ServerSettings.WebApplicationURL + "/upload/profilepic/CharlesProfilePicture1.jpg"; //bidSummaryListViewModel.FirstName = "Charles"; //bidSummaryListViewModel.LastName = "Brown"; //bidSummaryListViewModel.ResolutionDescription = "Having good experice of working with electronics"; //bidSummaryListViewModel.IsSelected = true; //bidSummaryListViewModel.IsRated = true; //bidSummaryListViewModel.UserRating = 4; //bidSummaryListViewModel.IsInvited = true; //bidSummaryListViewModel.CurrencyDisplayText = "Rs"; //bidSummaryListViewModel.Amount = 300M; //bidSummaryListViewModel.CreatedDate = DateTime.Now; //bidSummaryListViewModel.Distance = 33.36M; //bidSummaryListViewModel.QuickBloxUserID = "5815727"; //bidSummaryListViewModel.Latitude = 21.213443M; //bidSummaryListViewModel.Longitude = 72.796905M; //bidSummaryListViewModel.BidID = 6542; //model.AllBidSummaryListViewModel.Add(bidSummaryListViewModel); //model.InvitedBidSummaryListViewModel.Add(bidSummaryListViewModel); //model.SelectedBidSummaryListViewModel.Add(bidSummaryListViewModel); //bidSummaryListViewModel = new BidSummaryListViewModel(); //bidSummaryListViewModel.ID = 2; //bidSummaryListViewModel.ProblemID = 1; //bidSummaryListViewModel.UserID = 2; //bidSummaryListViewModel.ProfileImagePath = ServerSettings.WebApplicationURL + "/upload/profilepic/images.jpg"; //bidSummaryListViewModel.FirstName = "Brendon"; //bidSummaryListViewModel.LastName = "Taylor"; //bidSummaryListViewModel.ResolutionDescription = "Gradute from IIT Kanpur and passion is about electronic"; //bidSummaryListViewModel.IsSelected = true; //bidSummaryListViewModel.IsRated = true; //bidSummaryListViewModel.UserRating = 3; //bidSummaryListViewModel.IsInvited = false; //bidSummaryListViewModel.CurrencyDisplayText = "Rs"; //bidSummaryListViewModel.Amount = 500M; //bidSummaryListViewModel.CreatedDate = DateTime.Now; //bidSummaryListViewModel.Distance = 89.13M; //bidSummaryListViewModel.QuickBloxUserID = "5815727"; //bidSummaryListViewModel.Latitude = 12.971599M; //bidSummaryListViewModel.Longitude = 77.594563M; //bidSummaryListViewModel.BidID = 4850; //model.AllBidSummaryListViewModel.Add(bidSummaryListViewModel); //model.SelectedBidSummaryListViewModel.Add(bidSummaryListViewModel); //bidSummaryListViewModel = new BidSummaryListViewModel(); //bidSummaryListViewModel.ID = 3; //bidSummaryListViewModel.ProblemID = 1; //bidSummaryListViewModel.UserID = 3; //bidSummaryListViewModel.ProfileImagePath = ServerSettings.WebApplicationURL + "/upload/profilepic/enlarged-facebook-profile-picture.jpg"; //bidSummaryListViewModel.FirstName = "Jesica"; //bidSummaryListViewModel.LastName = "Martin"; //bidSummaryListViewModel.ResolutionDescription = "Having experience of working with Sharp Technology for 2 years"; //bidSummaryListViewModel.IsSelected = false; //bidSummaryListViewModel.IsRated = false; //bidSummaryListViewModel.UserRating = 0; //bidSummaryListViewModel.IsInvited = true; //bidSummaryListViewModel.CurrencyDisplayText = "Rs"; //bidSummaryListViewModel.Amount = 350M; //bidSummaryListViewModel.CreatedDate = DateTime.Now; //bidSummaryListViewModel.Distance = 63.36M; //bidSummaryListViewModel.QuickBloxUserID = "5815727"; //bidSummaryListViewModel.Latitude = 18.52043M; //bidSummaryListViewModel.Longitude = 73.856744M; //bidSummaryListViewModel.BidID = 7845; //model.AllBidSummaryListViewModel.Add(bidSummaryListViewModel); //model.InvitedBidSummaryListViewModel.Add(bidSummaryListViewModel); //bidSummaryListViewModel = new BidSummaryListViewModel(); //bidSummaryListViewModel.ID = 4; //bidSummaryListViewModel.ProblemID = 1; //bidSummaryListViewModel.UserID = 4; //bidSummaryListViewModel.ProfileImagePath = ServerSettings.WebApplicationURL + "/upload/profilepic/profile.jpg"; //bidSummaryListViewModel.FirstName = "Nathen"; //bidSummaryListViewModel.LastName = "Astle"; //bidSummaryListViewModel.ResolutionDescription = "Solve more then 2500 Problems"; //bidSummaryListViewModel.IsSelected = false; //bidSummaryListViewModel.IsRated = true; //bidSummaryListViewModel.UserRating = 4; //bidSummaryListViewModel.IsInvited = false; //bidSummaryListViewModel.CurrencyDisplayText = "Rs"; //bidSummaryListViewModel.Amount = 300M; //bidSummaryListViewModel.CreatedDate = DateTime.Now; //bidSummaryListViewModel.Distance = 33.36M; //bidSummaryListViewModel.QuickBloxUserID = "5815727"; //bidSummaryListViewModel.Latitude = 23.022505M; //bidSummaryListViewModel.Longitude = 72.571362M; //bidSummaryListViewModel.BidID = 2854; //model.AllBidSummaryListViewModel.Add(bidSummaryListViewModel); //ViewBag.QuotesNextPageIndex = 2; //ViewBag.QuotesPageSize = QuotesPageSize; //return View(model); }
/// <summary> /// This method gets the details for a particular /// problem. It contains all bid details and details /// of all users who bidded on that problem. /// </summary> /// <param name="sessionKey">string</param> /// <param name="problemId">int</param> /// <returns>ProblemObject</returns> public ResponseObjectForAnything GetProblemDetailById(string sessionKey, string problemId, bool ispaging) { ResponseObjectForAnything responseObject = new ResponseObjectForAnything(); ProblemObject problemdetailobject = new ProblemObject(); List<Problem> lstproblem = new List<Problem>(); AuthenticationEngine authEngine = new AuthenticationEngine(); List<User> lstuser = new List<User>(); List<ProblemHashTag> lstproblemhashtag = new List<ProblemHashTag>(); List<ProblemMedia> lstproblemmedia = new List<ProblemMedia>(); int count = 0; bool isValid = true; if (!string.IsNullOrEmpty(sessionKey)) { isValid = authEngine.IsValidSession(sessionKey); } if (isValid) { try { Database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("usp_GetProblemDetailByID"); db.AddInParameter(dbCommand, "@Sessionkey", DbType.String, sessionKey); if (!string.IsNullOrEmpty(problemId)) { db.AddInParameter(dbCommand, "@ProblemID", DbType.Int32, Int32.Parse(problemId)); } else { db.AddInParameter(dbCommand, "@ProblemID", DbType.Int32, null); } db.AddInParameter(dbCommand, "@IsPaging", DbType.Boolean, ispaging); DataSet dsProblemDetail = db.ExecuteDataSet(dbCommand); if (!ispaging) { if (dsProblemDetail.Tables.Count > 0) { DataTable tUser = dsProblemDetail.Tables[0]; foreach (DataRow tRow in tUser.Rows) { User user = new User(); if (tRow["UserID"] != DBNull.Value) { user.UserID = Int32.Parse(tRow["UserID"].ToString()); } if (tRow["EmailId"] != DBNull.Value) { user.EmailID = tRow["EmailId"].ToString(); } if (tRow["FirstName"] != DBNull.Value) { user.FirstName = tRow["FirstName"].ToString(); } if (tRow["LastName"] != DBNull.Value) { user.LastName = tRow["LastName"].ToString(); } if (tRow["ProfilePicPath"] != DBNull.Value) { user.ProfilePicPath = tRow["ProfilePicPath"].ToString(); } if (tRow["DisplayName"] != DBNull.Value) { user.DisplayName = tRow["DisplayName"].ToString(); } if (tRow["CountryCode"] != DBNull.Value) { user.CountryCode = tRow["CountryCode"].ToString(); } if (tRow["PhoneNumber"] != DBNull.Value) { user.PhoneNumber = tRow["PhoneNumber"].ToString(); } if (tRow["Address1"] != DBNull.Value) { user.Address1 = tRow["Address1"].ToString(); } if (tRow["Address2"] != DBNull.Value) { user.Address2 = tRow["Address2"].ToString(); } if (tRow["Address3"] != DBNull.Value) { user.Address3 = tRow["Address3"].ToString(); } if (tRow["City"] != DBNull.Value) { user.City = tRow["City"].ToString(); } if (tRow["StateID"] != DBNull.Value) { user.StateID = Int32.Parse(tRow["StateID"].ToString()); } if (tRow["CountryID"] != DBNull.Value) { user.CountryID = Int32.Parse(tRow["CountryID"].ToString()); } if (tRow["BriefDescription"] != DBNull.Value) { user.BriefDescription = tRow["BriefDescription"].ToString(); } if (tRow["QuickBloxUserName"] != DBNull.Value) { user.QuickBloxUserName = tRow["QuickBloxUserName"].ToString(); } if (tRow["QuickBloxPassword"] != DBNull.Value) { user.QuickBloxPassword = tRow["QuickBloxPassword"].ToString(); } if (tRow["ProfileCompleteness"] != DBNull.Value) { user.ProfileCompleteness = Int32.Parse(tRow["ProfileCompleteness"].ToString()); } lstuser.Add(user); } problemdetailobject.user = lstuser; } if (dsProblemDetail.Tables.Count > 1) { DataTable tProblem = dsProblemDetail.Tables[1]; Problem problem = new Problem(); foreach (DataRow dRow in tProblem.Rows) { if (dRow["ID"] != DBNull.Value) { problem.ID = Int32.Parse(dRow["ID"].ToString()); } if (dRow["UserID"] != DBNull.Value) { problem.UserID = Int32.Parse(dRow["UserID"].ToString()); } if (dRow["FirstName"] != DBNull.Value) { problem.FirstName = dRow["FirstName"].ToString(); } if (dRow["LastName"] != DBNull.Value) { problem.LastName = dRow["LastName"].ToString(); } if (dRow["DisplayName"] != DBNull.Value) { problem.DisplayName = dRow["DisplayName"].ToString(); } if (dRow["EmailID"] != DBNull.Value) { problem.EmailID = dRow["EmailID"].ToString(); } if (dRow["CompanyRelated"] != DBNull.Value) { problem.IsCompanyRelated = Convert.ToBoolean(dRow["CompanyRelated"].ToString()); } if (dRow["CompanyID"] != DBNull.Value) { problem.CompanyID = Int32.Parse(dRow["CompanyID"].ToString()); } if (dRow["CompanyName"] != DBNull.Value) { problem.CompanyName = dRow["CompanyName"].ToString(); } if (dRow["ProblemHeading"] != DBNull.Value) { problem.ProblemHeading = dRow["ProblemHeading"].ToString(); } if (dRow["CategoryID"] != DBNull.Value) { problem.CategoryID = Int32.Parse(dRow["CategoryID"].ToString()); } if (dRow["CategoryName"] != DBNull.Value) { problem.CategoryName = dRow["CategoryName"].ToString(); } if (dRow["SubCategoryID"] != DBNull.Value) { problem.SubCategoryID = Int32.Parse(dRow["SubCategoryID"].ToString()); } if (dRow["SubCategoryName"] != DBNull.Value) { problem.SubCategoryName = dRow["SubCategoryName"].ToString(); } if (dRow["ProductID"] != DBNull.Value) { problem.ProductID = Int32.Parse(dRow["ProductID"].ToString()); } if (dRow["ModelNo"] != DBNull.Value) { problem.ModelNo = dRow["ModelNo"].ToString(); } if (dRow["Description"] != DBNull.Value) { problem.Description = dRow["Description"].ToString(); } if (dRow["PurchaseMonth"] != DBNull.Value) { problem.PurchaseMonth = Int32.Parse(dRow["PurchaseMonth"].ToString()); } if (dRow["PurchaseYear"] != DBNull.Value) { problem.PurchaseYear = Int32.Parse(dRow["PurchaseYear"].ToString()); } if (dRow["ProductStatusID"] != DBNull.Value) { problem.ProductStatusID = Int32.Parse(dRow["ProductStatusID"].ToString()); } if (dRow["ProductStatusName"] != DBNull.Value) { problem.ProductStatusName = dRow["ProductStatusName"].ToString(); } if (dRow["ProblemStatusID"] != DBNull.Value) { problem.ProblemStatusID = Int32.Parse(dRow["ProblemStatusID"].ToString()); } if (dRow["ProblemStatusName"] != DBNull.Value) { problem.ProblemStatusName = dRow["ProblemStatusName"].ToString(); } if (dRow["ResolutionNeededBy"] != DBNull.Value) { problem.ResolutionNeededBy = Convert.ToDateTime(dRow["ResolutionNeededBy"].ToString()); } if (dRow["IsVirtual"] != DBNull.Value) { problem.IsVirtual = Convert.ToBoolean(dRow["IsVirtual"].ToString()); } if (dRow["IsRegisteredAddress"] != DBNull.Value) { problem.IsRegisteredAddress = Convert.ToBoolean(dRow["IsRegisteredAddress"].ToString()); } if (dRow["Address1"] != DBNull.Value) { problem.Address1 = dRow["Address1"].ToString(); } if (dRow["Address2"] != DBNull.Value) { problem.Address2 = dRow["Address2"].ToString(); } if (dRow["Address3"] != DBNull.Value) { problem.Address3 = dRow["Address3"].ToString(); } if (dRow["City"] != DBNull.Value) { problem.City = dRow["City"].ToString(); } if (dRow["StateID"] != DBNull.Value) { problem.StateID = Int32.Parse(dRow["StateID"].ToString()); } if (dRow["StateName"] != DBNull.Value) { problem.StateName = dRow["StateName"].ToString(); } if (dRow["CountryID"] != DBNull.Value) { problem.CountryID = Int32.Parse(dRow["CountryID"].ToString()); } if (dRow["CountryName"] != DBNull.Value) { problem.CountryName = dRow["CountryName"].ToString(); } if (dRow["PinCode"] != DBNull.Value) { problem.PinCode = dRow["PinCode"].ToString(); } if (dRow["Latitude"] != DBNull.Value) { problem.Latitude = Convert.ToDecimal(dRow["Latitude"].ToString()); } if (dRow["Longitude"] != DBNull.Value) { problem.Longitude = Convert.ToDecimal(dRow["Longitude"].ToString()); } if (dRow["Distance"] != DBNull.Value) { problem.Distance = Convert.ToDecimal(dRow["Distance"].ToString()); } if (dRow["ThumbnailMedia"] != DBNull.Value) { problem.ThumbnailMedia = dRow["ThumbnailMedia"].ToString(); } //lstproblem.Add(problem); } problemdetailobject.individualproblem = problem; } if (dsProblemDetail.Tables.Count > 2) { DataTable tProblemHashTag = dsProblemDetail.Tables[2]; List<ProblemHashTag> lstHashTag = new List<ProblemHashTag>(); foreach (DataRow dRow in tProblemHashTag.Rows) { ProblemHashTag problemhashtag = new ProblemHashTag(); if (dRow["ProblemID"] != DBNull.Value) { problemhashtag.ProblemID = Int32.Parse(dRow["ProblemID"].ToString()); } if (dRow["HashTagID"] != DBNull.Value) { problemhashtag.HashTagID = Int32.Parse(dRow["HashTagID"].ToString()); } if (dRow["Name"] != DBNull.Value) { problemhashtag.HashTag = dRow["Name"].ToString(); } lstHashTag.Add(problemhashtag); } problemdetailobject.problemhashtag = lstHashTag; } if (dsProblemDetail.Tables.Count > 3) { DataTable tProblemMedia = dsProblemDetail.Tables[3]; List<ProblemMedia> lstHashTag = new List<ProblemMedia>(); foreach (DataRow dRow in tProblemMedia.Rows) { ProblemMedia problemmedia = new ProblemMedia(); if (dRow["ProblemMediaID"] != DBNull.Value) { problemmedia.ProblemMediaID = Int32.Parse(dRow["ProblemMediaID"].ToString()); } if (dRow["ProblemID"] != DBNull.Value) { problemmedia.ProblemID = Int32.Parse(dRow["ProblemID"].ToString()); } if (dRow["IsImage"] != DBNull.Value) { problemmedia.IsImage = Convert.ToBoolean(dRow["IsImage"].ToString()); } if (dRow["MediaPath"] != DBNull.Value) { problemmedia.MediaPath = dRow["MediaPath"].ToString(); } lstHashTag.Add(problemmedia); } problemdetailobject.problemmedia = lstproblemmedia; } } if (!ispaging && dsProblemDetail.Tables.Count > 4 || ispaging && dsProblemDetail.Tables.Count > 0) { DataTable tProblemBids = dsProblemDetail.Tables[4]; List<ProblemBid> lstproblembid = new List<ProblemBid>(); foreach (DataRow dRow in tProblemBids.Rows) { ProblemBid bid = new ProblemBid(); if (dRow["BidId"] != DBNull.Value) { bid.BidID = Int32.Parse(dRow["BidId"].ToString()); } if (dRow["ProblemID"] != DBNull.Value) { bid.ProblemID = Int32.Parse(dRow["ProblemID"].ToString()); } if (dRow["UserID"] != DBNull.Value) { bid.UserID = Int32.Parse(dRow["UserID"].ToString()); } if (dRow["DisplayName"] != DBNull.Value) { bid.DisplayName = dRow["DisplayName"].ToString(); } if (dRow["ProfilePicPath"] != DBNull.Value) { bid.ProfileImagePath = dRow["ProfilePicPath"].ToString(); } if (dRow["BriefDescription"] != DBNull.Value) { bid.BriefDescription = dRow["BriefDescription"].ToString(); } if (dRow["QuickBloxUserName"] != DBNull.Value) { bid.QuickBloxUserID = dRow["QuickBloxUserName"].ToString(); } if (dRow["Longitude"] != DBNull.Value) { bid.Longitude = Convert.ToDecimal(dRow["Longitude"].ToString()); } if (dRow["Latitude"] != DBNull.Value) { bid.Latitude = Convert.ToDecimal(dRow["Latitude"].ToString()); } if (dRow["Distance"] != DBNull.Value) { bid.Distance = Convert.ToDecimal(dRow["Distance"].ToString()); } if (dRow["Description"] != DBNull.Value) { bid.ResolutionDescription = dRow["Description"].ToString(); } if (dRow["ResolutionMethodID"] != DBNull.Value) { bid.ResolutionMethodID = Int32.Parse(dRow["ResolutionMethodID"].ToString()); } if (dRow["ResolutionLink1"] != DBNull.Value) { bid.ResolutionLink1 = dRow["ResolutionLink1"].ToString(); } if (dRow["ResolutionLink2"] != DBNull.Value) { bid.ResolutionLink2 = dRow["ResolutionLink2"].ToString(); } if (dRow["CurrencyID"] != DBNull.Value) { bid.CurrencyID = Int32.Parse(dRow["CurrencyID"].ToString()); } if (dRow["CurrencyName"] != DBNull.Value) { bid.CurrencyName = dRow["CurrencyName"].ToString(); } if (dRow["CurrencyDisplayText"] != DBNull.Value) { bid.CurrencyDisplayText = dRow["CurrencyDisplayText"].ToString(); } if (dRow["Amount"] != DBNull.Value) { bid.Amount = Convert.ToDecimal(dRow["Amount"].ToString()); } if (dRow["CompanyID"] != DBNull.Value) { bid.CompanyID = Int32.Parse(dRow["CompanyID"].ToString()); } if (dRow["CompanyName"] != DBNull.Value) { bid.CompanyName = dRow["CompanyName"].ToString(); } if (dRow["UserID"] != DBNull.Value) { bid.UserID = Int32.Parse(dRow["UserID"].ToString()); } if (dRow["IsSelected"] != DBNull.Value) { bid.IsSelected = Convert.ToBoolean(dRow["IsSelected"].ToString()); } if (dRow["IsInvited"] != DBNull.Value) { bid.IsInvited = Convert.ToBoolean(dRow["IsInvited"].ToString()); } if (dRow["SubmittedDate"] != DBNull.Value) { bid.SubmittedDate = Convert.ToDateTime(dRow["SubmittedDate"].ToString()); } if (dRow["IsRated"] != DBNull.Value) { bid.IsRated = Convert.ToBoolean(dRow["IsRated"].ToString()); } if (dRow["UserRating"] != DBNull.Value) { bid.UserRating = Convert.ToDecimal(dRow["UserRating"].ToString()); } lstproblembid.Add(bid); count++; } problemdetailobject.problembid = lstproblembid; } if (!ispaging) { if (dsProblemDetail.Tables.Count > 5) { DataTable tResolutionMedia = dsProblemDetail.Tables[5]; List<ResolutionMedia> lstresolutionmedia = new List<ResolutionMedia>(); foreach (DataRow dRow in tResolutionMedia.Rows) { ResolutionMedia resmedia = new ResolutionMedia(); if (dRow["BidID"] != DBNull.Value) { resmedia.BidID = Int32.Parse(dRow["BidID"].ToString()); } if (dRow["IsImage"] != DBNull.Value) { resmedia.IsImage = Convert.ToBoolean(dRow["IsImage"].ToString()); } if (dRow["ResolutionMediaPath"] != DBNull.Value) { resmedia.MediaPath = dRow["ResolutionMediaPath"].ToString(); } lstresolutionmedia.Add(resmedia); } problemdetailobject.resolutionmedia = lstresolutionmedia; } if (dsProblemDetail.Tables.Count > 6) { DataTable tResolutionProposedTime = dsProblemDetail.Tables[6]; List<ResolutionProposedTime> lstresproposedtime = new List<ResolutionProposedTime>(); foreach (DataRow dRow in tResolutionProposedTime.Rows) { ResolutionProposedTime proposedtime = new ResolutionProposedTime(); if (dRow["ID"] != DBNull.Value) { proposedtime.ID = Int32.Parse(dRow["ID"].ToString()); } if (dRow["BidID"] != DBNull.Value) { proposedtime.BidID = Int32.Parse(dRow["BidID"].ToString()); } if (dRow["IsSelected"] != DBNull.Value) { proposedtime.IsSelected = Convert.ToBoolean(dRow["IsSelected"].ToString()); } if (dRow["ResolutionProposedTime"] != DBNull.Value) { proposedtime.ProposedTime = Convert.ToDateTime(dRow["ResolutionProposedTime"].ToString()); } lstresproposedtime.Add(proposedtime); } problemdetailobject.proposedtime = lstresproposedtime; } if (!ispaging && dsProblemDetail.Tables.Count > 7 || ispaging && dsProblemDetail.Tables.Count > 0) { DataTable tProblemBids = dsProblemDetail.Tables[7]; List<ProblemBid> lstproblembid = new List<ProblemBid>(); foreach (DataRow dRow in tProblemBids.Rows) { ProblemBid bid = new ProblemBid(); if (dRow["BidId"] != DBNull.Value) { bid.BidID = Int32.Parse(dRow["BidId"].ToString()); } if (dRow["ProblemID"] != DBNull.Value) { bid.ProblemID = Int32.Parse(dRow["ProblemID"].ToString()); } if (dRow["UserID"] != DBNull.Value) { bid.UserID = Int32.Parse(dRow["UserID"].ToString()); } if (dRow["DisplayName"] != DBNull.Value) { bid.DisplayName = dRow["DisplayName"].ToString(); } if (dRow["ProfilePicPath"] != DBNull.Value) { bid.ProfileImagePath = dRow["ProfilePicPath"].ToString(); } if (dRow["BriefDescription"] != DBNull.Value) { bid.BriefDescription = dRow["BriefDescription"].ToString(); } if (dRow["QuickBloxUserName"] != DBNull.Value) { bid.QuickBloxUserID = dRow["QuickBloxUserName"].ToString(); } if (dRow["Longitude"] != DBNull.Value) { bid.Longitude = Convert.ToDecimal(dRow["Longitude"].ToString()); } if (dRow["Latitude"] != DBNull.Value) { bid.Latitude = Convert.ToDecimal(dRow["Latitude"].ToString()); } if (dRow["Distance"] != DBNull.Value) { bid.Distance = Convert.ToDecimal(dRow["Distance"].ToString()); } if (dRow["Description"] != DBNull.Value) { bid.ResolutionDescription = dRow["Description"].ToString(); } if (dRow["ResolutionMethodID"] != DBNull.Value) { bid.ResolutionMethodID = Int32.Parse(dRow["ResolutionMethodID"].ToString()); } if (dRow["ResolutionLink1"] != DBNull.Value) { bid.ResolutionLink1 = dRow["ResolutionLink1"].ToString(); } if (dRow["ResolutionLink2"] != DBNull.Value) { bid.ResolutionLink2 = dRow["ResolutionLink2"].ToString(); } if (dRow["CurrencyID"] != DBNull.Value) { bid.CurrencyID = Int32.Parse(dRow["CurrencyID"].ToString()); } if (dRow["CurrencyName"] != DBNull.Value) { bid.CurrencyName = dRow["CurrencyName"].ToString(); } if (dRow["CurrencyDisplayText"] != DBNull.Value) { bid.CurrencyDisplayText = dRow["CurrencyDisplayText"].ToString(); } if (dRow["Amount"] != DBNull.Value) { bid.Amount = Convert.ToDecimal(dRow["Amount"].ToString()); } if (dRow["CompanyID"] != DBNull.Value) { bid.CompanyID = Int32.Parse(dRow["CompanyID"].ToString()); } if (dRow["CompanyName"] != DBNull.Value) { bid.CompanyName = dRow["CompanyName"].ToString(); } if (dRow["IsSelected"] != DBNull.Value) { bid.IsSelected = Convert.ToBoolean(dRow["IsSelected"].ToString()); } if (dRow["IsInvited"] != DBNull.Value) { bid.IsInvited = Convert.ToBoolean(dRow["IsInvited"].ToString()); } if (dRow["SubmittedDate"] != DBNull.Value) { bid.SubmittedDate = Convert.ToDateTime(dRow["SubmittedDate"].ToString()); } if (dRow["IsRated"] != DBNull.Value) { bid.IsRated = Convert.ToBoolean(dRow["IsRated"].ToString()); } if (dRow["UserRating"] != DBNull.Value) { bid.UserRating = Convert.ToDecimal(dRow["UserRating"].ToString()); } lstproblembid.Add(bid); count++; } problemdetailobject.invitedproblembid = lstproblembid; } if (!ispaging && dsProblemDetail.Tables.Count > 8 || ispaging && dsProblemDetail.Tables.Count > 0) { DataTable tProblemBids = dsProblemDetail.Tables[8]; List<ProblemBid> lstproblembid = new List<ProblemBid>(); foreach (DataRow dRow in tProblemBids.Rows) { ProblemBid bid = new ProblemBid(); if (dRow["BidId"] != DBNull.Value) { bid.BidID = Int32.Parse(dRow["BidId"].ToString()); } if (dRow["ProblemID"] != DBNull.Value) { bid.ProblemID = Int32.Parse(dRow["ProblemID"].ToString()); } if (dRow["UserID"] != DBNull.Value) { bid.UserID = Int32.Parse(dRow["UserID"].ToString()); } if (dRow["DisplayName"] != DBNull.Value) { bid.DisplayName = dRow["DisplayName"].ToString(); } if (dRow["ProfilePicPath"] != DBNull.Value) { bid.ProfileImagePath = dRow["ProfilePicPath"].ToString(); } if (dRow["BriefDescription"] != DBNull.Value) { bid.BriefDescription = dRow["BriefDescription"].ToString(); } if (dRow["QuickBloxUserName"] != DBNull.Value) { bid.QuickBloxUserID = dRow["QuickBloxUserName"].ToString(); } if (dRow["Longitude"] != DBNull.Value) { bid.Longitude = Convert.ToDecimal(dRow["Longitude"].ToString()); } if (dRow["Latitude"] != DBNull.Value) { bid.Latitude = Convert.ToDecimal(dRow["Latitude"].ToString()); } if (dRow["Distance"] != DBNull.Value) { bid.Distance = Convert.ToDecimal(dRow["Distance"].ToString()); } if (dRow["Description"] != DBNull.Value) { bid.ResolutionDescription = dRow["Description"].ToString(); } if (dRow["ResolutionMethodID"] != DBNull.Value) { bid.ResolutionMethodID = Int32.Parse(dRow["ResolutionMethodID"].ToString()); } if (dRow["ResolutionLink1"] != DBNull.Value) { bid.ResolutionLink1 = dRow["ResolutionLink1"].ToString(); } if (dRow["ResolutionLink2"] != DBNull.Value) { bid.ResolutionLink2 = dRow["ResolutionLink2"].ToString(); } if (dRow["CurrencyID"] != DBNull.Value) { bid.CurrencyID = Int32.Parse(dRow["CurrencyID"].ToString()); } if (dRow["CurrencyName"] != DBNull.Value) { bid.CurrencyName = dRow["CurrencyName"].ToString(); } if (dRow["CurrencyDisplayText"] != DBNull.Value) { bid.CurrencyDisplayText = dRow["CurrencyDisplayText"].ToString(); } if (dRow["Amount"] != DBNull.Value) { bid.Amount = Convert.ToDecimal(dRow["Amount"].ToString()); } if (dRow["CompanyID"] != DBNull.Value) { bid.CompanyID = Int32.Parse(dRow["CompanyID"].ToString()); } if (dRow["CompanyName"] != DBNull.Value) { bid.CompanyName = dRow["CompanyName"].ToString(); } if (dRow["UserID"] != DBNull.Value) { bid.UserID = Int32.Parse(dRow["UserID"].ToString()); } if (dRow["IsSelected"] != DBNull.Value) { bid.IsSelected = Convert.ToBoolean(dRow["IsSelected"].ToString()); } if (dRow["IsInvited"] != DBNull.Value) { bid.IsInvited = Convert.ToBoolean(dRow["IsInvited"].ToString()); } if (dRow["SubmittedDate"] != DBNull.Value) { bid.SubmittedDate = Convert.ToDateTime(dRow["SubmittedDate"].ToString()); } if (dRow["IsRated"] != DBNull.Value) { bid.IsRated = Convert.ToBoolean(dRow["IsRated"].ToString()); } if (dRow["UserRating"] != DBNull.Value) { bid.UserRating = Convert.ToDecimal(dRow["UserRating"].ToString()); } lstproblembid.Add(bid); count++; } problemdetailobject.selectedproblembid = lstproblembid; } } responseObject.ResultCode = "SUCCESS"; responseObject.ResultObjectRecordCount = count; responseObject.ResultObjectJSON = Serializer.ObjectToJSON(problemdetailobject); if (count <= 0) { responseObject.ResultMessage = "No bids currently available for this problem."; } } catch (Exception ex) { responseObject.ResultCode = "ERROR"; responseObject.ResultMessage = ex.Message; CustomException exc = new CustomException(ex.ToString(), this.ToString(), "GetProblemDetailById", System.DateTime.Now); ExceptionManager.PublishException(exc); } } return responseObject; }