本文整理汇总了C#中DBFunctions.getstdentinfo方法的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions.getstdentinfo方法的具体用法?C# DBFunctions.getstdentinfo怎么用?C# DBFunctions.getstdentinfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBFunctions
的用法示例。
在下文中一共展示了DBFunctions.getstdentinfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
bool loggedStatus = false;
if (System.Web.HttpContext.Current.User != null)
{
DatabaseFunctions d = new DatabaseFunctions();
loggedStatus = System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
if (loggedStatus)
{
UserID = Membership.GetUser().ProviderUserKey.ToString();
stid = d.GetCandidateID(UserID);
if (stid != -1)
{
DBFunctions db = new DBFunctions();
backlink.Text = "<a href='#0' class='btn btn-primary' onclick='history.back()'>Back</a>";
var chk = db.getLirarymember(stid);
if (chk == null)
{
var stdent = db.getstdentinfo(stid);
nametxt.Text = stdent.Candidate_tbl.Name;
metricno.Text = stdent.Candidate_tbl.AddmissionList_tbl.FirstOrDefault().MetricNo;
programme.Text = stdent.Program_tbl.ProgramName;
}
else
{
membershipform.Visible = false;
membermsg.Visible = true;
if (chk.Status == 0)
{
membermsg.InnerText = "Your Request For Library Membership is Pending..!!";
}
else if (chk.Status == 1)
{
membermsg.InnerText = "You Already Have The Library Membership!!";
}
}
}
else
{
}
}
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["admin"] != null)
{
DBFunctions db = new DBFunctions();
setprogrammes();
if (!IsPostBack)
{
if (Request.QueryString["stdid"] != null)
{
setdateofbirth();
setstates();
int stdid = int.Parse(Request.QueryString["stdid"]);
var student = db.getstdentinfo(stdid);
StudentName.Text = student.Candidate_tbl.Name;
MetricNo.Text = student.Candidate_tbl.AddmissionList_tbl.FirstOrDefault().MetricNo;
DropDownProgram.SelectedValue = student.ProgramID.ToString();
Semester.Text = student.Semester.ToString();
Ayear.Text = student.AcadamicYear.ToString();
FeeDiscount.Text = student.FeeDiscount;
txtHomeaddress.Text = student.Candidate_tbl.HomeAdress;
Emailtxt.Text = student.Candidate_tbl.Email;
Phonetxt.Text = student.Candidate_tbl.Phone;
dropdownSto.SelectedValue = student.Candidate_tbl.Stateoforigin.ToString();
dropdownDay.SelectedValue = student.Candidate_tbl.DateofBirth.Split('-')[0];
dropdownMonth.SelectedValue = student.Candidate_tbl.DateofBirth.Split('-')[1];
dropdownyears.SelectedValue = student.Candidate_tbl.DateofBirth.Split('-')[2];
setareas();
dropdownLocalGovtarea.SelectedValue = student.Candidate_tbl.LocalGovtArea.ToString();
}
}
}
else
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
}
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Session["userid"] != null)
{
int stid = int.Parse(Session["userid"].ToString());
DBFunctions db = new DBFunctions();
backlink.Text = "<a href='#0' class='btn btn-primary' onclick='history.back()'>Back</a>";
var chk = db.getLirarymember(stid);
if (chk == null)
{
var stdent = db.getstdentinfo(stid);
nametxt.Text = stdent.Candidate_tbl.Name;
metricno.Text = stdent.Candidate_tbl.AddmissionList_tbl.FirstOrDefault().MetricNo;
programme.Text = stdent.Program_tbl.ProgramName;
}
else
{
membershipform.Visible = false;
membermsg.Visible = true;
if(chk.Status==0){
membermsg.InnerText = "Your Request For Library Membership is Pending..!!";
}
else if(chk.Status==1)
{
membermsg.InnerText = "You Already Have The Library Membership!!";
}
}
}
else
{
}
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagename = Path.GetFileName(Request.PhysicalPath);
bool loggedStatus = false;
if (System.Web.HttpContext.Current.User != null)
{
if (!IsPostBack)
{
loggedStatus = System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
if (loggedStatus)
{
DBFunctions db = new DBFunctions();
DatabaseFunctions d = new DatabaseFunctions();
Userid = Membership.GetUser().ProviderUserKey.ToString();
uid = d.GetCandidateID(Userid);
// loadprogrammes();
StudentInfo_tbl temp = db.getstdentinfo(uid);
StudentSelectedCredit obj = db.getStudentCredits(uid).FirstOrDefault();
if (obj != null)
{
Credits = Convert.ToInt16(obj.SelectedCourseCount);
}
getcourses();
}
else
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
}
}
// dropdownCourse.DataSource=
}
示例5: Print_btn_Click
protected void Print_btn_Click(object sender, EventArgs e)
{
string html = System.IO.File.ReadAllText(Server.MapPath("StudentRecord.html"));
DBFunctions db = new DBFunctions();
string Metricno = Session["Metricno"].ToString();
var record = db.getstudentAcademicRecord(Metricno);
string studentrecordhtml = "";
int uid = int.Parse(Session["userid"].ToString());
double credithours = 0;
double totalcredithours = 0;
double pints = 0;
double totalpints = 0;
double cgpa = 0;
double gpa = 0;
var studentinf = db.getstdentinfo(uid);
foreach (var rec in record)
{
studentrecordhtml += "<h4 style='padding:5px;font-weight:bold;text-align:left'>Semester " + rec.FirstOrDefault().Semester + "</h4><br /><br />";
studentrecordhtml +="<table align='center' cellpadding='0' style='border:none; padding:3px;' cellspacing='0' border='1' width='100%' class='table table-responsive'>";
studentrecordhtml +="<tr bgcolor='#293a4a' style='color: FFF;border:none class='blue-background' align='center'><th>Course</th><th>Total Marks</th><th>Obtained Marks</th><th>Crdit Hour</th><th> Grade</th><th>Points</th><th>Remarks</th></tr>";
foreach (var r in rec)
{
pints += r.Courses_tbl.Credit_Hours.Value * r.Grades_tbl.Gradepoints.Value;
totalpints += r.Courses_tbl.Credit_Hours.Value * r.Grades_tbl.Gradepoints.Value;
credithours += r.Courses_tbl.Credit_Hours.Value;
totalcredithours += r.Courses_tbl.Credit_Hours.Value;
studentrecordhtml += "<tr><td>" + r.Courses_tbl.Course + "</td><td>" + r.Courses_tbl.Marks + "</td><td>" + r.ObtainedMarks + "</td><td>" + r.Courses_tbl.Credit_Hours + "</td><td>" + r.Grades_tbl.Grade + "</td><td>" + r.Grades_tbl.Gradepoints + "</td>";
if (r.GradeID == 9)
studentrecordhtml += "<td style='color:red'>Reapear*</td></tr>";
else
studentrecordhtml += "<td style='color:Green'>Pass</td></tr>";
}
gpa = pints / credithours;
cgpa = totalpints / totalcredithours;
pints = 0;
credithours = 0;
studentrecordhtml += "</table><p class='col-lg-offset-9 col-lg-3' style='font-weight:bold;font-size:9px;text-align:right'>GPA: " + gpa + " | CGPA:" + cgpa + "</p><br><br>";
}
Byte[] bytes;
html = html.Replace("{CollegeName}","College");
html = html.Replace("{Programme}", studentinf.Program_tbl.ProgramName);
html = html.Replace("{Name}", studentinf.Candidate_tbl.Name);
html = html.Replace("{MetricNo}", Metricno);
html = html.Replace("{Batch}", studentinf.Candidate_tbl.AddmissionList_tbl.FirstOrDefault().Batches_table.BatchYear.ToString());
html = html.Replace("{Record}", studentrecordhtml);
using (var ms = new MemoryStream())
{
var doc = new Document();
doc = new Document(PageSize.A4, 30, 30, 30, 30);
var writer = iTextSharp.text.pdf.PdfWriter.GetInstance(doc, ms);
doc.Open();
doc.NewPage();
var example_html = html;
using (var htmlWorker = new HTMLWorker(doc))
{
using (var sr = new StringReader(example_html))
{
htmlWorker.Parse(sr);
}
}
doc.Close();
bytes = ms.ToArray();
}
long milliseconds = (DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) / 1000;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + milliseconds + "MeritList.pdf");
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.BinaryWrite(bytes);
HttpContext.Current.Response.End();
HttpContext.Current.Response.Close();
}