public CompDetailByFarmer GetFarmerComplaint(int OrderID, int FarmerId) { DataSet ds = _Apdal.GetFarmerComplaint(OrderID, FarmerId); CompDetailByFarmer Isd = new CompDetailByFarmer(); if (ds != null && ds.Tables[0] != null) { if (ds.Tables[0].Rows.Count > 0) { List <ComplainModel> _IL = new List <ComplainModel>(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { ComplainModel ILF = new ComplainModel(); ILF.ComplaintID = Convert.ToInt32(ds.Tables[0].Rows[i]["ComplaintID"].ToString()); ILF.Query = ds.Tables[0].Rows[i]["Query"].ToString(); ILF.CreatedDate = ds.Tables[0].Rows[i]["CreatedDate"].ToString(); ILF.IssueType = ds.Tables[0].Rows[i]["IssueType"].ToString(); ILF.IssueDetail = ds.Tables[0].Rows[i]["IssueDetail"].ToString(); ILF.ProductName = ds.Tables[0].Rows[i]["ProductName"].ToString(); ILF.CreatedBy = ds.Tables[0].Rows[i]["CreatorName"].ToString(); _IL.Add(ILF); } Isd.CompList = _IL; } } return(Isd); }
public CompDetailByFarmer GetFarmerComplaint(string apiKey, int OrderID = 0, int FarmerId = 0) { CompDetailByFarmer ord = null; if (apiKey == ConfigurationManager.AppSettings["reasonkey"]) { try { ord = _agentbal.GetFarmerComplaint(OrderID, FarmerId); } catch (Exception ex) { LogBal.ErrorLog(this.GetType().Name, MethodBase.GetCurrentMethod().Name, ex.Message, 0); } } return(ord); }