Exemplo n.º 1
0
        protected void grvExport_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
        {
            GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;

            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 8)
            {
                string strCoCode = e.GetValue("CoCode").ToString();
                if (strCoCode != string.Empty)
                {
                    using (COMPANY_BO objT24_COMPANY_BO = new COMPANY_BO())
                    {
                        COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            e.TextValue = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 9)
            {
                if (e.GetValue("IsUsed") != null)
                {
                    bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                    if (strStatus)
                    {
                        e.TextValue = "Đã cấp";
                    }
                    else
                    {
                        e.TextValue = "Đã xóa";
                    }
                }
                else
                {
                    e.TextValue = "Đã cấp";
                }
            }
        }
Exemplo n.º 2
0
        protected void grvExport_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
        {
            GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;

            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 7)
            {
                if (e.GetValue("Serials") != null)
                {
                    string strSerials = e.GetValue("Serials").ToString();
                    if (!string.IsNullOrEmpty(strSerials))
                    {
                        strSerials = Commons.Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList());
                    }

                    e.TextValue = strSerials;
                }
                else
                {
                    e.TextValue = string.Empty;
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 9)
            {
                string strCoCode = e.GetValue("CO_CODE").ToString();
                if (strCoCode != string.Empty)
                {
                    using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                    {
                        DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            e.TextValue = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 10)
            {
                if (e.GetValue("IsUsed") != null)
                {
                    bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                    if (strStatus)
                    {
                        e.TextValue = "Đã cấp mã";
                    }
                    else
                    {
                        e.TextValue = "Đã xóa";
                    }
                }
                else
                {
                    e.TextValue = "Đã cấp mã";
                }
            }
        }