コード例 #1
0
 private void txtPONumber_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
     if (e.Value != null)
     {
         e.Value   = e.Value.ToString().ToUpper();
         e.Handled = true;
     }
 }
コード例 #2
0
        private void PictureEdit_FormatEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            var data = e.Value as System.Data.Linq.Binary;

            if (data != null)
            {
                e.Handled = true;
                e.Value   = data;
            }
        }
コード例 #3
0
ファイル: UCEmployeeList.cs プロジェクト: 5509850/baumax
        //private class IntToTimeFormatProvider : ICustomFormatter, IFormatProvider
        //{
        //    public object GetFormat(Type type)
        //    {
        //        if (type == typeof (ICustomFormatter))
        //        {
        //            return this;
        //        }
        //        return null;
        //    }

        //    public string Format(string format, object arg, IFormatProvider formatProvider)
        //    {
        //        int value = Convert.ToInt32(arg);

        //        int hour = value/60;
        //        int minute = value%60;

        //        return String.Format("{0:D2}:{1:D2}", hour, minute);
        //    }
        //}

        //private class IntToDblFormatProvider : ICustomFormatter, IFormatProvider
        //{
        //    public object GetFormat(Type type)
        //    {
        //        if (type == typeof (ICustomFormatter))
        //        {
        //            return this;
        //        }
        //        return null;
        //    }

        //    public string Format(string format, object arg, IFormatProvider formatProvider)
        //    {
        //        int value = Convert.ToInt32(arg);

        //        double hour = 60;

        //        return String.Format("{0:F2}", Math.Round(value / hour, 2));
        //    }
        //}
        #endregion
        private void repositoryItemSpinEditBalanceHours_FormatEditValue(object sender,
                                                                        DevExpress.XtraEditors.Controls.
                                                                        ConvertEditValueEventArgs e)
        {
            int    value   = Convert.ToInt32(e.Value);
            double hour    = 60;
            double d_value = Math.Round(value / hour, 2);

            e.Value   = d_value;
            e.Handled = true;
        }
コード例 #4
0
        void OnViewCustomFilterDisplayText(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            GridView       view         = sender as GridView;
            string         filterString = e.Value.ToString();
            GridFitlerItem fItem        = filters.FirstOrDefault(it => it.FilterString == filterString);

            if (fItem != null)
            {
                e.Value   = fItem.FilterName;
                e.Handled = true;
            }
        }
コード例 #5
0
 private void EditorCalc_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
     if (e.Value != null && PropertyGridControl.FocusedRow != null)
     {
         try
         {
             Type valueType = PropertyGridControl.FocusedRow.Properties.RowType;
             e.Value = Convert.ChangeType(e.Value, valueType);
         }
         catch (Exception)
         {
             //Do nothing, validation error will be shown.
         }
     }
 }
コード例 #6
0
ファイル: ReviewUpdateVinForm.cs プロジェクト: sishui198/C-
        private void repositoryItemComboBox1_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            if (e.Value != null)
            {
                switch (e.Value.ToString())
                {
                case "已上报": e.Value = "0"; break;

                case "待上报/补传待上报": e.Value = "1"; break;

                case "已修改未上报": e.Value = "2"; break;

                default: break;
                }
            }
        }
コード例 #7
0
 private void repositoryItemTextEdit1_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
     if (e.Value is string)
     {
         string strValue = (string)e.Value;
         strValue = strValue.Trim('%', ' ');
         double dblValue;
         if (double.TryParse(strValue, System.Globalization.NumberStyles.Any,
                             System.Threading.Thread.CurrentThread.CurrentUICulture.NumberFormat, out dblValue))
         {
             dblValue /= 100.0;
             e.Value   = dblValue;
             e.Handled = true;
         }
     }
 }
コード例 #8
0
        private void ddlStkDescr_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            if (e.Value == null)
            {
                e.Handled = true;
                return;
            }

            if (e.Value is int)
            {
                e.Handled = true;
            }
            else if (e.Value is DataRowView)
            {
                e.Handled = true;
                e.Value   = ((DataRowView)e.Value).Row.Field <int>("StockCodeID");
            }
        }
コード例 #9
0
ファイル: Utility.cs プロジェクト: Loong-Lee/VSDT
 static void dateEdit_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
     if (e.Value is string)
     {
         string strTemp = e.Value.ToString();
         //e.Handled = true;
         try
         {
             DateTime dt = DateTime.Parse(strTemp);
             e.Value   = DateTime.ParseExact(strTemp, "yyyyMMddHHmmss", null);
             e.Handled = true;
         }
         catch (Exception ex)
         {
             e.Value = strTemp;
         }
     }
 }
コード例 #10
0
        private void PictureEdit_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            if (e.Value is DBNull || e.Value is System.Data.Linq.Binary)
            {
                return;
            }

            if (e.Value is System.Drawing.Image)
            {
                e.Value   = Wookie.Tools.Image.Converter.GetBinaryFromImage((System.Drawing.Image)e.Value);
                e.Handled = true;
            }
            else if (e.Value is SvgImage)
            {
                e.Value   = Wookie.Tools.Image.Converter.GetBinaryFromSvgImage((SvgImage)e.Value);
                e.Handled = true;
            }
        }
コード例 #11
0
        private void lkpVAT_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            if (e.Value == null)
            {
                return;
            }
            int x = 0;

            if (e.Value.GetType().Equals(typeof(int)))
            {
                e.Handled = true;
                e.Value   = new HertexCore.Library.Models.Company.Tax.TaxRate((int)e.Value);
            }
            else if (e.Value.GetType().Equals(typeof(DataRowView)))
            {
                e.Handled = true;
                e.Value   = new HertexCore.Library.Models.Company.Tax.TaxRate(((DataRowView)e.Value).Row.Field <int>("idTaxRate"));
            }
        }
コード例 #12
0
ファイル: opMasterEditXF.cs プロジェクト: SenerDemiral/tMax14
        private void SSRrepositoryItemMemoExEdit_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            string[] stringSeparators = new string[] { "\r\n" };
            string[] res    = e.Value.ToString().Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries);
            string   resVal = String.Empty;
            bool     hasErr = false;

            if (res.Length > 3)
            {
                XtraMessageBox.Show("3 Satırdan fazla olamaz.", "Special Service Request", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            for (int i = 0; i < res.Length; i++)
            {
                string   err = "";
                string[] pa  = res[i].Split(new char[] { '/' });

                if (pa[1].Length > 35)
                {
                    err = string.Format("SpecialServiceRequest en fazla 35 karakter olmalı, girilen {0}", pa[1].Length);
                }

                if (err.Length > 0)
                {
                    hasErr = true;
                    XtraMessageBox.Show(string.Format("Satır: {0} -> {1} \n\nSatır Formatı: /SpecialServiceRequest", i + 1, err), "Special Service Request", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    resVal += res[i] + "\r\n";
                }
            }

            if (!hasErr)
            {
                e.Value   = resVal;
                e.Handled = true;
            }
        }
コード例 #13
0
 private void TreeListLookUpEdit1_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
     if (e.Value == null || (e.Value is int && (int)e.Value <= 0))
     {
         return;
     }
     else
     {
         if (e.Value is int)
         {
             return;
         }
         else if (e.Value is DataRowView)
         {
             e.Value = (int)((DataRowView)e.Value).Row["AutoIDX"];
         }
         else
         {
             throw new NotImplementedException();
         }
     }
 }
コード例 #14
0
 private void maxExpected_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
     BindingHelper.CorrectDecimalSeparator(sender, e);
 }
コード例 #15
0
ファイル: opMasterEditXF.cs プロジェクト: SenerDemiral/tMax14
        private void OCIrepositoryItemMemoExEdit_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            Text += e.Value.ToString() + " ";

            // sa = new string[100];

            /*
             * string[] sa = e.Value.ToString().Split(new char[] { '/' }); //,  StringSplitOptions.RemoveEmptyEntries);
             * int sal = sa.Length / 4;
             * for (int i = 0; i < sal; i++)
             * {
             *  sa[i*4+
             * }
             */
            string[] stringSeparators = new string[] { "\r\n" };
            string[] res = e.Value.ToString().Split(stringSeparators, StringSplitOptions.RemoveEmptyEntries);

            string resVal = String.Empty;
            bool   hasErr = false;

            for (int i = 0; i < res.Length; i++)
            {
                string   err = "";
                string[] pa  = res[i].Split(new char[] { '/' });

                if (pa.Length != 5)
                {
                    err = "Hatalı Format";
                }
                else if (pa[1].Length > 0 && pa[1].Length < 2)
                {
                    err = "ContryCode boş veya 2 karakter olmalı";
                }
                else if (pa[2].Length > 0 && pa[2].Length < 3)
                {
                    err = "InformationIdetifier boş veya 3 karakter olmalı";
                }
                else if (pa[3].Length > 2)
                {
                    err = "CustomInformationIdetifier en fazla 2 karakter olmalı";
                }
                else if (pa[4].Length > 35)
                {
                    err = string.Format("SuplemetaryCustomInformation en fazla 35 karakter olmalı, girilen {0}", pa[4].Length);
                }

                if (err.Length > 0)
                {
                    hasErr = true;
                    XtraMessageBox.Show(string.Format("Satır: {0} -> {1} \n\nSatır Formatı: /ContryCode/InformationIdetifier/CustomInformationIdetifier/SuplemetaryCustomInformation", i + 1, err), "Other Custom Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    resVal += res[i] + "\r\n";
                }
            }

            if (!hasErr)
            {
                e.Value   = resVal;
                e.Handled = true;
            }
        }
コード例 #16
0
        private void repositorydc_ValorPago_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            try
            {
                this.txtSubtotal.Focus();

                row = (cxc_cobro_Info)gridView_detalle.GetRow(gridView_detalle.FocusedRowHandle);
                double sumEFEC      = 0;
                double sumDEPO      = 0;
                double sumCXC       = 0;
                double sumCHQF      = 0;
                double sumOTROS     = 0;
                double sumCHQV_TARJ = 0;


                if (row.IdCobro_tipo == "" || row.IdCobro_tipo == null)
                {
                    MessageBox.Show("Seleccione primero el tipo de cobro", "Sistemas");
                    gridView_detalle.DeleteRow(gridView_detalle.FocusedRowHandle);
                }

                else
                {
                    //   foreach (var item in lst)
                    foreach (var item in lstCobro)
                    {
                        string caseSwitch = item.IdCobro_tipo;
                        switch (caseSwitch)
                        {
                        case "EFEC":
                            sumEFEC = sumEFEC + item.dc_ValorPago;
                            this.txtEfectivo.EditValue = sumEFEC;
                            break;

                        case "DEPO":
                            sumDEPO = sumDEPO + item.dc_ValorPago;
                            this.txtDeposito.EditValue = sumDEPO;
                            break;

                        case "CXC":
                            sumCXC = sumCXC + item.dc_ValorPago;
                            this.txtCXC.EditValue = sumCXC;
                            break;

                        case "CHQF":
                            sumCHQF = sumCHQF + item.dc_ValorPago;
                            this.txtCHQF.EditValue = sumCHQF;
                            break;

                        case "CHQV":
                            sumCHQV_TARJ = sumCHQV_TARJ + item.dc_ValorPago;
                            this.txtChq_Tarj.EditValue = sumCHQV_TARJ;
                            break;

                        case "TARJ":
                            sumCHQV_TARJ = sumCHQV_TARJ + item.dc_ValorPago;
                            this.txtChq_Tarj.EditValue = sumCHQV_TARJ;
                            break;

                        default:
                            sumOTROS = sumOTROS + item.dc_ValorPago;
                            this.txtOtros.EditValue = sumOTROS;
                            break;
                        }
                    } // fin for
                }     // fin else
                  // fin col_valor


                this.txtTotalCobrado.EditValue = sumEFEC + sumDEPO + sumCXC + sumCHQF + sumCHQV_TARJ + sumOTROS;
                txeSaldo.EditValue             = Convert.ToDouble(txeTotalDoc.EditValue) - Convert.ToDouble(txtTotalCobrado.EditValue);
            }
            catch (Exception ex)
            {
                Log_Error_bus.Log_Error(ex.ToString());
            }
        }
コード例 #17
0
ファイル: ChangeQuery.cs プロジェクト: sishui198/C-
 void repositoryItemComboBox1_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
     e.Value = e.Value.ToString(); e.Handled = true;
 }
コード例 #18
0
 private void txtProductName_Properties_FormatEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
     txtProductName.Properties.SearchMode = DevExpress.XtraEditors.Controls.SearchMode.AutoFilter;
 }
コード例 #19
0
ファイル: DlgUpdateCheckVal.cs プロジェクト: rcw0125/vehic
        private void txtNewVal_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            double?val = StringTool.FNumVal(txtNewVal.Text);

            e.Value = val;
        }
コード例 #20
0
ファイル: PluginSettingsForm.cs プロジェクト: CobyC/JaRS
 private void IntegerEditor_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
     e.Handled = true;
     e.Value   = int.Parse(e.Value.ToString());
 }
コード例 #21
0
 private void repositoryItemSpinEdit1_FormatEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
 }
コード例 #22
0
 private void popupContainerEdit1_ParseEditValue(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
 }
コード例 #23
0
ファイル: v_DistContrato.cs プロジェクト: netopvh/SGS-2.0
 private void advBandedGridView1_CustomFilterDisplayText(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
 {
 }