• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# DBFunctions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DBFunctions的典型用法代码示例。如果您正苦于以下问题:C# DBFunctions类的具体用法?C# DBFunctions怎么用?C# DBFunctions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DBFunctions类属于命名空间,在下文中一共展示了DBFunctions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();


      

        }

    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:30,代码来源:OfferCourses.aspx.cs


示例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();

            }
        }
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:33,代码来源:updateEmpolyee.aspx.cs


示例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;
     }
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:34,代码来源:Login.aspx.cs


示例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");
  }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:7,代码来源:Updatestudent.aspx.cs


示例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++;
        }


       }
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:30,代码来源:Attendance.aspx.cs


示例6: AddQuestion

    public static string AddQuestion(string question, string[] answers)
    {
        DBFunctions db = new DBFunctions();
        db.addQuestion(question, answers);

        return "Added";
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:7,代码来源:AddQuestions.aspx.cs


示例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");

        }
       
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:28,代码来源:orderBook.aspx.cs


示例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);
      }
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:28,代码来源:Attendance.aspx.cs


示例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;
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:31,代码来源:ViewResult.aspx.cs


示例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);
         }

        

    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:34,代码来源:Applicantlist.aspx.cs


示例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);
        }
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:25,代码来源:AnswerQuestion.aspx.cs


示例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();
        }
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:31,代码来源:updatebookrequest.aspx.cs


示例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
            {

            }
        }

    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:28,代码来源:updateRoom.aspx.cs


示例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();

                }
            }
            
        }

    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:31,代码来源:CourseSelection.aspx.cs


示例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();
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:26,代码来源:AddForm.aspx.cs


示例16: 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["Datesheetid"]);
            if (!IsPostBack)
            {
                DBFunctions db = new DBFunctions();
                if (action == "update")
                {
                    CourseList.DataSource = db.getcourselist();
                    CourseList.DataValueField = "ID";
                    CourseList.DataTextField = "Course";
                    CourseList.DataBind();
                    // Courses_tbl course = db.getcourses(id);
                    DateSheet_tbl ds = db.getDateSheet(id);
                    ExamTypeList.SelectedValue = ds.ExamType;
                    StartTime.Text = ds.StartTime;
                    EndTime.Text = ds.EndTime;


                }
                else
                {

                }
            }
        }
        else
        {
            Response.Redirect("Login.aspx?Redirecturl=" + pagename);
        }
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:35,代码来源:updateDateSheet.aspx.cs


示例17: BtnSumit_Click

    protected void BtnSumit_Click(object sender, EventArgs e)
    {
        mesg.Visible = false;
        DBFunctions db = new DBFunctions();
        int empid = int.Parse(DropDownteacher.SelectedValue);
        int crsid = int.Parse(DropDownCourse.SelectedValue);
        CourseTeacherAssignment_tbl assigncourse = new CourseTeacherAssignment_tbl { CourseID = crsid, TeacherID = empid };
        int flag= db.assignteachercourse(assigncourse);
        if (flag==2)
        {
            mesg.Visible = true;
                      //<p class="alert alert-danger col-lg-offset-3 col-lg-9" runat="server" id="mesg" visible="false"></p>
            mesg.Text = "<p class='alert alert-danger col-lg-offset-3 col-lg-6'> The Course of "+DropDownCourse.SelectedItem.Text+" is already assigned to "+DropDownteacher.SelectedItem.Text+"</p>";
        }
        else if(flag==1)
        {
            mesg.Visible = true;

            mesg.Text = "<p class='alert alert-info col-lg-offset-3 col-lg-6'> The Course of " + DropDownCourse.SelectedItem.Text + " is Successfuly assigned to " + DropDownteacher.SelectedItem.Text + "</p>";

        }

        else if (flag == -1)
        {
            mesg.Visible = true;

            mesg.Text = "<p class='alert alert-danger col-lg-offset-3 col-lg-6'> The Course of " + DropDownCourse.SelectedItem.Text + " is already assigned to another teacher</p>";

        }
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:30,代码来源:AssignCourseToEmplloyee.aspx.cs


示例18: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        pagename = Path.GetFileName(Request.PhysicalPath);
        if(System.Web.HttpContext.Current.User != null)
        {
            bool LoggedStatus = false;
            UserID = Membership.GetUser().ProviderUserKey.ToString();
            LoggedStatus = System.Web.HttpContext.Current.User.Identity.IsAuthenticated;
            if (LoggedStatus)
            {
                DBFunctions db = new DBFunctions();
                var discussionstopics = db.getdiscussiontopics();
                foreach (var topic in discussionstopics)
                {
                    discussionstxt.Text += "<tr><td><a href='discussions.aspx?topicid=" + topic.ID + "'>" + topic.Topic + "</a></td><td>" + topic.DateCreated + "</td></tr>";
                }
            }

            else
            {
                Response.Redirect("Login.aspx?Redirecturl=" + pagename);
            }
        }
       
    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:25,代码来源:DiscussionTopic.aspx.cs


示例19: Requestbtn_Click

 protected void Requestbtn_Click(object sender, EventArgs e)
 {
     DBFunctions db = new DBFunctions();
     int stid = int.Parse(Session["userid"].ToString());
     LibraryMember member = new LibraryMember { UserID = stid, Status = 0,JoinDate=DateTime.Now.Date };
     db.requestlibrarymembership(member);
 }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:7,代码来源:RequestMemberShip.aspx.cs


示例20: Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        string action = Request.QueryString["action"];
        id = int.Parse(Request.QueryString["Wardenid"]);
        if (!IsPostBack)
        {
            DBFunctions db = new DBFunctions();
            if (action == "update")
            {
                HostelWarden_tbl wrd = db.getWarden(id);
                wardenname.Text = wrd.Name;
               
                wardenphone.Text = wrd.Phone;
                email.Text = wrd.Email;
                
                DropDownHostel.DataSource = db.gethostellist();
                
                DropDownHostel.DataTextField = "Name";
                DropDownHostel.DataValueField = "ID";
                DropDownHostel.DataBind();



            }
            else
            {

            }
        }

    }
开发者ID:EezeSolutions,项目名称:Higher_Erp,代码行数:31,代码来源:updateWarden.aspx.cs



注:本文中的DBFunctions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DBHelper类代码示例发布时间:2022-05-24
下一篇:
C# DBElement类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap