public static EmailNotification GetNotification(string id) { ValueController ob1 = new ValueController(); DataSet ds = ob1.GetNotification(id); // Session["Notification"] = ds; EmailNotification en = new EmailNotification(); foreach (DataRow dr in ds.Tables[0].Rows) { en.send = (bool)dr[0]; en.Receive = (bool)dr[1]; en.Buy = (bool)dr[2]; en.Sell = (bool)dr[3]; en.Exchange = (bool)dr[4]; } return(en); }