mercredi 25 juin 2014

Adding Comments button against list of wcf service


Vote count:

0




I have call a list of phone records in wcf service. Now i need to add comments & feedback against all records, in such a way that user clicks the notes button and then enter the comments and feedback aaisnt a specific record.


Here is my class FOR notes



public class CallNote
{
public int Id { get; set; }
///<Summary>
///
///</Summary>
public string Comments { get; set; }
///<Summary>
///
///</Summary>
///
public string FeedBack { get; set; }
///<Summary>
///
///</Summary>
///
public string Login { get; set; }
}


Class for callhistory



public class CallHistory
{
/// <summary>
///
/// </summary>
///
public int CallId { get; set; }
/// <summary>
///
/// </summary>
///
public string Login { get; set; }
/// <summary>
///
/// </summary>
public string FirstName { get; set; }
/// <summary>
///
/// </summary>
public string LastName { get; set; }
/// <summary>
///
/// </summary>
public string Email { get; set; }
/// <summary>
///
/// </summary>
public string Country { get; set; }
/// <summary>
///
/// </summary>
public string Phone { get; set; }
/// <summary>
///
/// </summary>
public string DialedNumber { get; set; }
/// <summary>
///
/// </summary>
public string CallStart { get; set; }
/// <summary>
///
/// </summary>
public string CallEnd { get; set; }
/// <summary>
///
/// </summary>
public string TariffDescription { get; set; }
/// <summary>
///
/// </summary>

}


and here is my controller



public ActionResult CreateNote()
{
var result = Manager.GetUsersWhoHaveConsumedFreeCredit();
JavaScriptSerializer serializer = new JavaScriptSerializer();
var callHistory = serializer.Deserialize<List<CallHistory>>(result);
return View(callHistory.ToPagedList(1, Settings.PagingSize));

}
[HttpPost]
public ActionResult CreateNote(CallNote callnote)
{
CallNote_Db db = new CallNote_Db();

if (ModelState.IsValid)
{
db.callnote.Add(callnote);
db.SaveChanges();
return RedirectToAction("CallHistory");
}
return PartialView("CallHistory", callnote);
}

public ActionResult UsersWhoHaveConsumedFreeCredit(int Id = 1)
{
var result = Manager.GetUsersWhoHaveConsumedFreeCredit(); ;
JavaScriptSerializer serializer = new JavaScriptSerializer();
var callHistory = serializer.Deserialize<List<CallHistory>>(result);
CallNote callNote = new Models.CallNote();

CallHistoryFilter callHistoryFilter = new Models.CallHistoryFilter();
MyYelloAdminEntities db = new Models.MyYelloAdminEntities();
{
callHistoryFilter.Countries = db.Countries.ToList();
callHistoryFilter.Countries.Insert(0, new Country { Title = "All", Prefix = "-1" });
var model = new UsersWhoHaveConsumedFreeCredit
{


CallHistory = callHistory.ToPagedList(Id, Settings.PagingSize),
CallHistoryFilter = callHistoryFilter

};
return View(model);

}

}


How i can add comments against each record.



asked 50 secs ago






Aucun commentaire:

Enregistrer un commentaire