protected void dxgvSerial_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.GridViewRowType.Data) { Label lbl = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblBranchName") as Label; string strCoCode = e.GetValue("CO_CODE").ToString(); if (lbl != null && 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) { lbl.Text = objT24_COMPANY.COMPANY_NAME; } } } Label lbl2 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblStatus") as Label; if (lbl2 != null) { if (e.GetValue("IsUsed") != null) { bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed")); if (strStatus) { lbl2.Text = "Đã cấp mã"; } else { lbl2.Text = "Đã xóa"; } } else { lbl2.Text = "Đã cấp mã"; } } Label lbl3 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblMaDuThuong") as Label; if (lbl3 != null) { if (e.GetValue("Serials") != null) { string strSerials = e.GetValue("Serials").ToString(); if (!string.IsNullOrEmpty(strSerials)) { strSerials = Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList()); } lbl3.Text = strSerials; } else { lbl3.Text = string.Empty; } } } }
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"; } } }
protected void dxgvLiXi_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.GridViewRowType.Data) { Label lbl = dxgvLiXi.FindRowCellTemplateControl(e.VisibleIndex, null, "lblBranchName") as Label; string strCoCode = e.GetValue("CoCode").ToString(); if (lbl != null && 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) { lbl.Text = objT24_COMPANY.COMPANY_NAME; } } } Label lbl2 = dxgvLiXi.FindRowCellTemplateControl(e.VisibleIndex, null, "lblStatus") as Label; if (lbl2 != null) { if (e.GetValue("IsUsed") != null) { bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed")); if (strStatus) { lbl2.Text = "Đã cấp"; } else { lbl2.Text = "Đã xóa"; } } else { lbl2.Text = "Đã cấp"; } } } }
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 = 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 (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 == 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ã"; } } }