本文整理汇总了C#中DBFunctions类的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions类的具体用法?C# DBFunctions怎么用?C# DBFunctions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DBFunctions类属于命名空间,在下文中一共展示了DBFunctions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["admin"] == null)
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
if (!IsPostBack)
{
DBFunctions db = new DBFunctions();
Programlist.DataSource= db.getprogramslist();
Programlist.DataTextField = "ProgramName";
Programlist.DataValueField = "ID";
Programlist.DataBind();
Batchlist.DataSource = db.getactivebatchlist();
Batchlist.DataTextField = "BatchYear";
Batchlist.DataValueField = "ID";
Batchlist.DataBind();
}
}
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["empid"] != null)
{
setdateofbirth();
setdepartment();
setEmployeeType();
int empid = int.Parse(Request.QueryString["empid"]);
DBFunctions db = new DBFunctions();
Employee_tbl emp = db.getemployee(empid);
EmpNametxt.Text = emp.Name;
Qualificationtxt.Text = emp.Qualification;
phonetxt.Text = emp.PhoneNumber;
dropdownGender.SelectedValue = emp.Gender;
DeptList.SelectedValue = emp.Deptid.ToString();
string[] dob = emp.DateOFBirth.Split('/');
dropdownDay.SelectedValue = dob[0];
dropdownMonth.SelectedValue = dob[1];
dropdownyears.SelectedValue = dob[2];
Emailtxt.Text = emp.Email;
CNICtxt.Text = emp.CNIC;
Addresstxt.Text = emp.Address;
Citytxt.Text = emp.City;
Accounttxt.Text = emp.BankAccountNumber;
Banktxt.Text = emp.Bank;
Designationtxt.Text = emp.Designation;
DropDownEmpType.SelectedValue = emp.EmployeeType.ToString();
}
}
}
示例3: btnlogin_Click
protected void btnlogin_Click(object sender, EventArgs e)
{
string returnuurl = "";
if (Request.QueryString["Redirecturl"]!=null)
{
returnuurl = Request.QueryString["Redirecturl"];
Message.Visible = true;
Message.Text = "Please Login First";
}
DBFunctions db=new DBFunctions();
var employee=db.getemployeinfo(username.Text,password.Text);
if(employee!=null)
{
Session["username"] = username.Text;
Session["userid"] = employee.ID;
Session["Role"] = "Employee";
if(employee.IsFirstTime==0)
{
Response.Redirect("Updateuserinfo.aspx");
}
if(returnuurl=="")
Response.Redirect("EmployeeDashboard.aspx");
else
{
Response.Redirect(returnuurl);
}
}
else
{
Message.Text = "Wrong Username or Password";
Message.Visible = true;
}
}
示例4: btnupdatestudent_Click
protected void btnupdatestudent_Click(object sender, EventArgs e)
{
DBFunctions db = new DBFunctions();
db.updatestudtent(int.Parse(Request.QueryString["stdid"]),StudentName.Text,int.Parse(DropDownProgram.SelectedValue),int.Parse(Semester.Text),FeeDiscount.Text,txtHomeaddress.Text, int.Parse(dropdownSto.SelectedValue),int.Parse(dropdownLocalGovtarea.SelectedValue),Emailtxt.Text,dropdownDay.SelectedItem.Text + "-" + dropdownMonth.SelectedItem.Text + "-" + dropdownyears.SelectedItem.Text,Phonetxt.Text);
Response.Redirect("Admittedstudents.aspx");
}
示例5: Dropdowncrs_SelectedIndexChanged
protected void Dropdowncrs_SelectedIndexChanged(object sender, EventArgs e)
{
DBFunctions db = new DBFunctions();
//studentslbl.Text = "";
if(!db.checkattendance(int.Parse(Dropdowncrs.SelectedValue))){
studentslbl.Text = "<p class='alert-danger'>Today's Attedance for this course is already entered!!</p>";
return;
}
var enrolledstudents = db.getenrolledstudents(int.Parse(Dropdowncrs.SelectedValue));
studentslbl.Text = "<tr class='blue-background'><th>Student Name</th><th>Metric #</th><th>Attendance</th></tr>";
if (enrolledstudents.Count == 0)
{
studentslbl.Text = "<br><br>No Student Is Enrolled in this Course";
return;
}
else
{
studetncount = enrolledstudents.Count;
int i = 0;
foreach(var es in enrolledstudents)
{
studentslbl.Text += "<tr><td>" + es.Candidate_tbl.Name + "</td><td>" + es.Candidate_tbl.AddmissionList_tbl.FirstOrDefault().MetricNo + "</td><td><input type='checkbox' id='attendance" + i + "' checked data-toggle='toggle' data-on='Present' data-off='Absent' data-onstyle='success' data-offstyle='danger' data-stdid=" + es.Uid + "></td></tr>";
i++;
}
}
}
示例6: AddQuestion
public static string AddQuestion(string question, string[] answers)
{
DBFunctions db = new DBFunctions();
db.addQuestion(question, answers);
return "Added";
}
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["userid"] != null)
{
string action = Request.QueryString["action"];
id = int.Parse(Request.QueryString["Bookid"]);
DBFunctions db = new DBFunctions();
Book st = new Book();
st = db.loadBook(id);
if (!IsPostBack)
{
bookname.Text = st.Title;
category.Text = st.Category;
daIsbnNo.Text = st.ISBN;
}
}
else
{
Response.Redirect("../Login.aspx?Redirecturl=" +"Library/"+ pagename+"?Bookid="+Request.QueryString["Bookid"]+"&action=update");
}
}
示例8: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["userid"] != null)
{
if (!IsPostBack)
{
DBFunctions db = new DBFunctions();
int userid = int.Parse(Session["userid"].ToString());
List<CourseTeacherAssignment_tbl> courses= db.getassigncourses(userid);
List<Courses_tbl> crslist=new List<Courses_tbl>();
Courses_tbl tempcours = new Courses_tbl { Course = "Select Course" };
crslist.Add(tempcours);
foreach(var crs in courses)
{
crslist.Add(crs.Courses_tbl);
}
Dropdowncrs.DataSource =crslist.OrderBy(x=>x.ID);
Dropdowncrs.DataValueField = "ID";
Dropdowncrs.DataTextField = "Course";
Dropdowncrs.DataBind();
}
}
else
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
}
示例9: showresult
public void showresult()
{
Resultlbl.Text = "<tr class='blue-background'><th>Course</th><th>Total Marks</th><th>Obtained</th><th>Grade</th></tr>";
int total = 0;
DBFunctions db = new DBFunctions();
int stdid = int.Parse(Session["userid"].ToString());
var result = db.getresult(stdid,dropdownterm.SelectedValue);
//<th>Course</th><th>Total Marks</th><th>Obtained</th><th>Grade</th>
foreach (var r in result)
{
Resultlbl.Text += "<tr><td>" + r.Courses_tbl.Course + "</td><td>" + r.TotalMarks + "</td><td>" + r.ObtainedMarks + "</td>";
total += r.ObtainedMarks.Value;
if (r.ObtainedMarks >= 90)
Resultlbl.Text += "<td>A</td></tr>";
else if (r.ObtainedMarks >= 85 && r.ObtainedMarks < 90)
Resultlbl.Text += "<td>A-</td></tr>";
else if (r.ObtainedMarks >= 80 && r.ObtainedMarks < 85)
Resultlbl.Text += "<td>B+</td></tr>";
else if (r.ObtainedMarks >= 70 && r.ObtainedMarks < 80)
Resultlbl.Text += "<td>B</td></tr>";
else if (r.ObtainedMarks >= 60 && r.ObtainedMarks < 70)
Resultlbl.Text += "<td>B-</td></tr>";
else if (r.ObtainedMarks >= 55 && r.ObtainedMarks < 60)
Resultlbl.Text += "<td>C+</td></tr>";
else if (r.ObtainedMarks >= 45 && r.ObtainedMarks < 55)
Resultlbl.Text += "<td>C</td></tr>";
}
Totalmarkslbl.Text = "<b class='h5'>Total marks: </b>" + total;
}
示例10: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagname = Path.GetFileName(Request.PhysicalPath);
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["admin"] != null)
{
if (!IsPostBack)
{
DBFunctions db = new DBFunctions();
Dropdownprogramme.Items.Add(new System.Web.UI.WebControls.ListItem("All Programmes", "All"));
Dropdownprogramme.DataSource = db.getprogramslist();
Dropdownprogramme.DataTextField = "ProgramName";
Dropdownprogramme.DataValueField = "ID";
Dropdownprogramme.DataBind();
if (Request.QueryString["page"] != null)
{
page = int.Parse(Request.QueryString["page"]);
}
var applicants = db.getapplicantlist(page - 1, pagesize);
loadcandidates(applicants);
}
}
else
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
}
示例11: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string pagename = Path.GetFileName(Request.PhysicalPath);
if (Session["admin"] != null)
{
string action = Request.QueryString["action"];
id = int.Parse(Request.QueryString["Questionid"]);
DBFunctions db = new DBFunctions();
Support_tbl st = new Support_tbl();
st = db.loadQuestion(id);
if (!IsPostBack)
{
SenderQuestion.Text = st.Question;
answerText.Text = st.Answer;
date.Text = st.Date.ToString();
}
userid = st.UserID.Value;
}
else
{
Response.Redirect("Login.aspx?Redirecturl=" + pagename);
}
}
示例12: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["id"] != null)
{
int ID = int.Parse(Request.QueryString["id"]);
string action = Request.QueryString["action"];
DBFunctions db = new DBFunctions();
if (action == "Reject")
{
db.updatebookrequest(ID, DateTime.Now.Date, -1);
Response.Redirect("BookRequests.aspx");
return;
}
var request = db.getBookRequest(ID);
BookTitle.Text = request.Book.Title;
Issueto.Text = request.LibraryMember.Candidate_tbl.Name;
IssueDate.Text = DateTime.Now.ToShortDateString();
}
for (int i = 1; i < 32; i++)
{
dropdownDay.Items.Insert((i - 1), new ListItem(i.ToString(), i.ToString()));
}
dropdownDay.SelectedValue = DateTime.Now.Day.ToString();
dropdownMonth.SelectedValue = DateTime.Now.Month.ToString();
}
}
示例13: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
string action = Request.QueryString["action"];
id = int.Parse(Request.QueryString["Roomid"]);
if (!IsPostBack)
{
DBFunctions db = new DBFunctions();
if (action == "update")
{
HostelRoom_tbl room = db.getRoom(id);
price.Text = room.Price.ToString();
capacity.Text = room.Capacity.ToString();
description.Text = room.RoomDescription;
DropDownHostel.DataSource = db.gethostellist();
DropDownHostel.DataTextField = "Name";
DropDownHostel.DataValueField = "ID";
DropDownHostel.DataBind();
}
else
{
}
}
}
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if(Session["userid"]!=null)
{
if (!IsPostBack)
{
DBFunctions db = new DBFunctions();
List<Enroll_Course> cr = db.getcourselist(int.Parse(Session["userid"].ToString()));
List<Courses_tbl> temp = new List<Courses_tbl>();
//foreach (var cf in cr)
//{
// temp = db.getcoursesList(int.Parse(cf.CourseID.ToString()));
//}
DropDownCourses.Items.Add("Select course");
foreach (var cf in cr)
{
int id = int.Parse(cf.CourseID.ToString());
temp = db.getcoursesList(id);
DropDownCourses.DataSource = temp;
DropDownCourses.DataTextField = "Course";
DropDownCourses.DataValueField = "ID";
DropDownCourses.DataBind();
}
}
}
}
示例15: binddata
private void binddata()
{
DBFunctions db = new DBFunctions();
Programtxt.DataSource = db.getprogramslist();
Programtxt.DataValueField = "ID";
Programtxt.DataTextField = "ProgramName";
Programtxt.DataBind();
Sectiontxt.DataSource = db.getformSectionlist();
Sectiontxt.DataTextField = "Section";
Sectiontxt.DataValueField = "ID";
Sectiontxt.DataBind();
Datatype dt=new Datatype();
Datatypetxt.DataSource = dt.datatypelist;
Datatypetxt.DataTextField = "type";
Datatypetxt.DataValueField = "type";
Datatypetxt.DataBind();
Controltxt.DataSource = dt.controllist;
//Controltxt.DataSource = dt.datatypelist;
Controltxt.DataTextField = "type";
Controltxt.DataValueField = "type";
Controltxt.DataBind();
}