public void getContactComm(Guid contactId)
        {
            contactCommService  contactComm = new contactCommService();
            List <contactComms> dataList    = contactComm.getContactAllComm(contactId);

            CommTypes commTypes = new CommTypes();

            var dataGridValues = (from I in dataList
                                  select new
            {
                id = I.id,
                commType = commTypes.getCommTypes().Find(x => x.Id == I.commType).Value,
                commValue = I.commValue
            }).ToList();

            grdComm.DataSource = dataGridValues;

            grdComm.Columns["id"].Visible = false;

            grdComm.Columns["commType"].HeaderText = "İletişim Tip";
            grdComm.Columns["commType"].Width      = 100;

            grdComm.Columns["commValue"].HeaderText = "İletişim Degeri";
            grdComm.Columns["commValue"].Width      = 300;
        }
示例#2
0
        void getContactTypes()
        {
            CommTypes commTypes = new CommTypes();

            cmbCommTypes.DataSource    = commTypes.getCommTypes();
            cmbCommTypes.DisplayMember = "Value";
            cmbCommTypes.ValueMember   = "Id";
        }
        void getCommTypes()
        {
            CommTypes        comm     = new CommTypes();
            List <CommTypes> dataList = comm.getCommTypes();

            cmbCommTypes.DataSource    = dataList;
            cmbCommTypes.DisplayMember = "Value";
            cmbCommTypes.ValueMember   = "Id";
        }
示例#4
0
        private void btnCommUpdate_Click(object sender, EventArgs e)
        {
            // ((CommTypes)cmbCommTypes.SelectedItem).Id;
            CommTypes comboBoxSelected = (CommTypes)cmbCommTypes.SelectedItem;

            contactCommService contactComm = new contactCommService();
            int resultInt = contactComm.updateContactComm(dataComm.id, comboBoxSelected.Id, txtCommValue.Text);

            if (resultInt > 0)
            {
                MessageBox.Show("Güncelleme işlemi başarılı", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);

                viewUpdateContact viewUpdate = (viewUpdateContact)Application.OpenForms["viewUpdateContact"];
                viewUpdate.getContactComm(dataContact.id);

                this.Close();
            }
        }
        private void btnCommNew_Click(object sender, EventArgs e)
        {
            // ((CommTypes)cmbCommTypes.SelectedItem).Id
            CommTypes selectedComm = (CommTypes)cmbCommTypes.SelectedItem;

            contactCommService contactComm = new contactCommService();
            int resultInt = contactComm.addNewComm(data.id, selectedComm.Id, txtCommValue.Text);

            if (resultInt > 0)
            {
                MessageBox.Show("Kayıt Başarılı", "Bilgilendirme", MessageBoxButtons.OK, MessageBoxIcon.Information);

                viewUpdateContact viewForm = (viewUpdateContact)Application.OpenForms["viewUpdateContact"];
                viewForm.getContactComm(data.id);

                // ((viewUpdateContact)Application.OpenForms["viewUpdateContact"]).getContactComm(data.id);

                this.Close();
            }
        }