Esempio n. 1
0
        protected void grvEmpresas_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            //*******************
            //* Formata telefone
            //*******************
            if (e.Column.FieldName == "cnpj_cpf")
            {
                if (e.Value.ToString().Length < 12)
                {
                    System.ComponentModel.MaskedTextProvider oMask = new System.ComponentModel.MaskedTextProvider(@"000\.000\.000-00");
                    oMask.Set(e.Value.ToString());
                    e.DisplayText = oMask.ToString();
                }
                else
                {
                    System.ComponentModel.MaskedTextProvider oMask = new System.ComponentModel.MaskedTextProvider(@"00\.000\.000-0000-00");
                    oMask.Set(e.Value.ToString());
                    e.DisplayText = oMask.ToString();
                }
            }

            if (e.Column.FieldName == "contato_fone_fixo" || e.Column.FieldName == "contato_fone_celular")
            {
                System.ComponentModel.MaskedTextProvider oMask = new System.ComponentModel.MaskedTextProvider("(00) 000-000-000");
                oMask.Set(e.Value.ToString());
                e.DisplayText = oMask.ToString();
            }
        }
Esempio n. 2
0
        protected void gv_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            //if (e.Column.FieldName == "PautaId1" || e.Column.FieldName == "PautaId2")
            //{
            //    e.Column.Visible = false;

            //    return;
            //}

            //string Titulo = e.Column.FieldName;

            //if (Titulo.Substring(Titulo.Length - 1) == "1")
            //{
            //    Titulo = Titulo.Substring(0, Titulo.Length - 1);

            //    gv.Columns[Titulo + "1"].Caption = Titulo + " - Costo";

            //    gv.Columns[e.Column.Index].HeaderStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;

            //    gv.DataBind();
            //}

            //if (e.Column.Index > 6 && e.Column.FieldName.Substring(e.Column.FieldName.Length - 1) != "1" && e.Column.FieldName.Substring(e.Column.FieldName.Length - 7) != "Salidas")
            //{
            //    Titulo = e.Column.FieldName + " - Salidas";

            //    gv.Columns[e.Column.Index].Caption = Titulo;

            //    gv.Columns[e.Column.Index].HeaderStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;

            //    gv.DataBind();

            //}
        }
        protected void ASPxGridViewLocation_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (e.Column.FieldName == "IsBuyer")
            {
                if (Convert.ToBoolean(e.Value))
                {
                    e.DisplayText = "DA";
                }
                else
                {
                    e.DisplayText = "NE";
                }
            }

            if (e.Column.FieldName == "IsWarehouse")
            {
                if (Convert.ToBoolean(e.Value))
                {
                    e.DisplayText = "DA";
                }
                else
                {
                    e.DisplayText = "NE";
                }
            }
        }
Esempio n. 4
0
 protected void grdDVT_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.Caption == "STT")
     {
         e.DisplayText = (e.VisibleRowIndex + 1).ToString();
     }
 }
Esempio n. 5
0
 protected void MailGrid_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName == "Subject" && (bool)e.GetFieldValue("IsReply"))
     {
         e.DisplayText = "Re: " + HttpUtility.HtmlEncode(e.Value);
     }
     if (e.Column.FieldName == "To")
     {
         var list = new List <string>();
         foreach (var item in e.Value.ToString().Split(','))
         {
             var        email    = item.Trim();
             ContactsBL bl       = new ContactsBL();
             var        Contacts = bl.GetAllContacts(User.Identity.Name);
             var        contact  = Contacts.FirstOrDefault(c => c.Email == email);
             list.Add(contact != null ? contact.Name : email);
         }
         e.DisplayText = string.Join(", ", list);
     }
     if (e.Column.FieldName == "From")
     {
         var        from     = e.Value.ToString();
         ContactsBL bl       = new ContactsBL();
         var        Contacts = bl.GetAllContacts(User.Identity.Name);
         var        contact  = Contacts.FirstOrDefault(c => c.Email == from);
         e.DisplayText = contact != null ? contact.Name : from;
     }
     if (!string.IsNullOrEmpty(SearchText) && (e.Column.FieldName == "From" || e.Column.FieldName == "To" || e.Column.FieldName == "Subject"))
     {
         string text = string.IsNullOrEmpty(e.DisplayText) ? e.Value.ToString() : e.DisplayText;
         e.DisplayText = new Regex(SearchText, RegexOptions.IgnoreCase).Replace(text, "<span class='hgl'>$0</span>");
     }
 }
Esempio n. 6
0
        protected void grdBalanceLine_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (e.Column.FieldName == "Debit" || e.Column.FieldName == "Credit")
            {
                NAS.DAL.Accounting.Currency.Currency _currency;

                Guid   _selectCurrency            = Guid.Empty;
                double _numRequiredSelectCurrency = 1;

                if (cboBalanceInitCurrency.Value != null)
                {
                    _currency = session.GetObjectByKey <NAS.DAL.Accounting.Currency.Currency>(Guid.Parse(cboBalanceInitCurrency.Value.ToString()));
                    if (_currency != null)
                    {
                        _selectCurrency            = _currency.CurrencyId;
                        _numRequiredSelectCurrency = _currency.Coefficient;
                    }
                }

                Guid   _currentCurrency            = Guid.Parse(e.GetFieldValue("CurrencyId!Key").ToString());
                double _numRequiredCurrentCurrency = 1;

                _currency = session.GetObjectByKey <NAS.DAL.Accounting.Currency.Currency>(_currentCurrency);
                if (_currency != null)
                {
                    _numRequiredCurrentCurrency = _currency.Coefficient;
                }

                if (_currentCurrency != _selectCurrency)
                {
                    e.DisplayText = String.Format(m_FormatNumber, ((_numRequiredSelectCurrency * double.Parse(e.GetFieldValue(e.Column.FieldName).ToString())) / _numRequiredCurrentCurrency));
                }
            }
        }
 protected void ASPxGridViewActiveUser_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName == "IsActive")
     {
         e.DisplayText = CommonMethods.ParseBool(e.Value) == true ? "DA" : "NE";
     }
 }
Esempio n. 8
0
 public static void InitDisplayIndexColumn(ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.Caption == "STT")
     {
         e.DisplayText = (e.VisibleIndex + 1).ToString();
     }
 }
 protected void ASPxGridView6_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName == "DOTELEMENTO")
     {
         e.DisplayText = String.Format(@"{0:0\.0\.00\.00\.00}", Convert.ToInt64(e.Value));
     }
 }
Esempio n. 10
0
 protected void MailGrid_CustomGroupDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName == "Subject")
     {
         e.DisplayText = HttpUtility.HtmlEncode(e.Value);
     }
 }
 protected virtual void OnAfterCustomGroupDisplayText_BaseImplementation(ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Value != null)
     {
         e.DisplayText = SettingsText.GroupDisplayTextFormat.FillWith(e.DisplayText);
     }
 }
Esempio n. 12
0
        protected void ASPxGridViewUsers_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            ASPxGridView grid = sender as ASPxGridView;

            if (e.Column.FieldName == "Company" && e.Value != null)
            {
                e.DisplayText = e.Value.ToString();
            }
            if (e.Column.Name == "Grupo")
            {
                object obj    = ((ASPxGridView)sender).GetRowValues(e.VisibleIndex, new string[] { "Id" });
                string userId = obj.ToString();

                ApplicationDbContext dbc  = new ApplicationDbContext();
                ApplicationUser      user = dbc.Users.ToList().Find(x => x.Id == userId);

                if (user != null)
                {
                    var claims = user.Claims;
                    //var roles = claims.Where(c => c.ClaimType == ClaimTypes.Role).ToList();
                    var roles = claims.Where(c => c.ClaimType == "role").ToList();
                    if (roles != null && roles.Count > 0)
                    {
                        e.Value       = roles[0].ClaimValue;
                        e.DisplayText = roles[0].ClaimValue;
                    }
                }
            }
        }
Esempio n. 13
0
 protected void ASPxGridView1_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName != "DayOfWeek") return;
     if (e.Value != null)
     {
         int value = Convert.ToInt32(e.Value.ToString());
         switch (value)
         {
             case 2: e.DisplayText = "Thứ 2";
                 break;
             case 3: e.DisplayText = "Thứ 3";
                 break;
             case 4: e.DisplayText = "Thứ 4";
                 break;
             case 5: e.DisplayText = "Thứ 5";
                 break;
             case 6: e.DisplayText = "Thứ 6";
                 break;
             case 7: e.DisplayText = "Thứ 7";
                 break;
             case 1: e.DisplayText = "Chủ Nhật";
                 break;
         }
     }
 }
Esempio n. 14
0
    /// <summary>
    /// 自定义显示文本。
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void grid_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        DataTable dt = this.grid.DataSource as DataTable;

        if (e.Column.Index != 0 && dt != null)
        {
            string rowHeader = Convert.ToString(dt.Rows[e.VisibleIndex][0]);
            if (e.Value.ToString() != "0" && sender == this.grid)
            {
                string colHeader = e.Column.FieldName;
                string status    = Server.UrlEncode(rowHeader);
                string stepName  = Server.UrlEncode(colHeader);
                e.Value = string.Format("<a href='javascript:void(0);' onclick='javascript:window.open(\"WipDisplay_Detail.aspx?status={1}&RouteID={2}&Factory={3}&WorkOrderNumberKey={4}&Hours={5}&proid={6}&partNumber={7}&OnlineHours={8}\");' class='dxgv' style='text-decoration:underline;'>{0}</a>",
                                        e.Value,
                                        status,
                                        stepName,
                                        Server.UrlEncode(wipInstance.FactoryRoomKey),
                                        Server.UrlEncode(wipInstance.WorkOrderNumberKey),
                                        wipInstance.Hours,
                                        Server.UrlEncode(wipInstance.ProId),
                                        Server.UrlEncode(this.cmbPartNumber.Text.ToString().Trim()),
                                        wipInstance.OnLineHours);
            }
        }
    }
Esempio n. 15
0
        public static void InitDisplayIndexGroupColumn(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (e.Column.Caption != "STT")
            {
                return;
            }
            ASPxGridView g = sender as ASPxGridView;

            CollectGroupIndexes(g);
            if (IsGridUngrouped)
            {
                rowInGroupNumber = e.VisibleRowIndex + 1;
            }
            else
            {
                if (isFirstDisplayedRow)
                {
                    rowInGroupNumber    = e.VisibleRowIndex - GetParentGroupIndex(e.VisibleRowIndex);
                    isFirstDisplayedRow = false;
                }
                else
                {
                    if (IsRowIsFirstGroup(e.VisibleRowIndex, g))
                    {
                        rowInGroupNumber = 1;
                    }
                    else
                    {
                        rowInGroupNumber++;
                    }
                }
            }
            //e.Value = rowInGroupNumber;
            e.DisplayText = rowInGroupNumber.ToString();
        }
Esempio n. 16
0
        protected void gvDetailKartuPiutang_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (e.Column.FieldName == "HutangPokok")
            {
                if (e.Value.ToString() != " ")
                {
                    decimal price = Convert.ToDecimal(e.Value);

                    e.DisplayText = string.Format("{0:#,##}", price);
                }
            }
            else if (e.Column.FieldName == "Bunga")
            {
                if (e.Value.ToString() != " ")
                {
                    decimal price = Convert.ToDecimal(e.Value);

                    e.DisplayText = string.Format("{0:#,##}", price);
                }
            }
            else if (e.Column.FieldName == "Total")
            {
                if (e.Value.ToString() != " ")
                {
                    decimal price = Convert.ToDecimal(e.Value);

                    e.DisplayText = string.Format("{0:#,##}", price);
                }
            }
        }
Esempio n. 17
0
 protected void ASPxGridView1_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.VisibleRowIndex >= 0)
     {
         AccountingPeriod CurrentDataRow = ASPxGridView1.GetRow(e.VisibleRowIndex) as AccountingPeriod;
         if (e.Column.FieldName == "AccountingPeriodTypeId!Key")
         {
             if (CurrentDataRow.AccountingPeriodTypeId == null)
             {
                 return;
             }
             e.DisplayText = CurrentDataRow.AccountingPeriodTypeId.Name;
         }
         if (e.Column.Caption == "Chu kì trực thuộc")
         {
             string           displayText = "";
             CriteriaOperator criteria_0  = new BinaryOperator("AccountingPeriodId", CurrentDataRow, BinaryOperatorType.Equal);
             CriteriaOperator criteria_1  = new BinaryOperator("RowStatus", Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual);
             CriteriaOperator criteria    = new GroupOperator(GroupOperatorType.And, criteria_0, criteria_1);
             XPCollection <AccountingPeriodComposite> collection = new XPCollection <AccountingPeriodComposite>(session, criteria);
             foreach (AccountingPeriodComposite cp in collection)
             {
                 displayText = displayText + cp.ChildrenAccountingPeriodId.Code + "; ";
             }
             e.DisplayText = displayText;
         }
     }
 }
Esempio n. 18
0
 protected void gridviewAllocation_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.Name.Equals("DynamicObjectList"))
     {
         ASPxGridView grid = sender as ASPxGridView;
         //Get TransactionId
         var transactionId = grid.GetRowValues(e.VisibleRowIndex, "TransactionId");
         if (transactionId == null)
         {
             return;
         }
         //Get transction
         NAS.DAL.Accounting.Journal.Transaction transaction =
             session.GetObjectByKey <NAS.DAL.Accounting.Journal.Transaction>(transactionId);
         TransactionObject transactionObject = transaction.TransactionObjects.FirstOrDefault();
         if (transactionObject != null)
         {
             ObjectBO objectBO = new ObjectBO();
             DynamicObjectListSerialize dynamicObjectList =
                 objectBO.GetDynamicObjectList(transactionObject.ObjectId.ObjectId);
             if (dynamicObjectList != null)
             {
                 e.DisplayText = dynamicObjectList.ToString();
             }
         }
     }
 }
 protected void ASPxGridView1_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if ((int)e.GetFieldValue("Id") % 2 == 0)
     {
         e.DisplayText = string.Empty;
     }
 }
    protected void grid_CustomColumnDisplayText(Object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        if (e.Column.Caption == "ประเภทที่อยู่")
        {
            String TYPE_ADR = e.GetFieldValue("ADR_TYPE").ToString();
            if (TYPE_ADR == "1")
            {
                String Y = "ปัจจุบัน";
                e.DisplayText =Y;

            }else if (TYPE_ADR == "2")
            {
                String Y = "ตามทะเบียนบ้าน";
                e.DisplayText = Y;

            }else if (TYPE_ADR == "3")
            {
                String Y = "ตามบัตรประชาชน";
                e.DisplayText = Y;

            }else if (TYPE_ADR == "4")
            {
                String Y = "ตามภูมิลำเนา";
                e.DisplayText = Y;

            }
        }
    }
Esempio n. 21
0
    protected void grid_OnCustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        if (e.Column.FieldName != "绑定地址编码")
        {
            return;
        }

        务地址 务绑定地址 = new  务地址();

        务绑定地址.务地址编码 = new Guid(e.Value.ToString());

        if (务绑定地址.务地址编码 != Guid.Empty)
        {
            注册服务目录服务 目录服务 = new 注册服务目录服务();
            务        具体服务 = 目录服务.获得具体服务_绑定信息(务绑定地址);
            业务实体     实体   = 目录服务.获得服务提供者((Guid)具体服务.业务编码);

            if (e.Column.Caption == "调用服务")
            {
                e.DisplayText = 具体服务.务名称;
            }
            else if (e.Column.Caption == "调用系统")
            {
                e.DisplayText = 实体.描述;
            }
        }
    }
Esempio n. 22
0
 protected void DisplayNoCaption(ASPxGridViewColumnDisplayTextEventArgs e, string caption)
 {
     if (e.Column.Caption == caption)
     {
         e.DisplayText = Convert.ToString(e.VisibleRowIndex + 1);
     }
 }
Esempio n. 23
0
 protected void gridviewGeneralJournal_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName.Equals("AccountId!Key"))
     {
         Guid accountId = (Guid)e.Value;
         NAS.DAL.Accounting.AccountChart.Account account =
             session.GetObjectByKey <NAS.DAL.Accounting.AccountChart.Account>(accountId);
         e.DisplayText = String.Format("{0} - {1}", account.Code, account.Name);
     }
     else if (e.Column.Name.Equals("DynamicObjectList"))
     {
         ASPxGridView grid = sender as ASPxGridView;
         //Get TransactionId
         var generalJournalId = grid.GetRowValues(e.VisibleRowIndex, "GeneralJournalId");
         if (generalJournalId == null)
         {
             return;
         }
         //Get transction
         NAS.DAL.Accounting.Journal.GeneralJournal generalJournal =
             session.GetObjectByKey <NAS.DAL.Accounting.Journal.GeneralJournal>(generalJournalId);
         GeneralJournalObject generalJournalObject = generalJournal.GeneralJournalObjects.FirstOrDefault();
         if (generalJournalObject != null)
         {
             ObjectBO objectBO = new ObjectBO();
             DynamicObjectListSerialize dynamicObjectList =
                 objectBO.GetDynamicObjectList(generalJournalObject.ObjectId.ObjectId);
             if (dynamicObjectList != null)
             {
                 e.DisplayText = dynamicObjectList.ToString();
             }
         }
     }
 }
Esempio n. 24
0
 private void GridView_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.Caption == "STT")
     {
         ASPxGridView gridView = (ASPxGridView)sender;
         e.DisplayText = (e.VisibleIndex + 1).ToString();
     }
 }
 protected void ASPxGridView1_CustomColumnDisplayText1(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     ValidarConexionYUsuarioLogueado(new object());
     if (e.Column.FieldName == "TOTAL_AMOUNT" || e.Column.FieldName == "CREDIT_AMOUNT" || e.Column.FieldName == "CASH_AMOUNT")
     {
         e.DisplayText = Session["SYMBOL_CURRENCY"].ToString() + e.Value;
     }
 }
Esempio n. 26
0
 protected void GridPlanningJournal_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName == "ItemUnitId!Key")
     {
         NAS.DAL.Nomenclature.Item.ItemUnit itemUnit = session.GetObjectByKey <NAS.DAL.Nomenclature.Item.ItemUnit>(Guid.Parse(e.Value.ToString()));
         e.DisplayText = itemUnit.ItemId.Name;
     }
 }
 protected void ASPxGridView2_CustomColumnDisplayText2(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     ValidarConexionYUsuarioLogueado(new object());
     if (e.Column.FieldName == "TOTAL_LINE" || e.Column.FieldName == "SKU_PRICE")
     {
         e.DisplayText = Session["SYMBOL_CURRENCY"].ToString() + e.Value;
     }
 }
        protected override void RaiseCustomGroupDisplayText(ASPxGridViewColumnDisplayTextEventArgs e)
        {
            OnBeforeCustomGroupDisplayText_BaseImplementation(e);

            base.RaiseCustomGroupDisplayText(e);

            OnAfterCustomGroupDisplayText_BaseImplementation(e);
        }
Esempio n. 29
0
 /// <summary>
 /// change OriginPortID column to display portname instead when in view mode
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void dxgrdETA_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName != "DestinationPortID")
     {
         return;
     }
     e.DisplayText = e.GetFieldValue(e.VisibleRowIndex, "PortName") != null?e.GetFieldValue(e.VisibleRowIndex, "PortName").ToString() : "";
 }
Esempio n. 30
0
 protected void ASPxGridView1_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName != "Month")
     {
         return;
     }
     e.DisplayText = e.GetFieldValue("OrderDate").ToString();
 }
Esempio n. 31
0
 protected void FeedGrid_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (!string.IsNullOrEmpty(SearchText) && (e.Column.FieldName == "From" || e.Column.FieldName == "Title"))
     {
         string text = string.IsNullOrEmpty(e.DisplayText) ? e.Value.ToString() : e.DisplayText;
         e.DisplayText = new Regex(SearchText, RegexOptions.IgnoreCase).Replace(text, "<span class='hgl'>$0</span>");
     }
 }
Esempio n. 32
0
 protected void grdGeneralJournal_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName.Equals("AccountId!Key"))
     {
         Guid    accountId = (Guid)e.Value;
         Account account   = session.GetObjectByKey <Account>(accountId);
         e.DisplayText = String.Format("{0} - {1}", account.Code, account.Name);
     }
 }
Esempio n. 33
0
 protected void gridRole_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName == "MAINDEPTID")
     {
         e.DisplayText = (from dept in dc.Department
                          where dept.Deptnumber == e.Value.ToString()
                          select dept).Single().Deptname;
     }
 }
 protected void gv_CustomColumnDisplayText(Object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     //if (e.Column.FieldName == "Item")
     //{
     //    if (Request.QueryString["m"].ToString() == "View")
     //    {
     //        gv.Enabled = false;
     //    }
     //}
 }
Esempio n. 35
0
        protected void grdJobsTrigger_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (e.Column.FieldName != "Job.Weekdays") return;
            Weekdays weekDays = new Weekdays {AllDays = Convert.ToByte(e.Value)};

            if (weekDays.AllDays == 0)
                e.DisplayText = "No Diario";
            else
                e.DisplayText = Utils.UI.Helper.BuildPopulateDaysLegend(weekDays);
        }
 protected void grid_CustomColumnDisplayText(Object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.Caption == "ตำแหน่ง")
     {
         String POS_NAME = e.GetFieldValue("POS_NAME").ToString();
         //if (POS_NAME != LastPosName)
         //{
         e.DisplayText = POS_NAME;
         //}
     }
 }
    protected void grid_CustomColumnDisplayText(Object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        if (e.Column.Caption == "วันที่เริ่่มต้น")
        {
            String Date = e.GetFieldValue("TRN_STARTDATE").ToString();
            if (Date != "")
            {
                String Y = (Convert.ToInt32(((Convert.ToDateTime(e.GetFieldValue("TRN_STARTDATE")).ToString("yyyy")).ToString())) + 543).ToString();
                e.DisplayText = (Convert.ToDateTime(e.GetFieldValue("TRN_STARTDATE")).ToString("dd MMM ", new System.Globalization.CultureInfo("th-TH"))).ToString() + Y;

            }
        }
    }
    protected void grid_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        if (e.Column.Caption == "ความสัมพันธ์")
        {
            String TYPE_ADR = e.GetFieldValue("FML_TYPE").ToString();
            if (TYPE_ADR == "1")
            {
                String Y = "บิดา";
                e.DisplayText = Y;

            }
            else if (TYPE_ADR == "2")
            {
                String Y = "มารดา";
                e.DisplayText = Y;

            }
            else if (TYPE_ADR == "3")
            {
                String Y = "คู่สมรส";
                e.DisplayText = Y;

            }
            else if (TYPE_ADR == "4")
            {
                String Y = "บุตร";
                e.DisplayText = Y;

            }
        }
        if (e.Column.Caption == "วันเดือนปีเกิด")
        {
            String Date = e.GetFieldValue("FML_BIRTHDATE").ToString();
            if (Date != "")
            {
                String Y = (Convert.ToInt32(((Convert.ToDateTime(e.GetFieldValue("FML_BIRTHDATE")).ToString("yyyy")).ToString())) + 543).ToString();
                e.DisplayText = (Convert.ToDateTime(e.GetFieldValue("FML_BIRTHDATE")).ToString("dd MMM ", new System.Globalization.CultureInfo("th-TH"))).ToString() + Y;

            }
        }
    }
    protected void grid_CustomColumnDisplayText(Object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        if (e.Column.Caption == "วันเดือนปี<br>ที่จดทะเบียน")
        {
            String Date = e.GetFieldValue("MAH_MARRY_DATE").ToString();
            if (Date != "")
            {
                String Y = (Convert.ToInt32(((Convert.ToDateTime(e.GetFieldValue("MAH_MARRY_DATE")).ToString("yyyy")).ToString())) + 543).ToString();
                e.DisplayText = (Convert.ToDateTime(e.GetFieldValue("MAH_MARRY_DATE")).ToString("dd MMM ", new System.Globalization.CultureInfo("th-TH"))).ToString() + Y;

            }
        }
        if (e.Column.Caption == "วันที่ขาดจากการสมรส")
        {
            String Date = e.GetFieldValue("MAH_DIVORCE_DATE").ToString();
            if (Date != "")
            {
                String Y = (Convert.ToInt32(((Convert.ToDateTime(e.GetFieldValue("MAH_DIVORCE_DATE")).ToString("yyyy")).ToString())) + 543).ToString();
                e.DisplayText = (Convert.ToDateTime(e.GetFieldValue("MAH_DIVORCE_DATE")).ToString("dd MMM ", new System.Globalization.CultureInfo("th-TH"))).ToString() + Y;

            }
        }
    }
    protected void grid_CustomColumnDisplayText(Object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        if (e.Column.Caption == "วันที่มีผลบังคับใช้")
        {
            String Date = e.GetFieldValue("EXH_EFFECTIVEDATE").ToString();
            if (Date != "")
            {
                String Y = (Convert.ToInt32(((Convert.ToDateTime(e.GetFieldValue("EXH_EFFECTIVEDATE")).ToString("yyyy")).ToString())) + 543).ToString();
                e.DisplayText = (Convert.ToDateTime(e.GetFieldValue("EXH_EFFECTIVEDATE")).ToString("dd MMM ", new System.Globalization.CultureInfo("th-TH"))).ToString() + Y;

            }
        }

        if (e.Column.Caption == "ถึงวันที่")
        {
            String Date = e.GetFieldValue("EXH_ENDDATE").ToString();
            if (Date != "")
            {
                String Y = (Convert.ToInt32(((Convert.ToDateTime(e.GetFieldValue("EXH_ENDDATE")).ToString("yyyy")).ToString())) + 543).ToString();
                e.DisplayText = (Convert.ToDateTime(e.GetFieldValue("EXH_ENDDATE")).ToString("dd MMM ", new System.Globalization.CultureInfo("th-TH"))).ToString() + Y;

            }
        }
    }
Esempio n. 41
0
    protected void gw_psst_person_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        //if (e.Column.Caption == "อายุในราชการ")
        //{
        //    String Date = e.GetFieldValue("START_DATE").ToString();
        //    if (Date != "")
        //    {
        //        //--------------อายุ---------------
        //        try
        //        {
        //            DataTable DT_Age = OPM_BL.CalculateAge(e.GetFieldValue("ID").ToString());
        //            e.DisplayText = DT_Age.Rows[0]["Old_START_DATE"].ToString();
        //        }
        //        catch (Exception ex)
        //        {
        //            e.DisplayText = "";
        //        }

        //    }
        //}
    }
        protected void gv_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            //if (e.Column.FieldName == "PautaId1" || e.Column.FieldName == "PautaId2")
            //{
            //    e.Column.Visible = false;

            //    return;
            //}

            //string Titulo = e.Column.FieldName;

            //if (Titulo.Substring(Titulo.Length - 1) == "1")
            //{
            //    Titulo = Titulo.Substring(0, Titulo.Length - 1);

            //    gv.Columns[Titulo + "1"].Caption = Titulo + " - Costo";

            //    gv.Columns[e.Column.Index].HeaderStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;

            //    gv.DataBind();
            //}

            //if (e.Column.Index > 6 && e.Column.FieldName.Substring(e.Column.FieldName.Length - 1) != "1" && e.Column.FieldName.Substring(e.Column.FieldName.Length - 7) != "Salidas")
            //{
            //    Titulo = e.Column.FieldName + " - Salidas";

            //    gv.Columns[e.Column.Index].Caption = Titulo;

            //    gv.Columns[e.Column.Index].HeaderStyle.Wrap = DevExpress.Utils.DefaultBoolean.True;

            //    gv.DataBind();

            //}
        }
 protected void grid_CustomColumnDisplayText(Object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.Caption == "ประเภทความรู้/ทักษะ/สมรรถนะ")
     {
         String TYPE_NAME = e.GetFieldValue("TYPE_NAME").ToString();
         if (TYPE_NAME != LastTypeName)
         {
             //e.DisplayText = TYPE_NAME;
         }
     }
 }
        protected override void RaiseCustomGroupDisplayText(ASPxGridViewColumnDisplayTextEventArgs e)
        {
            OnBeforeCustomGroupDisplayText_BaseImplementation(e);
            
            base.RaiseCustomGroupDisplayText(e);

            OnAfterCustomGroupDisplayText_BaseImplementation(e);
        }
        protected virtual void OnBeforeCustomGroupDisplayText_BaseImplementation(ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (SettingsText.NullGroupDisplayText.IsEmpty()) return;

            if (e.Value == null)
            {
                e.DisplayText = SettingsText.NullGroupDisplayText;
            }
        }
Esempio n. 46
0
 /// <summary>
 /// change OriginPortID column to display portname instead when in view mode
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void dxgrdETA_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName != "DestinationPortID") return;
     e.DisplayText = e.GetFieldValue(e.VisibleRowIndex, "PortName") != null ? e.GetFieldValue(e.VisibleRowIndex, "PortName").ToString() : "";
 }
        protected void gv_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (e.Column.FieldName != "Hora") return;

            if (e.Value != null)
                e.DisplayText = e.Value.ToString().Substring(0, 5);
        }
Esempio n. 48
0
 protected void GRIDCONTRATOS_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     //if (e.Column.FieldName == "ADITIVOS")
     //{
     //    if (e.DisplayText == "Sem Itens") {
     //        e.DisplayText.
     //    }
     //    e.DisplayText = String.Format(@"{0:#\.0000}", Convert.ToInt64(e.Value));
     //}
 }
 /// <summary>
 /// DEPRECATED code 09.04.15 a user defined function has been set up on SQL server to do this
 /// dbo.get_package_type
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void gridContainer_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     //if (e.Column.FieldName != "MaxPackageType") return;
     //if (e.Value != null)
     //{
     //    if (e.GetFieldValue("PackageTypes") != null)
     //    {
     //        int _types = (int)e.GetFieldValue("PackageTypes");
     //        if (_types > 1) { e.DisplayText = "Mixed"; }
     //    }
     //}
 }
 protected virtual void OnAfterCustomGroupDisplayText_BaseImplementation(ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Value != null)
     {
         e.DisplayText = SettingsText.GroupDisplayTextFormat.FillWith(e.DisplayText);
     }
 }
Esempio n. 51
0
 protected void ASPxGridView1_CustomColumnDisplayText1(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.FieldName == "NUMERO")
     {
         e.DisplayText = String.Format(@"{0:#\.0000}", Convert.ToInt64(e.Value));
     }
 }
Esempio n. 52
0
 protected void gridMapping_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
     if (e.Column.Name == "colProductState")
     {
         switch ((ProductStateEnum)int.Parse(e.Value.ToString()))
         {
             case ProductStateEnum.Active:
                 e.DisplayText = "<img src='App_Themes/Default/Images/state-ok.png' alt='Active'>";
                 break;
             case ProductStateEnum.Excluded:
                 e.DisplayText = "<img src='App_Themes/Default/Images/state-excluded.png' alt='Excluded from monitoring'>";
                 break;
             case ProductStateEnum.UnMapped:
                 e.DisplayText = "<img src='App_Themes/Default/Images/state-unmapped.png' alt='Not Mapped'>";
                 break;
             default:
                 break;
         }
     }
 }
Esempio n. 53
0
        //protected void gridSearchViewPager_PageIndexChanged(object sender, EventArgs e)
        //{
        //    gridSearchView.PageIndex = gridSearchViewPager.PageIndex;
        //    gridSearchView.DataBind();
        //}
        //protected void gridSearchViewPager_PageSizeChanged(object sender, EventArgs e)
        //{
        //    gridSearchView.SettingsPager.PageSize = gridSearchViewPager.ItemsPerPage;
        //    gridSearchView.DataBind();
        //}
        protected void gridSearchView_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (e.Value == null || SearchTextBox.Text == string.Empty) return;
            string searchText = SearchTextBox.Text;
            string highlightedText = e.Value.ToString();

            if (!highlightedText.Contains(searchText) || searchText == null || searchText == string.Empty)
                return;
            e.DisplayText = highlightedText.Replace(searchText, "<span class='highlight'>" + searchText + "</span>");
        }
Esempio n. 54
0
    protected void grid_CustomColumnDisplayText(Object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        if (e.Column.Caption == "อายุในราชการ")
        {
            String Date = e.GetFieldValue("START_DATE").ToString();
            if (Date != "")
            {
                //--------------อายุ---------------
                try
                {
                    DataTable DT_Age = OPM_BL.CalculateAge(e.GetFieldValue("ID").ToString());
                    e.DisplayText = DT_Age.Rows[0]["Old_START_DATE"].ToString();
                }
                catch (Exception ex) {
                    e.DisplayText = "";
                }

            }
        }

        //if (e.Column.Caption == "แก้ไข")
        //{
        //    String image = e.GetFieldValue("image").ToString();
        //    if (image.ToString() == "view") {

        //    }

        //}
    }
 protected void ASPxGridView1_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
 {
 }
        protected void gvHome_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (e.Column.FieldName != "FecCertValido") return;

            if (e.Value != null)
                if (e.Value.ToString() == "")
                    e.DisplayText = "";
                else
                   if(e.Value.ToString().Substring(0,10) == "01/01/1900" || e.Value.ToString() == "")
                     e.DisplayText = "";
        }
        protected void ASPxGridView1_CustomColumnDisplayText1(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
        {
            if (e.Column.FieldName == "NUMERO")
            {
                e.DisplayText = String.Format(@"{0:#\.0000}", Convert.ToInt64(e.Value));
            }

            if (e.Column.FieldName == "CCCMESES")
            {
                var conn = Persist.GetConn.getConn();

                using (conn) {
                    conn.Open();

                    var query = "select cccdescricao from webcentrocustocontrole where cccmeses = " + e.Value;

                    var cmd = new FirebirdSql.Data.FirebirdClient.FbCommand(query, conn);

                    e.DisplayText = cmd.ExecuteScalar().ToString();
                }

            }
        }
Esempio n. 58
0
    protected void grid_OnCustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e)
    {
        if (e.Column.FieldName != "BindingTemplateID") return;
        if (e.Value != null)
        {
            ESB.BusinessService service = m_UddiService.GetBusinessServiceByTemplateID(e.Value.ToString());
            ESB.BusinessEntity[] entityArray = m_UddiService.GetAllBusinessEntity();
            ESB.BusinessEntity entity = entityArray.First(x => x.BusinessID == service.BusinessID);

            if (e.Column.Caption == "调用服务")
            {
                e.DisplayText = service.ServiceName;

            }else if(e.Column.Caption == "调用系统")
            {
                e.DisplayText = entity.Description;
            }
        }

    }