Axborot tеxnologiyalari univеrsitеti



Download 5,98 Mb.
bet84/134
Sana20.07.2022
Hajmi5,98 Mb.
#829272
1   ...   80   81   82   83   84   85   86   87   ...   134

Download 5,98 Mb.

Do'stlaringiz bilan baham:
Qator["Xarajatlar"] =15; Qator["Daromat"] =45;

  • Qator["Sof daromat"] =Convert::ToInt64(Qator["Daromat"])-

  • Convert::ToInt64(Qator["Xarajatlar"]);

  • Jadval->Rows->Add(Qator);

  • //5- qatorni qo'shamiz:

  • Qator = Jadval->NewRow();

  • Qator["Oy"] ="Sentyabr"; Qator["Sotib olingan max.soni"]=50;

  • Qator["Xarajatlar"] =20; Qator["Daromat"] =55;

  • Qator["Sof daromat"] =Convert::ToInt64(Qator["Daromat"])-

  • Convert::ToInt64(Qator["Xarajatlar"]);

  • Jadval->Rows->Add(Qator);

  • dataGridView1->DataSource = Jadval;

  • chart1->DataSource = Jadval;

  • chart1->Series["Series1"]->XValueMember = "Oy";

  • chart1->Series["Series2"]->XValueMember = "Oy";

  • chart1->Series["Series1"]->YValueMembers = "Sotib olingan max.soni";

  • chart1->Series["Series2"]->YValueMembers = "Sof daromat";

  • chart1->Series["Series1"]->ChartType =

  • System::Windows::Forms::DataVisualization::Charting::

  • SeriesChartType::Column;

  • chart1->Series["Series2"]->ChartType =

  • System::Windows::Forms::DataVisualization::Charting::

  • SeriesChartType::Column;

  • // Diogrammaning turi quyidagicha bo'lishi ham

  • //mumkin. masalan: Pie, Line va bohqa.

  • chart1->Series["Series1"]->Color = Color::Aqua;

  • chart1->Series["Series2"]->Color = Color::Yellow;

  • chart1->DataBind();} }



    Button1 tugmasini click xodisasining kodlari quyidagicha:

    1. private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {dio(); }

    2. void dio(){

    3. this->Text = "Grafik ma'lumotlar";

    4. Jadval = gcnew DataTable();

    5. Jadval->Columns->Add("Oy", String::typeid);

    6. Jadval->Columns->Add("Sotib olingan max.soni", Int64::typeid);

    7. Jadval->Columns->Add("Xarajatlar", Int64::typeid);

    8. Jadval->Columns->Add("Daromat", Int64::typeid);

    9. Jadval->Columns->Add("Sof daromat", Int64::typeid);

    10. DataRow ^ Qator = Jadval->NewRow();

    11. Qator["Oy"] = dataGridView1->Rows[0]->Cells[0]->Value;

    Qator["Sotib
    olingan max.soni"] =dataGridView1->Rows[0]->Cells[1]->Value;

    1. Qator["Xarajatlar"] =dataGridView1->Rows[0]->Cells[2]->Value;

    2. Qator["Daromat"] =dataGridView1->Rows[0]->Cells[3]->Value;

    3. Qator["Sof daromat"] =Convert::ToInt64(dataGridView1->

    4. Rows[0]->Cells[3]->Value) -Convert::ToInt64(

    5. dataGridView1->Rows[0]->Cells[2]->Value);

    6. Jadval->Rows->Add(Qator);

    7. Qator = Jadval->NewRow();

    8. Qator["Oy"] =dataGridView1->Rows[1]->Cells[0]->Value;

    9. Qator["Sotib olingan max.soni"] = dataGridView1->Rows[1]-

    >Cells[1]->Value;

    1. Qator["Xarajatlar"] =dataGridView1->Rows[1]->Cells[2]->Value;

    2. Qator["Daromat"] =dataGridView1->Rows[1]->Cells[3]->Value;

    3. Qator["Sof daromat"] =Convert::ToInt64(dataGridView1-> Rows[1]->Cells[3]->Value) -Convert::ToInt64(

    4. dataGridView1->Rows[1]->Cells[2]->Value);

    5. Jadval->Rows->Add(Qator); Qator = Jadval->NewRow();

    6. Qator["Oy"] = dataGridView1->Rows[2]->Cells[0]->Value;

    7. Qator["Sotib

    8. olingan max.soni"] = dataGridView1->Rows[2]->Cells[1]->Value;

    9. Qator["Xarajatlar"] =dataGridView1->Rows[2]->Cells[2]->Value;

    10. Qator["Daromat"] =dataGridView1->Rows[2]->Cells[3]->Value;

    11. Qator["Sof daromat"] =Convert::ToInt64( dataGridView1->Rows[2]->Cells[3]->Value)

    12. Convert::ToInt64(dataGridView1->Rows[2]->Cells[2]->Value);

    13. Jadval->Rows->Add(Qator); Qator = Jadval->NewRow();

    14. Qator["Oy"] = dataGridView1->Rows[3]->Cells[0]->Value; Qator["Sotib olingan max.soni"] = dataGridView1->Rows[3]-

    >Cells[1]->Value;

    1. Qator["Xarajatlar"] =dataGridView1->Rows[3]->Cells[2]->Value;

    2. Qator["Daromat"] =dataGridView1->Rows[3]->Cells[3]->Value;

    3. Qator["Sof daromat"] =Convert::ToInt64(dataGridView1->Rows[3]-

    >Cells[3]->Value) -Convert::ToInt64(

    1. dataGridView1->Rows[3]->Cells[2]->Value);

    2. Jadval->Rows->Add(Qator); Qator = Jadval->NewRow();

    3. Qator["Oy"] = dataGridView1->Rows[4]->Cells[0]->Value; Qator["Sotib olingan max.soni"] = dataGridView1->Rows[4]-

    >Cells[1]->Value;

    1. Qator["Xarajatlar"] =dataGridView1->Rows[4]->Cells[2]->Value;

    2. Qator["Daromat"] =dataGridView1->Rows[4]->Cells[3]->Value;

    3. Qator["Sof daromat"] =Convert::ToInt64(

    dataGridView1->Rows[4]->Cells[3]->Value) -Convert::ToInt64( dataGridView1->Rows[4]->Cells[2]->Value);

    1. Jadval->Rows->Add(Qator);

    2. // chart1 komponentasiga Jadvalni eksport qilish

    3. chart1->DataSource = Jadval;

    4. //chart1 komponentasidagi Serie1 ning X kordinatasiga Oy so'zini yozish

    5. chart1->Series["Series1"]->XValueMember = "Oy";

    6. // chart1 komponentasidagi Serie1 ning X kordinatasiga Oy so'zini yozish

    7. chart1->Series["Series2"]->XValueMember = "Oy//chart1 komponentasidagi

    8. //Serie1 ning Y kordinatasiga Sotib olingan max.soni so'zini yozish

    9. chart1->Series["Series1"]->YValueMembers = "Sotib olingan max.soni";

    10. // chart1 komponentasidagi Serie2 ning Y kordinatasiga Sof daromat so'zini yozish

    11. chart1->Series["Series2"]->YValueMembers = "Sof daromat";

    12. chart1->Series["Series1"]->ChartType = System::Windows::Forms::

    13. DataVisualization::Charting::SeriesChartType::Column;

    14. chart1->Series["Series2"]->ChartType = System::Windows::Forms::

    15. DataVisualization::Charting::SeriesChartType::Column;

    16. chart1->Series["Series1"]->Color = Color::Aqua;

    17. chart1->Series["Series2"]->Color = Color::Green;

    18. //chart1->Series["Series1"]->IsVisibleInLegend = false;

    19. chart1->DataBind();

    20. //DadaGridView1 komponentasiga Jadvalni eksport qilish

    21. dataGridView1->DataSource = Jadval; }

    1. qadam. Jadvaldan kiritilgan qiymatlar natijaga darxol ta`sir qilishi uchun dataGridView1 ning CellEndEdit xodisasiga dio() funksiyasi chaqiriladi. Ahamiyat bеrilgan bo‘lsa, button1 ga ham chaqirilgan edi. Ushbu kod quyidagicha:

    1. private: System::Void dataGridView1_CellEndEdit(System::Object^

    2. sender, System::Windows::Forms::DataGridViewCellEventArgs^ e) {

    3. dio(); }

    1. qadam. listBox1da diagrammani ko‘rinishlarini o‘zgartirish mumkin. Buning uchun listBox ning SelectedIndexChanged hodisasining kodlari quyidagicha bo‘lishi kеrak:

    1. private: System::Void listBox1_SelectedIndexChanged(System::Object^

    2. sender, System::EventArgs^ e) {

    3. if (listBox1->Text == "Transparent") return;

    4. this->chart1->Series["Series1"]->ChartTypeName=(listBox1->Text) ;

    5. this->chart1->Series["Series2"]->ChartTypeName=(listBox1->Text) ;

    }

    Dasturda diagrammani ko‘rinishi quyidagicha:



    3.39- rasm. Diagrammani sozlash oynasi


      1. Veb brouzеrda HTML jadvallarni tasvirlash va shakllantirish



    Bizga ma`lumki HTML tеglari yordamida vеb ilovalar yaratiladi va bu ilovalar jamlanib, vеb sayt tashkil etiladi. Vеb ilovalarni yoki global tarmoqga ulangan saytlarni amaliy dasturda ochish imkonini bеruvchi komponеnta bu WebBrowser komponеntasi hisoblanadi. Ushbu komponеnta orqali nafaqat saytlarni ochish, balki HTML kodlarida tеrilgan tеkst (tеg) larni ham chiqarish va tahrirlash imkoniyatlari mavjud. Quyidagi namunada tuziladigan dasturda HTML tеglari ishlatilgan. Masalan:

    -matnni 16 shriftda ko‘rsatadi.
    - jadval yaratadi. -jadvalning ustunini yaratadi.
    - jadvalning satrlarini yaratadi. 8- jadvalda kеltirilgan ma`lumotlar matnli faylda tashkil qilinadi. Ushbu fayl o‘qish uchun ochiladi va uning ma`lumotlari ma`lum o‘zgaruvchilarga o‘zlashtirilgan holda, sikl asnosida webBrowser komponеntasi yordamida ekranga tartiblangan ko‘rinishida chiqariladi.
    Ushbu vazifani bajaruvchi dasturni tuzish uchun Visual Studio 2012 dasturi ishga tushiriladi, asosiy oyna mеnyu bo‘limlaridan File-
    >New->Project… buyruqlari bеriladi yoki Ctrl+Shift+N klavishalari bosiladi, ochilgan oynada loyihaga “HTML_xujjatlar” nomi bеrilib OK tugmasi bosiladi. Dasturning umumiy ko‘rinishi quyidagicha bo‘ladi:

    3.30- rasm. Dasturning umumiy ko‘rinish oynasi

    Dasturni tuzish quyidagi qadamlardan tashkil topgan:



    1. qadam. Formaga webBrowser komponеntasini tashlang va

    Form1ning load hodisasining kodlari quyidagicha:

        1. #pragma endregion

        2. private: System::Void Form1_Load(System::Object^ sender,

        3. System::EventArgs^ e) {

        4. String^s="

          Oilam haqi ma`lumot

    border=\"1\"> ";

  • s+="
  • Nomeri"; s+="Qar_turi";

    6. s+="
    Fam"; s+="Ismi";

    1. s+="
    Tel nomeri
    ";

  • char qar_turi[20]=""; char Ismi[20]="";

    9. char Fam[20]=""; char Tel[20]="";
    10. String^ss=""; FILE *oqi; int i=1,n; bool dd;
    11. oqi=fopen("C:\\1.txt","r");

    1. if(oqi==NULL){MessageBox::Show("Not found");}

    2. while(!feof(oqi)){

    3. fgets(qar_turi,20,oqi); fgets(Fam,20,oqi);

    4. fgets(Ismi,20,oqi); dd=fgets(Tel,20,oqi);

    5. if(dd==0){break;}

    6. String^ Fq=gcnew String(qar_turi);

    7. String^ Fi=gcnew String(Ismi);

    8. String^ Fm=gcnew String(Fam);

    9. String^ Ft=gcnew String(Tel);

    21. s+="
  • "+i.ToString()+""; s+=""+Fq+"";
    22. s+="
    "+Fm+""; s+=""+Fi+"";
    23. s+="
    "+Ft+""; i++;} s+="
    ";
    24. webBrowser1->Navigate("about:" + s); }

    1. qadam. Formada saytlarni qidirish uchun Button va TextBox komponеntalari joylashtiriladi va Button1 tugmasining click hodisasining kodlari quyidagicha:

    1. private: System::Void button1_Click(System::Object^ sender,

    2. System::EventArgs^ e) { if (!this->textBox1->Text->Equals("") ){

    3. this->webBrowser1->Navigate( this->textBox1->Text );} }




    1. qadam. Manzillar oynasiga vеb sayt manzili yoziladigan

    TextBox1 hodisasi quyidagicha bo‘ladi:

    1. private:System::Void textBox1_KeyDown(System::Object^ sender,

    2. System::Windows:: Forms::KeyEventArgs^ e) {

    3. if ( e->KeyCode == System::Windows::Forms::Keys::Enter &&

    4. !this->textBox1->Text->Equals( "" ) ){ this->webBrowser1-

  • 1   ...   80   81   82   83   84   85   86   87   ...   134




    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