コード例 #1
0
        private void btnKaydet_Click(object sender, EventArgs e)
        {
            IsEmptyKontrol();
            if (!string.IsNullOrEmpty(txtNumber.Text.Trim()))//samet ekledi
            {
                PozModel model = new PozModel();
                model.Description = txtDescription.Text;
                model.Number      = txtNumber.Text;
                model.Unit        = txtUnit.Text;
                model.IsActive    = true;
                model.UnitPrice   = double.Parse(txtUnitPrice.Text.Replace("TL", string.Empty), CultureInfo.InvariantCulture);

                List <Poz> existingPozs = UIPozManager.Instance.GetPoz(model.Number);
                if (existingPozs != null && existingPozs.Count != 0)
                {
                    frm_MesajFormu mf = new frm_MesajFormu();
                    mf.lblMesaj.Text = "Bu Poz numarasi ile kayit bulunmaktadir";
                    mf.ShowDialog();
                    this.txtNumber.Text = "";
                }
                else
                {
                    model.Save();
                    FormClear();
                    LoadPozGrid();
                    //frm_MesajFormu mf = new frm_MesajFormu();
                    //mf.lblMesaj.Text = "Malzeme Kaydedildi...";
                    //mf.ShowDialog();
                    UIPopupManager.Instance.ShowPopup();
                }
            }
        }
コード例 #2
0
 private void btnGuncelle_Click(object sender, EventArgs e)
 {
     IsEmptyKontrol();
     if (this.CurrentPoz != null)
     {
         PozModel model = new PozModel(this.CurrentPoz);
         model.Description = txtDescription.Text;
         model.Number      = txtNumber.Text;
         model.Unit        = txtUnit.Text;
         model.UnitPrice   = double.Parse(txtUnitPrice.Text.Replace("TL", string.Empty));
         model.Save();
         //PozProvider.Instance.Save()
         //frm_MesajFormu mf = new frm_MesajFormu();
         //mf.lblMesaj.Text = "Kayıt Güncellendi...";
         //mf.ShowDialog();
         UIPopupManager.Instance.ShowPopup();
         this.Close();
         this._owner.LoadPozGrid();
     }
 }