Ejemplo n.º 1
0
        private void btnEkle_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(txtTenderGroupDescription.Text))
            {
                TenderGroup item = new TenderGroup();
                item.Description = txtTenderGroupDescription.Text;

                if (UICurrentManager.Instance.CurrentTender.Groups != null)
                {
                    List <TenderGroup> existingItems = UICurrentManager.Instance.CurrentTender.Groups.Where(p => p.Description.Trim() == item.Description.Trim()).ToList();
                    if (existingItems != null && existingItems.Count != 0)
                    {
                        frm_MesajFormu message = new frm_MesajFormu();
                        message.lblMesaj.Text = "Bu grup adi zaten var.";
                        message.ShowDialog();
                    }
                    else
                    {
                        item.Tender = UICurrentManager.Instance.CurrentTender;
                        UICurrentManager.Instance.CurrentTender.Groups.Add(item);
                        TenderGroupProvider.Instance.Save(item);
                        this.LoadGrid();
                        txtTenderGroupDescription.Text = "";
                        txtTenderGroupDescription.Focus();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            object items = checkedComboboxEditSupplierSegments.Properties.GetCheckedItems();

            string[] selectedSegments = items.ToString().Split(';');

            IsEmptyKontrol();                                                                                                   //samet ekledi
            if (selectedSegments != null && selectedSegments.Count() != 0 && !string.IsNullOrEmpty(txtCompanyName.Text.Trim())) //samet ekledi
            {
                Supplier suplier = new Supplier();
                suplier.Address           = txtAddress.Text.Trim();
                suplier.AuthorNameSurname = txtAuthorNameSurname.Text.Trim();
                suplier.CompanyName       = txtCompanyName.Text.Trim();
                suplier.Email             = txtEmail.Text.Trim();
                suplier.GSM       = txtGSM.Text.Trim();
                suplier.IsActive  = true;
                suplier.Score     = txtScore.Text.Trim();
                suplier.Telephone = txtTelephone.Text.Trim();
                suplier.Country   = txtCountry.Text.Trim();
                suplier.TaxNumber = txtTaxNumber.Text.Trim();
                suplier.TaxOffice = txtTaxOffice.Text.Trim();
                if (selectedSegments != null && selectedSegments.Count() != 0)
                {
                    suplier.Segments = new List <SupplierSegment>();
                    foreach (var item in selectedSegments)
                    {
                        suplier.Segments.Add(new SupplierSegment()
                        {
                            Id = int.Parse(item)
                        });
                    }
                }
                OperationResult result = SupplierProvider.Instance.Save(suplier);
                if (result.Success)
                {
                    btnTemizle.PerformClick();
                    this.LoadGrid();
                    //frm_MesajFormu mf = new frm_MesajFormu();
                    //mf.lblMesaj.Text = "Tedarikçi Kaydedildi...";
                    //mf.ShowDialog();
                    UIPopupManager.Instance.ShowPopup();
                }
                else
                {
                    frm_MesajFormu mf = new frm_MesajFormu();
                    mf.lblMesaj.Text = "Kayıt Sırasında Bir Hata Oluştu...";
                    mf.ShowDialog();
                }
            }
        }