Qo‘lyozma huquqida udk 378. 004 Qahhorov abdusalim o„tkir o„G„LI



Download 4,12 Mb.
Pdf ko'rish
bet25/25
Sana31.12.2021
Hajmi4,12 Mb.
#212759
1   ...   17   18   19   20   21   22   23   24   25
Bog'liq
Qahhorov Abdusalim MD Asosiy

    Bu sahifa navigatsiya:
  • ILOVA
Internet resurslari 

22. http://sql-school.info 

23. http://bookwebmaster.narod.ru  

24. https://metanit.com 

25. https://dotnet.microsoft.com 

26. https://www.w3schools.com 

27. http://www.sql-tutorial.ru 

 

 



 

 

 



 

 

 



 

 

 



 

 

 



 

 



62 

 

ILOVA 



 

O„quv reja kontrollerida yozilgan kodlar: 

 

        


public

 ActionResult Index(

string

 pname = 



null

int



 progtype=0, 

int


 dep = 0,  

            

string

 yname = 



null

int



 page = 1, 

int


 pagesize = 50) 

        { 

            

using


 (DBContext db = 

new


 DBContext()) 

            { 

                

var


 departments = db.DEPARTMENTs.Where(x => x.TYPE_DEP == 

"F"


).OrderBy(x => x.NAME_DEP).ToList(); 

                List deps = 

new

 List(departments.Count 



+ 1); 

                deps.Add(

new

 SelectListItem 



                { 

                    Text = 

""



                    Value = 



""

 

                }); 



                

foreach


 (var department 

in

 departments) 



                { 

                    deps.Add(

new

 SelectListItem 



                    { 

                        Selected = department.ID_DEP == dep, 

                        Text = department.NAME_DEP, 

                        Value = department.ID_DEP.ToString() 

                    }); 

                } 

                ViewBag.deps = deps; 

 

                



var

 progTypes = db.TYPE_PROGRAM.OrderBy(x => 

x.ID_TYPE_PROGRAM).ToList(); 

                List progTypesList = 

new

 

List(progTypes.Count + 1); 



                progTypesList.Add(

new


 SelectListItem 

                { 

                    Text = 

""



                    Value = 

""

 



                }); 

                

foreach

 (var progtypesItem 

in

 progTypes) 



                { 

                    progTypesList.Add(

new

 SelectListItem 



                    { 

                        Selected = progtypesItem.ID_TYPE_PROGRAM == progtype, 

                        Text = progtypesItem.NAME, 

                        Value = progtypesItem.ID_TYPE_PROGRAM.ToString() 

                    }); 

                } 

                ViewBag.progTypesList = progTypesList; 

 

                 



                List items2 = 

new


 List(2); 

 

                items2.Add(



new

 SelectListItem 

                { 

                    Selected = pagesize == 25, 

                    Text = 

"25"


                    Value = 

"25"

 

                }); 



                items2.Add(

new


 SelectListItem 

                { 

                    Selected = pagesize == 50, 



63 

 

                    Text = 



"50"

                    Value = 



"50"

 

                }); 



                items2.Add(

new


 SelectListItem 

                { 

                    Selected = pagesize == 100, 

                    Text = 

"100"



                    Value = 



"100"

 

                }); 



                items2.Add(

new


 SelectListItem 

                { 

                    Selected = pagesize == 500, 

                    Text = 

"500"



                    Value = 



"500"

 

                }); 



                ViewBag.pagesizes = items2; 

                

var

 query = db.V_Program.AsQueryable(); 



                 

                

if

 (dep != 0) 



                { 

                    query = query.Where(x => x.ID_DEP == dep); 

                } 

 

                



if

 (progtype != 0) 

                { 

                    query = query.Where(x => x.ID_TYPE_PROGRAM == progtype); 

                } 

 

                



if

 (!


string

.IsNullOrEmpty(pname)) 

                    query = query.Where(x => x.NAME.Contains(pname)); 

 

 



                

if

 (!



string

.IsNullOrEmpty(yname)) 

                    query = query.Where(x => x.Ynom.Contains(yname)); 

 

                ViewBag.TotalItemCount = query.Count(); 



                ViewBag.PageNumber = page; 

                ViewBag.PageSize = pagesize; 

 

                page = page - 1; 



 

                

var

 items = query.OrderBy(x => x.NAME).Skip(page * 



pagesize).Take(pagesize).ToList(); 

 

 



                

return


 View(items); 

            } 

        } 

 

        



public

 ActionResult Details(

int

 id) 


        { 

            

using

 (DBContext db = 



new

 DBContext()) 

            { 

                

var

 vprog = db.V_Program.FirstOrDefault(x => x.ID_PROGRAM == id); 



 

                

if

 (vprog == 



null

                { 



                    

return


 RedirectToAction(

"Index"


); 

                } 

                

var


 prog = db.PROGRAMs.FirstOrDefault(x => x.ID_PROGRAM == id); 

 

                OTCH otch = 



new

 OTCH 


                { 

                    ID_PROG = vprog.ID_PROGRAM, 




64 

 

                    NAME = vprog.NAME, 



                    YNAME = vprog.Ynom, 

                    KURS=prog.CYCLE_COUNT, 

                    TYPE = vprog.ID_TYPE_PROGRAM == 1 ? 

"Bakalavr"

 : 

"Magistr"



 

                }; 

                

int


 i = 0; 

                

var

 pers = db.PROGRAM_PERIOD.Where(x => x.ID_PROGRAM == id).OrderBy(x 



=> x.PERIOD_NUMBER).ToList(); 

                

if

 (pers.Count != prog.CYCLE_COUNT * 2) 



                    

return


 RedirectToAction(

"Index"


); 

 

                otch.PERHOUR = 



new

 List<


int

>(); 


                

foreach


 (var item 

in

 pers) 



                { 

                    otch.PERHOUR.Add(item.PERIOD_LENGTH); 

                } 

                otch.ZONES = 

new

 List(); 



                

foreach


 (var item 

in

 prog.ZONEs) 



                { 

                    otch.ZONES.Add(

new

 ZONE_IN_OTCH 



                    { 

                        ID_ZONE = item.ID_ZONE, 

                        NAME = item.NAME, 

                        MUST = item.NONROOM_STUDIES, 

                        XONA = item.ROOM_STUDIES 

                    }); 

                    

int


 j = 0; 

                    otch.ZONES[i].MUPS = 

new

 List(); 



                    

foreach


 (var itemmup 

in

 item.MUP_SET_ZONE.OrderBy(x => x.ORD)) 



                    { 

                        

var

 v_mup = db.V_MupSet.Where(x => x.ID_MUP_SET == 



itemmup.ID_MUP_SET).First(); 

                            

                        

var


 teacher=db.V_TeacherDepartment.FirstOrDefault(x => 

x.ID_TEACHER == v_mup.ID_OWNER); 

 

                        otch.ZONES[i].MUPS.Add(



new

 MUP_IN_OTCH 

                        { 

                            ID_MUP = itemmup.ID_MUP_SET, 

                            NAME = v_mup.NAME, 

                            ROOM_STUDIES = v_mup.ROOM_STUDIES, 

                            NONROOM_STUDIES = v_mup.NONROOM_STUDIES, 

                            MARUZA = v_mup.MARUZA, 

                            AMALIYOT = v_mup.AMALIYOT, 

                            LAB = v_mup.LAB, 

                            SEMINAR = v_mup.SEMINAR, 

                            KURS_ISHI = v_mup.KURS_ISHI, 

                            DepName = teacher != 

null


 ? teacher.NAME_DEP : 

""

 



                        }); 

                        otch.ZONES[i].MUPS[j].PEROUR = 

new

 List
(); 



                        

foreach


 (var itemmupper 

in

 itemmup.MUP_SET_IN_PERIOD.OrderBy(x 



=> x.ID_PROGRAM_PERIOD)) 

                        { 

                            

var


 pernumb = db.PROGRAM_PERIOD.FirstOrDefault(x => 

x.ID_PROGRAM_PERIOD == itemmupper.ID_PROGRAM_PERIOD); 

                            otch.ZONES[i].MUPS[j].PEROUR.Add(

new


 PERHOURS 

                            { 

                                PERNUMB = pernumb.PERIOD_NUMBER, 

                                HOUR = itemmupper.HOUR_IN_WEEK 

                            }); 

                        } 

                        j++; 

                    } 

                    otch.ZONES[i].XONA = otch.ZONES[i].MUPS.Sum(x => x.ROOM_STUDIES); 



65 

 

                    otch.ZONES[i].MUST = otch.ZONES[i].MUPS.Sum(x => 



x.NONROOM_STUDIES); 

                    otch.ZONES[i].MARUZA = otch.ZONES[i].MUPS.Sum(x => x.MARUZA); 

                    otch.ZONES[i].AMALIYOT = otch.ZONES[i].MUPS.Sum(x => x.AMALIYOT); 

                    otch.ZONES[i].LAB = otch.ZONES[i].MUPS.Sum(x => x.LAB); 

                    otch.ZONES[i].SEMINAR = otch.ZONES[i].MUPS.Sum(x => x.SEMINAR); 

                    otch.ZONES[i].KURS_ISHI = otch.ZONES[i].MUPS.Sum(x => 

x.KURS_ISHI); 

                    otch.ZONES[i].PERHOUR = 

new

 List
(); 



                    

foreach


 (var itemzoneper 

in

 item.ZONE_IN_PERIOD.OrderBy(x => 



x.ID_PROGRAM_PERIOD)) 

                    { 

                        otch.ZONES[i].PERHOUR.Add(

new


 PERHOURS 

                        { 

                            PERNUMB = itemzoneper.PROGRAM_PERIOD.PERIOD_NUMBER, 

                            HOUR = itemzoneper.HOUR_IN_WEEK 

                        }); 

                    } 

                    i++; 

                } 

                

var


 sum = otch.ZONES.Sum(x => x.XONA); 

                sum += otch.ZONES.Sum(x => x.MUST); 

                otch.SUM = sum ?? 0; 

                

foreach

 (var item 

in

 otch.ZONES) 



                { 

                    

if

 (sum == 0) 



                        item.PERC = 0; 

                    

else

 

                        item.PERC = (((item.MUST + item.XONA) * 100 / sum) ?? 0); 



                } 

                

return

 View(otch); 



            } 

        } 

 

        


//O'quv reja qo'shish uchun

 

        



public

 ActionResult AddProgram() 

        { 

            

using

 (DBContext db = 



new

 DBContext()) 

            { 

                ProgramList newProgramList = 

new

 ProgramList(); 



                newProgramList.ListOfCategory = (

from


 obj 

in

 db.TYPE_PROGRAM 



                                                 

select


 

new


 SelectListItem() 

                                                 { 

                                                     Text = obj.NAME, 

                                                     Value = 

obj.ID_TYPE_PROGRAM.ToString() 

 

                                                 }).ToList(); 



 

            } 

 

            



return

 View(); 

             

             

        } 

 

 O‘quv reja sahifasida yozilgan asosiy kodlar: 



 

    


<

div


 

class


="container">

 

        



<

div


 

class


="row">

 

            



<

h4

>



O'quv rejalar

h4

>



 

            



<

hr

 



/>

 

        



div


>

 

        



<

div


 

class


="row">

 



66 

 

            



<

div


 

class


="pull-right">

 

                



                

<

a

 



class

="btn btn-info"

  

href


="

@Url.Action(

"AddProgram"

"Program"



new


 { area = 

"Department"

 })

">

Yangi o'quv reja qo'shish



a

>



 

            



div


>

 

            



<

br

 



/>

 

            



<

hr

 



/>

 

 



 

        


div


>

 

         



        

 

        



<

div


 

class


="modal fade"

 

id



="myModal">

 

            



<

div


 

class


="modal-dialog">

 

                



<

div


 

class


="modal-content">

 

 



                    

 

                    



<

div


 

class


="modal-header">

 

                        



<

button


 

type


="button"

 

class



="close"

 

data-



dismiss

="modal">

×

button


>

 

                        



<

h4

 



class

="modal-title">

O'quv reja

h4

>



 

 

                    



div


>

 

 



                    

 

                    



<

div


 

class


="modal-body">

 

 



                        

<

div


 

class


="form-group col-md-6">

 

                            



<

br

 



/>

 

                            



<

label


>

O'quv reja nomi



label


><

br

 



/>

 

                            



<

input


 

type


="text"

 

class



="form-control"

 

/>



 

                        



div


>

 

                        



<

div


 

class


="form-group col-md-6">

 

                            



<

br

 



/>

 

                            



<

label


>

Mutaxasisslik



label


><

br

 



/>

 

                            



<

input


 

type


="text"

 

class



="form-control"

 

/>



 

                        



div


>

 

                        



<

div


 

class


="form-group col-md-6">

 

                            



<

label


>

O'quv yili



label


><

br

 



/>

 

                            



<

input


 

type


="date"

 

class



="form-control"

 

/>



 

                        



div


>

 

 



                        

<

div


 

class


="form-group col-md-6">

 

                            



<

label


 

for


="inputState">

Ta'lim shakli



label


>

 

                            



<

select


 

id

="inputState"



 

class


="form-control">

 

                                



<

option


>

Kunduzgi


option


>

 

                                



<

option


>

Kechgi


option


>

 

                                



<

option


 

selected


>

Sirtqi


option


>

 

                            



select


>

 

                        



div


>

 

                        



<

div


 

class


="form-group col-md-6">

 

                            



<

label


 

for


="inputState">

Baholash tizimi



label


>

 

                            



<

select


 

id

="inputState"



 

class


="form-control">

 

                                



<

option


>

Kredit


option


>

 

                                



<

option


>

Bal


option


>

 

                                



<

option


 

selected


>

Baho


option


>

 

 



                            

select


>

 

                        



div


>

 

 



                        

<

div


 

class


="form-group col-md-6">

 

                            



<

label


 

for


="inputState">

O'qish muddati



label


>

 

                            



<

select


 

id

="inputState"



 

class


="form-control">

 

                                



<

option


>

2-yil


option


>

 



67 

 

                                



<

option


>

3-yil


option


>

 

                                



<

option


 

selected


>

4-yil


option


>

 

                                



<

option


>

5-yil


option


>

 

                            



select


>

 

                        



div


>

 

                        



<

div


 

class


="form-group col-md-6">

 

                            



<

label


 

for


="inputState">

Semestrlar soni



label


>

 

                            



<

select


 

id

="inputState"



 

class


="form-control">

 

                                



<

option


>

4

option

>

 



                                

<

option


>

8

option

>

 



                                

<

option


 

selected


>

10

option

>

 



                            

select


>

 

                        



div


>

 

                        



<

div


 

class


="form-group col-md-6">

 

                            



<

label


>

Kuzgi davr



label


><

br

 



/>

 

                            



<

input


 

type


="text"

 

class



="form-control"

 

/>



 

                        



div


>

 

                        



<

div


 

class


="form-group col-md-6">

 

                            



<

label


>

Bahorgi davr



label


><

br

 



/>

 

                            



<

input


 

type


="text"

 

class



="form-control"

 

/>



 

                        



div


>

 

                        



<

div


 

class


="form-group col-md-6">

 

                            



<

label


>

Bahorgi davr



label


><

br

 



/>

 

                            



<

input


 

type


="text"

 

class



="form-control"

 

/>



 

                        



div


>

 

 



                    

div


>

 

 



                    

 

                    



<

div


 

class


="modal-footer">

 

                        



<

button


 

type


="button"

 

class



="btn btn-success">

Saqlash


button


>

 

                        



<

button


 

type


="button"

 

data-dismiss



="modal"

 

class



="btn btn-

danger">


Yopish

button


>

 

                    



div


>

 

 



                

div


>

 

            



div


>

 

        



div


>

 

 



         

 

 



        

<

form


 

class


="form-inline"

 

method



="get"

 

action



="

@Url.Action(

"Index"

)

">



 

            



<

div


 

class


="row"

 

style



="

padding-bottom

:

10px">


 

                



<

div


 

class


="pull-left">

 

                    



<

div


 

class


="form-group">

 

                        



<

label


 

for


="dep">

Fakultet:



label


>

 

                        @Html.DropDownList(



"dep"

, deps, 


new

 { @class = 

"form-control"

 

}) 



                    

div


>

 

                    



<

div


 

class


="form-group">

 

                        



<

label


 

for


="progtype">

Ta'lim bosqichi:



label


>

 

                        @Html.DropDownList(



"progtype"

, progTypesList, 

new

 { @class = 



"form-control"

 }) 


                    

div


>

 

                



div


>

 

                



<

div


 

class


="pull-right">

 

                    



<

div


 

class


="form-group">

 

                        



<

b

>



Yozuvlar soni: 

b

><



span

>

@ViewBag.TotalItemCount



span


>

 

                        



<

label


 

for


="pagesize">

Sahifadagi yozuvlar soni:



label


>

 

                        @Html.DropDownList(



"pagesize"

, pagesizes, 

new

 { @class = 



"form-control"

 }) 


                    

div


>

 

                



div


>

 



68 

 

            



div


>

 

            



<

div


 

class


="row"

 

style



="

padding-bottom

:

10px">


 

                



<

div


 

class


="form-group">

 

                    



<

label


 

for


="pname">

Nomi:


label


>

 

                    @Html.TextBox(



"pname"

, Request.QueryString[

"pname"

], 


new

 { @class 

"form-control"



, style = 

"width:220px"

 }) 

                



div


>

 

                



<

div


 

class


="form-group">

 

                    



<

label


 

for


="yname">

Yo'nalish:



label


>

 

                    @Html.TextBox(



"yname"

, Request.QueryString[

"yname"

], 


new

 { @class 

"form-control"



, style = 

"width:220px"

 }) 

                



div


>

 

 



            

div


>

 

            



<

div


 

class


="row">

 

                



<

div


 

class


="col-md-12"

 

style



="

margin-bottom

:

5px">


 

                    



<

div


 

class


=" pull-right">

 

                        



<

button


 

type


="submit"

 

class



="btn btn-success"><

i

 



class

="fa fa-


search">i

>



 Izlash

button


>

 

                    



div


>

 

                



div


>

 

            



div


>

 

            



<

div


 

class


="row">

 

                



<

hr

 



/>

 

            



div


>

 

        



form


>

 

        



<

div


>

 

            



<

div


 

class


="row">

 

                @



if

 (Model != 

null

 && Model.Count > 0) 



                { 

                    



<

table


 

class


="table table-striped">

 

                        



<

tr

>



 

                            



<

th

>



O'quv reja nomi

th

>



 

                            



<

th

>



Yo'nalish

th

>



 

                            



<

th

>



Fakultet

th

>



 

                            



<

th

>



Ta'lim bosqichi

th

>



 

                            



<

th

>

th

>

 



                        

tr

>



 

                        @

foreach

 (var prog 

in

 Model) 


                        { 

                            k++; 

                            

<

tr

>



 

                                



<

td

>



 

                                    @prog.NAME 

                                

td

>



 

                                



<

td

>



@prog.Ynom

td

>



 

                                



<

td

>



@prog.NAME_DEP

td

>



 

                                



<

td

>



@prog.TYPE_PROGRAMNAME

td

>



 

                                



<

td

 



class

="text-right">

 

                                    



<

a

 



href

="

@Url.Action(



"Details"

new



 

{Id=prog.ID_PROGRAM })

">

Batafsil


a

>



 

                                



td

>



 

                            



tr

>



 

                        } 

                    

table


>

 

                    



<

p

>



 

                        @Html.Pager(PageSize.Value, PageNumber.Value, 

TotalItemCount.Value).Options(o => o 

                        .DisplayTemplate(

"Bootstrap3Pagination"

                        .MaxNrOfPages(14) 



                        .AlwaysAddFirstPageNumber() 

                        

.SetPreviousPageText(

"←"


).SetNextPageText(

"→"


).AddRouteValue(

"yname"


Request.QueryString[

"yname"

]) 



69 

 

                         .AddRouteValue(



"pname"

, Request.QueryString[

"pname"

]) 


                         .AddRouteValue(

"progtype"

, Request.QueryString[

"progtype"

]) 

                        .AddRouteValue(



"dep"

, Request.QueryString[

"dep"

]) 


                        .AddRouteValue(

"pagesize"

, Request.QueryString[

"pagesize"

])); 

                    



p

>



 

 

                } 



                

else


 

                { 

                    

<

div


 

class


="alert alert-info">

Birorta ham o'quv reja 

kiritilmagan.

div


>

 

                } 



            

div


>

 

 



        

div


>

 

    



div


>

      


 

Download 4,12 Mb.

Do'stlaringiz bilan baham:
1   ...   17   18   19   20   21   22   23   24   25




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish