Example #1
0
 public Thour(string courseName, int courseCreditNumber, departments departments)
 {
     CourseName         = courseName;
     CourseCreditNumber = courseCreditNumber;
     Departments        = departments;
     courses            = new course[5];
 }
        public ActionResult DeleteConfirmed(int id)
        {
            departments departments = db.departments.Find(id);

            db.departments.Remove(departments);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "departmentid,dpt_Description")] departments departments)
 {
     if (ModelState.IsValid)
     {
         db.Entry(departments).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(departments));
 }
Example #4
0
 public void Sua_Click(object sender, CommandEventArgs e)
 {
     if (e.CommandName == "sua")
     {
         int         m = Convert.ToInt16(e.CommandArgument);
         departments s = data.layra1bp(m);
         Session["bp"] = s;
         Response.Redirect("Suabp.aspx");
     }
 }
Example #5
0
 public ActionResult Add(departments dep)
 {
     if (dep.departmentName != null)
     {
         var depp = new departments();
         depp.departmentName = dep.departmentName;
         db.departments.Add(depp);
         db.SaveChanges();
     }
     return(RedirectToAction("Index", "Department"));
 }
        public EditDepartmentDataPage(AdminWindow adminWindow, departments SelectedDepartment)
        {
            InitializeComponent();

            this.SelectedDepartment      = (departments)SelectedDepartment.Clone();
            this.EditDepartmentReference = SelectedDepartment;

            this.adminWindow = adminWindow;

            DataContext = this;
        }
        public ActionResult Create([Bind(Include = "departmentid,dpt_Description")] departments departments)
        {
            if (ModelState.IsValid)
            {
                db.departments.Add(departments);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(departments));
        }
Example #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            departments bp = (departments)Session["bp"];
            txtdeparment_id.Text    = bp.department_id.ToString();
            txtdepartment_name.Text = bp.department_name;


            DataBind();
        }
    }
Example #9
0
    public void Thembp(departments s)
    {
        con.Open();
        string     strSql = " insert into departments  values (@department_name)";
        SqlCommand cmd    = new SqlCommand(strSql, con);

        cmd.Parameters.AddWithValue("department_name", s.department_name);


        cmd.ExecuteNonQuery();
        con.Close();
    }
Example #10
0
        static void Main(string[] args)
        {
            Console.WriteLine("University Management System ");

            Console.WriteLine("Developer At Kuratoli Software Solutions");
            Console.WriteLine("Develop by Mehedi");

            Console.WriteLine("\n Valid sections :- \n");

            course  cr 1 = new course("java", 2, 3, 4.0, 5);
            section sec1 = new section("x", "OOP2", 5, 2, 4.0);
            section sec2 = new section("y", "OOP2", 5, 3, 3.0);
            section sec3 = new section("d", "dcom", 3, 3, 4.0);
            section sec4 = new section("J", "c++", 4, 6, 3.0);
            section sec5 = new section("o", "c", 3, 1, 3.0);
            section sec6 = new section("u", "OOAD", 4, 3, 7.0);
            section sec7 = new section("i", "OOAD", 2, 7, 4.0);



            cr1.ShowInfo();

            sec2.ShowInfo();

            dept d1 = new departments("FST");
            dept d2 = new departments("FBA");
            dept d3 = new departments("FASS");
            dept d4 = new departments("FE");

            d1.AddCourse(crs1);

            d1.ShowAllCourses();

            Console.WriteLine("\nAdding Courses\n");
            d1.AddCourse(sec1, sec2, sec3, sec4, sec5, sec5, sec6);
            d1.ShowAllCourses();

            Console.WriteLine("\nFaculty Name\n");
            faculty f1 = new faculty("mk", "");
            faculty f2 = new faculty("nb", "");
            faculty f3 = new faculty("hg", "");
            faculty f4 = new faculty("yr", "");


            Thour t1 = new Thour("C++", 3, d1);
            Thour t2 = new Thour("c", 3, d1);
            Thour t3 = new Thour("java", 3, d1);


            f1.AddCredit(t1, t2, t3);
            f1.ShowAllCredits();
        }
        public EditDepartmentDataPage(AdminWindow adminWindow)
        {
            InitializeComponent();

            SelectedDepartment = new departments
            {
                department_name = "Какое название кафедры..."
            };

            this.adminWindow = adminWindow;

            DataContext = this;
        }
Example #12
0
    public void Capnhatbp(departments s)
    {
        con.Open();
        string     strSql = "update departments set department_name=@department_name where department_id=@department_id";
        SqlCommand cmd    = new SqlCommand(strSql, con);

        cmd.Parameters.AddWithValue("department_name", s.department_name);

        cmd.Parameters.AddWithValue("department_id", s.department_id);


        cmd.ExecuteNonQuery();
        con.Close();
    }
        // GET: departments/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            departments departments = db.departments.Find(id);

            if (departments == null)
            {
                return(HttpNotFound());
            }
            return(View(departments));
        }
Example #14
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            departments = await _context.departments.FirstOrDefaultAsync(m => m.DID == id);

            if (departments == null)
            {
                return(NotFound());
            }
            return(Page());
        }
Example #15
0
        public ActionResult Edit(departments department)
        {
            var dep = db.departments.FirstOrDefault(x => x.departmentsId == department.departmentsId);

            if (dep != null)
            {
                dep.departmentName = department.departmentName;
                db.SaveChanges();
                return(RedirectToAction("Index", "Department"));
            }
            else
            {
                ViewBag.Warning = "Düzenleme gerçekleştirilemedi.";
                return(View());
            }
        }
Example #16
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            departments = await _context.departments.FindAsync(id);

            if (departments != null)
            {
                _context.departments.Remove(departments);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
Example #17
0
        /// <summary>
        /// Converts this instance of <see cref="departments"/> to an instance of <see cref="departmentsDTO"/>.
        /// </summary>
        /// <param name="entity"><see cref="departments"/> to convert.</param>
        public static departmentsDTO ToDTO(this departments entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var dto = new departmentsDTO();

            dto.id_department = entity.id_department;
            dto.name          = entity.name;
            dto.description   = entity.description;

            entity.OnDTO(dto);

            return(dto);
        }
Example #18
0
        /// <summary>
        /// Converts this instance of <see cref="departmentsDTO"/> to an instance of <see cref="departments"/>.
        /// </summary>
        /// <param name="dto"><see cref="departmentsDTO"/> to convert.</param>
        public static departments ToEntity(this departmentsDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new departments();

            entity.id_department = dto.id_department;
            entity.name          = dto.name;
            entity.description   = dto.description;

            dto.OnEntity(entity);

            return(entity);
        }
Example #19
0
    protected void btnsua_Click(object sender, EventArgs e)
    {
        try
        {
            departments s = (departments)Session["bp"];
            s.department_name = txtdepartment_name.Text;



            data.Capnhatbp(s);
            msg.Text = "Ban cap nhat thanh cong";
        }
        catch (Exception ex)
        {
            msg.Text = " co loi :" + ex;
        }
    }
Example #20
0
        public void loadUsers()
        {
            userList = _userManager.UserList();

            foreach (var x in userList)
            {
                departments dept = _deptManager.GetDept(x.departmantId);
                deptList.Add(dept);
            }

            for (int index = 0; index < userList.Count; index++)
            {
                userList[index].deptsName = _deptManager.GetDept(Convert.ToDecimal(userList[index].departmantId));
            }

            lvUsers.ItemsSource = userList;
        }
Example #21
0
    protected void btnthem_Click(object sender, EventArgs e)
    {
        try
        {
            departments s = new departments();
            s.department_name = txtdepartment_name.Text;


            data.Thembp(s);
            msg.ForeColor = System.Drawing.Color.Blue;
            msg.Text      = "Them thanh cong";
        }
        catch (Exception ex)
        {
            msg.ForeColor = System.Drawing.Color.Red;
            msg.Text      = " khong them duoc, co loi:" + ex.Message;
        }
    }
Example #22
0
    public List <departments> departments()
    {
        List <departments> li     = new List <departments>();
        string             strSql = " select * from departments";

        con.Open();
        SqlCommand    cmd = new SqlCommand(strSql, con);
        SqlDataReader rd  = cmd.ExecuteReader();

        while (rd.Read())
        {
            departments s = new departments();
            s.department_id   = (int)rd["department_id"];
            s.department_name = (string)rd["department_name"];
            li.Add(s);
        }
        con.Close();
        return(li);
    }
Example #23
0
    public departments layra1bp(int department_id)
    {
        List <departments> li     = new List <departments>();
        string             strSql = " select * from departments where department_id=@department_id";

        con.Open();
        SqlCommand cmd = new SqlCommand(strSql, con);

        cmd.Parameters.AddWithValue("department_id", department_id);
        departments   s  = null;
        SqlDataReader rd = cmd.ExecuteReader();

        if (rd.Read())
        {
            s = new departments();
            s.department_id   = (int)rd["department_id"];
            s.department_name = (string)rd["department_name"];


            li.Add(s);
        }
        con.Close();
        return(s);
    }
Example #24
0
 /// <summary>
 /// Invoked when <see cref="ToEntity"/> operation is about to return.
 /// </summary>
 /// <param name="entity"><see cref="departments"/> converted from <see cref="departmentsDTO"/>.</param>
 static partial void OnEntity(this departmentsDTO dto, departments entity);
Example #25
0
        public decimal DepartmetnID(string name)
        {
            departments dept = missionEntities.departments.Where(m => m.department_name == name).FirstOrDefault();

            return(dept.id);
        }
Example #26
0
 /// <summary>
 /// Invoked when <see cref="ToDTO"/> operation is about to return.
 /// </summary>
 /// <param name="dto"><see cref="departmentsDTO"/> converted from <see cref="departments"/>.</param>
 static partial void OnDTO(this departments entity, departmentsDTO dto);
Example #27
0
        public string DepartmetName(decimal?deptID)
        {
            departments dept = missionEntities.departments.Where(m => m.id == deptID).FirstOrDefault();

            return(dept.department_name);
        }
Example #28
0
        public departments GetDept(decimal?id)
        {
            departments dept = missionEntities.departments.Where(m => m.id == id).FirstOrDefault();

            return(dept);
        }