Esempio n. 1
0
        /// <summary>
        /// Sorgula butonuna tıklanıldığında gerçekeleşecek olaylar yazılmaktadır ..
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSorgula_Click(object sender, EventArgs e)
        {
            List <sevk>  dischargedList = new List <sevk>();
            List <sevk>  taburcuList    = new List <sevk>();
            SevkContract contract       = new SevkContract();

            dischargedList = contract.SelectDischarged("", "");
            int number = 0;

            #region Değerler alınıyor ..
            string beginDate = dateTimePickerBegin.Value.ToShortDateString();
            string endDate   = dateTimePickerEnd.Value.ToShortDateString();

            if (rbTaburcu.Checked)
            {
                taburcuList = contract.GetDischargedDateTimeTo("Oldu");
            }
            if (rbTaburcuDegil.Checked)
            {
                taburcuList = contract.GetDischargedDateTimeTo("Olmadı");
            }
            #endregion
            #region Empty Control
            if (rbHepsi.Checked == false && rbTaburcu.Checked == false && rbTaburcuDegil.Checked == false)
            {
                MessageBox.Show("Sorgulama Yapabilmek İçin Kriterlerden (RadioButton) 'lardan Birini Seçmeniz Gerek !!!", "UYARI", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
            #endregion
            #region --> Taburcu RadioButtona tıklanıldığında <--
            if (rbTaburcu.Checked)
            {
                dtgYapilanIslemSonuc.Rows.Clear();
                foreach (var item in taburcuList)
                {
                    dtgYapilanIslemSonuc.Rows.Add();
                    dtgYapilanIslemSonuc.Rows[number].Cells[0].Value = item.Polyclinic;
                    dtgYapilanIslemSonuc.Rows[number].Cells[1].Value = item.Secret;
                    dtgYapilanIslemSonuc.Rows[number].Cells[2].Value = item.Clock;
                    dtgYapilanIslemSonuc.Rows[number].Cells[3].Value = item.Transaction;
                    dtgYapilanIslemSonuc.Rows[number].Cells[4].Value = item.DrCode;
                    dtgYapilanIslemSonuc.Rows[number].Cells[5].Value = item.Quantity;
                    dtgYapilanIslemSonuc.Rows[number].Cells[6].Value = item.UnitPrice;

                    number++;
                }
            }

            #endregion
            #region --> Taburcu Değil RadioButtona tıklanıldığında <--
            else if (rbTaburcuDegil.Checked)
            {
                dtgYapilanIslemSonuc.Rows.Clear();
                foreach (var item in taburcuList)
                {
                    dtgYapilanIslemSonuc.Rows.Add();
                    dtgYapilanIslemSonuc.Rows[number].Cells[0].Value = item.Polyclinic;
                    dtgYapilanIslemSonuc.Rows[number].Cells[1].Value = item.Secret;
                    dtgYapilanIslemSonuc.Rows[number].Cells[2].Value = item.Clock;
                    dtgYapilanIslemSonuc.Rows[number].Cells[3].Value = item.Transaction;
                    dtgYapilanIslemSonuc.Rows[number].Cells[4].Value = item.DrCode;
                    dtgYapilanIslemSonuc.Rows[number].Cells[5].Value = item.Quantity;
                    dtgYapilanIslemSonuc.Rows[number].Cells[6].Value = item.UnitPrice;

                    number++;
                }
            }
            #endregion
            #region --> Hepsi RadioButtona tıklanıldığında <--
            else if (rbHepsi.Checked)
            {
                dtgYapilanIslemSonuc.Rows.Clear();
                foreach (var item in dischargedList)
                {
                    dtgYapilanIslemSonuc.Rows.Add();
                    dtgYapilanIslemSonuc.Rows[number].Cells[0].Value = item.Polyclinic;
                    dtgYapilanIslemSonuc.Rows[number].Cells[1].Value = item.Secret;
                    dtgYapilanIslemSonuc.Rows[number].Cells[2].Value = item.Clock;
                    dtgYapilanIslemSonuc.Rows[number].Cells[3].Value = item.Transaction;
                    dtgYapilanIslemSonuc.Rows[number].Cells[4].Value = item.DrCode;
                    dtgYapilanIslemSonuc.Rows[number].Cells[5].Value = item.Quantity;
                    dtgYapilanIslemSonuc.Rows[number].Cells[6].Value = item.UnitPrice;

                    number++;
                }
            }
            #endregion

            number = 0;
        }