예제 #1
0
        private void LoadDetail()
        {
            DataTable dt = BLL.Order.GetOrderDetailListByOrderID(this.OID);

            foreach (DataRow item in dt.Rows)
            {
                if (item["PID"].ToString() == this.PID.ToString())
                {
                    if (item["IsRawMaterialsUsed"].ToString() == "1")
                    {
                        this.oPickedRawMaterial = new BLL.RawMaterials(Int32.Parse(item["RawMaterialID"].ToString()), BLL.Enumarations.State.Aktif);
                        FillControls();
                        txtUsedAmount.Text             = item["UsedRawMaterialsAmount"].ToString();
                        tblRawMaterialsUsed.Visibility = Visibility.Visible;
                        btnSave.Visibility             = Visibility.Collapsed;
                        txtUsedAmount.IsEnabled        = false;
                        btnCancel.Visibility           = Visibility.Visible;
                        btnPickRawMaterial.IsEnabled   = false;
                    }
                    else
                    {
                        btnSave.Visibility           = Visibility.Visible;
                        btnCancel.Visibility         = Visibility.Collapsed;
                        btnPickRawMaterial.IsEnabled = true;
                    }
                }
            }
        }
예제 #2
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            string strVal = ValidationMethot();

            if (strVal == "")
            {
                BLL.RawMaterials oRawMaterials = new BLL.RawMaterials();
                if (this.Id == 0)
                {
                    oRawMaterials.ID = 0;
                }
                else
                {
                    oRawMaterials.ID = Id;
                }

                oRawMaterials.WireDiameter     = Int32.Parse(txtWireDiameter.Text);
                oRawMaterials.Hardness         = Int32.Parse(txtHardness.Text);
                oRawMaterials.Compound         = txtCompound.Text;
                oRawMaterials.Amount           = Int32.Parse(txtAmount.Text);
                oRawMaterials.Quality          = txtQuality.Text;
                oRawMaterials.SurfaceCondition = txtSurfaceCondition.Text;
                oRawMaterials.State            = (BLL.Enumarations.State)cmbState.SelectedValue;

                int nResult = oRawMaterials.Save();
                if (nResult == 0)
                {
                    MessageBox.Show("Hammadde girişi  başarılı bir şekilde tamamlandı.");
                }
            }
            else
            {
                MessageBox.Show(strVal);
            }
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if ((sender as Button).CommandParameter != null)
     {
         this.SelectedRawMaterials = new BLL.RawMaterials(Int32.Parse((sender as Button).CommandParameter.ToString()), BLL.Enumarations.State.Aktif);
         this.Close();
     }
 }
예제 #4
0
 private void ClearControls()
 {
     oPickedRawMaterial       = null;
     txtCompound.Text         = "";
     txtHardness.Text         = "";
     txtQuality.Text          = "";
     txtSurfaceCondition.Text = "";
     txtWireDiameter.Text     = "";
 }
예제 #5
0
        private void btnPickRawMaterial_Click(object sender, RoutedEventArgs e)
        {
            var window = new W_PickRawMaterialsForOrder()
            {
                Title         = "Hammadde Seç",
                ShowInTaskbar = false,
                Topmost       = true,
                ResizeMode    = ResizeMode.CanMinimize,
                Owner         = Application.Current.MainWindow,
            };

            if (window.ShowDialog() == false)
            {
                if (window.SelectedRawMaterials.ID != 0)
                {
                    this.oPickedRawMaterial = window.SelectedRawMaterials;
                    FillControls();
                }
            }
        }