예제 #1
0
        private void ТаблицаСообщения_CellEditEnding(object sender, Microsoft.Windows.Controls.DataGridCellEditEndingEventArgs e)
        {
            if (e.Column.DisplayIndex == 7)
            {
                СменитьСтатусЗадачи((DataRowView)e.Row.Item);

                //var status = ((DataRowView)e.Row.Item)["Статус"].Equals("В работе") ? "Готово" : "В работе";
                //((DataRowView)e.Row.Item)["Статус"] = status;
                //((DataRowView)e.Row.Item)["ДатаЗавершения"] = status == "Готово" ? (object)DateTime.Now : Convert.DBNull;

                //ThreadPool.QueueUserWorkItem((WaitCallback)delegate(object __e)
                //{
                //    try
                //    {
                //        using (RosService.Client client = new RosService.Client())
                //        {
                //            var v = new Dictionary<string, object>();
                //            v.Add("ДатаЗавершения", status == "Готово" ? (object)DateTime.Now : null);
                //            v.Add("Статус", status);
                //            client.Архив.СохранитьЗначение((decimal)__e, v, RosService.Data.Хранилище.Оперативное, false);
                //        }
                //    }
                //    catch (Exception)
                //    {

                //    }
                //}, ((DataRowView)e.Row.Item)["id_node"]);
            }
        }
예제 #2
0
 protected override void OnCellEditEnding(Microsoft.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
     continueEdit = e.EditAction == Microsoft.Windows.Controls.DataGridEditAction.Commit;
     Logging.Client.DebugFormat("OnCellEditEnding(EditAction = {0})", e.EditAction);
     Logging.Client.DebugFormat("    continueEdit={0}, isNewItem={1}", continueEdit, isNewItemForContinueEdit);
     base.OnCellEditEnding(e);
 }
예제 #3
0
        private void dataGrid2_CellEditEnding(object sender, Microsoft.Windows.Controls.DataGridCellEditEndingEventArgs e)
        {
            if (e.Row.Item != null)
            {
                CommonResource.HomeAndQuantity result = e.Row.Item as CommonResource.HomeAndQuantity;
                TextBox t        = e.EditingElement as TextBox;
                decimal quantity = 1;
                bool    ok       = true;
                string  message  = "";

                try
                {
                    quantity = decimal.Parse(t.Text);
                }
                catch (Exception ex)
                {
                    message = "Please enter a valid quantity!";
                    ok      = false;
                }


                if (ok)
                {
                    if (quantity != result.Quantity)
                    {
                        cr.UpdateQuantityAtHomeFacade(cmbArea.SelectedValue.ToString(), cmbGroup.SelectedValue.ToString(), result.HomeID.ToString(), quantity.ToString(), usercode);
                    }
                }
                else
                {
                    MessageBox.Show(message);
                }
            }
        }
예제 #4
0
 private void McDataGrid_CellEditEnding_1(object sender, Microsoft.Windows.Controls.DataGridCellEditEndingEventArgs e)
 {
     if (McDataGrid.SelectedItem != null)
     {
         ((MStockitem)McDataGrid.SelectedItem).IsChanged = true;
         OnPropertyChangd(nameof(ClStockitem));
     }
 }
예제 #5
0
        public void OnCellEditEnding(object sender, Microsoft.Windows.Controls.DataGridCellEditEndingEventArgs e)
        {
            try
            {
                TextBox tb = e.EditingElement as TextBox;
                Microsoft.Windows.Controls.DataGrid dg = sender as Microsoft.Windows.Controls.DataGrid;
                string column = e.Column.SortMemberPath;

                if (ProductWeightSelectedItem != null)
                {
                    if (column == "SIGN")
                    {
                        if (!(tb.Text == "-" || tb.Text == "+"))
                        {
                            tb.Undo();
                        }
                    }

                    ProductWeightSelectedItem.BeginEdit();

                    if (column == "VAL1" || column == "VAL2" || column == "VAL3" || column == "SIGN")
                    {
                        ProductWeightSelectedItem[column] = tb.Text;
                    }

                    double pvVAL1 = 0, pvVAL2 = 0, pvVAL3 = 0;
                    if ((column == "VAL1" || column == "VAL1" || column == "VAL1" || column == "VOLUME") || ProductWeightSelectedItem["SHAPE_CODE"].ToString() != "")
                    {
                        if (ProductWeightSelectedItem["VAL1"].ToString() != "")
                        {
                            pvVAL1 = Convert.ToDouble(ProductWeightSelectedItem["VAL1"]);
                        }
                        if (ProductWeightSelectedItem["VAL2"].ToString() != "")
                        {
                            pvVAL2 = Convert.ToDouble(ProductWeightSelectedItem["VAL2"]);
                        }
                        if (ProductWeightSelectedItem["VAL3"].ToString() != "")
                        {
                            pvVAL3 = Convert.ToDouble(ProductWeightSelectedItem["VAL3"]);
                        }

                        if (ProductWeightSelectedItem["SHAPE_CODE"].ToString() == "DH" && (pvVAL1 > 0 || pvVAL2 > 0) && pvVAL1 == pvVAL2)
                        {
                            MessageBox.Show("Dimension-II Value should not be equals to Dimension-I value.", ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                            pvVAL2 = 0;
                            ProductWeightSelectedItem["VAL2"]   = 0;
                            ProductWeightSelectedItem["VOLUME"] = 0;
                        }

                        if (ProductWeightSelectedItem["SHAPE_CODE"].ToString() == "DH" && pvVAL2 > pvVAL1)
                        {
                            MessageBox.Show("Dimension-II  Value should not be greater than Dimension-I value.", ApplicationTitle, MessageBoxButton.OK, MessageBoxImage.Information);
                            pvVAL2 = 0;
                            ProductWeightSelectedItem["VAL2"]   = 0;
                            ProductWeightSelectedItem["VOLUME"] = 0;
                        }

                        if (pvVAL1 != 0 && pvVAL2 != 0)
                        {
                            ProductWeightSelectedItem["VOLUME"] = VolumeCalculation(ProductWeightSelectedItem["SHAPE_CODE"].ToString(), pvVAL1, pvVAL2, pvVAL3);
                        }
                        else
                        {
                            ProductWeightSelectedItem["VOLUME"] = 0;
                        }


                        if (ProductWeightSelectedItem["SIGN"].ToString() == "-")
                        {
                            ProductWeightSelectedItem["VOLUME"] = 0 - Math.Abs(Convert.ToDouble(ProductWeightSelectedItem["VOLUME"]));
                        }
                        else
                        {
                            ProductWeightSelectedItem["VOLUME"] = Math.Abs(Convert.ToDouble(ProductWeightSelectedItem["VOLUME"]));
                        }
                    }
                    ProductWeightSelectedItem.EndEdit();


                    if (column == "SHAPE_CODE" && ProductWeightSelectedItem["SHAPE_CODE"].ToString() != "")
                    {
                        if (ProductWeight.DVShapeDetails[ProductWeight.DVShapeDetails.Count - 1]["SHAPE_CODE"].ToString() != "")
                        {
                            ProductWeight.DVShapeDetails.AddNew();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }