Exemplo n.º 1
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            string strVal = ValidationMethot();

            if (strVal == "")
            {
                BLL.Color oColor = new BLL.Color();
                if (this.CID == 0)
                {
                    oColor.ID = 0;
                }
                else
                {
                    oColor.ID = CID;
                }

                oColor.Name    = txtColorName.Text;
                oColor.RGBCode = txtRGBCode.Text;  // kontrol yapilmali
                oColor.State   = BLL.Enumarations.State.Aktif;

                int nResult = oColor.Save();
                if (nResult == 0)
                {
                    MessageBox.Show("Renk başarılı bir şekilde kaydedildi");
                }
            }
            else
            {
                MessageBox.Show(strVal);
            }
        }
 private void imgColorSearch_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (e.LeftButton == MouseButtonState.Pressed)
     {
         var window = new W_PickColorForOrder()
         {
             Title         = "Boyanacak Rengi Seç",
             ShowInTaskbar = false,
             Topmost       = true,
             ResizeMode    = ResizeMode.NoResize,
             Owner         = Application.Current.MainWindow,
         };
         if (window.ShowDialog() == false)
         {
             BLL.Color SelectedColor = window.SelectedColor;
             if (SelectedColor != null)
             {
                 cmbColor.SelectedValue = SelectedColor.ID.ToString();
             }
         }
     }
 }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     this.SelectedColor = new BLL.Color(Int32.Parse((sender as Button).CommandParameter.ToString()), BLL.Enumarations.State.Aktif);
     this.Close();
 }
        private void LoadDetail()
        {
            switch (this.Status)
            {
            case 2:
                cmbOPStatus.SelectedIndex = 0;
                cmbOPStatus.IsEnabled     = false;
                btnSearch.IsEnabled       = false;
                break;

            case 3:
                cmbOPStatus.SelectedIndex = 1;
                break;

            case 4:
                cmbOPStatus.SelectedIndex = 2;
                break;

            case 5:
                cmbOPStatus.SelectedIndex = 3;
                break;

            case 6:
                cmbOPStatus.SelectedIndex = 4;
                break;

            default:
                break;
            }
            foreach (DataRow item in dtDetailedOrder.Rows)
            {
                if (item["PID"].ToString() == this.PID.ToString())
                {
                    BLL.Color oColor = new BLL.Color(Int32.Parse(item["Color"].ToString()), BLL.Enumarations.State.Aktif);
                    if (oColor.Name == null)
                    {
                        txtColor.Text = "Boya Yok";
                    }
                    else
                    {
                        txtColor.Text = oColor.Name;
                    }

                    txtOemCode.Text        = new BLL.Product(this.PID, BLL.Enumarations.State.Aktif).Code;
                    txtPaintCount.Text     = item["Count"].ToString();
                    txtStockCount.Text     = item["UsedStockAmount"].ToString();
                    txtProductedCount.Text = item["ProductedAmount"].ToString();
                    txtPaintedCount.Text   = item["PaintedAmount"].ToString();
                    txtDeliveredCount.Text = item["DeliveredAmount"].ToString();
                    var bc = new BrushConverter();
                    if (oColor.RGBCode != null)
                    {
                        brdRGBColor.Background = (Brush)bc.ConvertFrom(oColor.RGBCode);
                    }
                    else
                    {
                        brdRGBColor.Background = (Brush)bc.ConvertFrom("#FFF");
                    }
                }
            }
        }