Пример #1
0
        public void templateRefresh()
        {
            List <LogisticCompanyTemplate> listItem = LogisticCompanyTemplateService.GetAllLogisticCompanyTemplate();

            gridControl1.DataSource = listItem;
            gridView1.BestFitColumns();
        }
Пример #2
0
        private void deleteTemplate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)//删除
        {
            if (gridView1.FocusedRowHandle >= 0)
            {
                string logisticCode = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "LogisticCompanyTemplateCode").ToString();

                if (ReturnType.Success == LogisticCompanyTemplateItemService.RemoveLogisticCompanyTemplateItems(logisticCode))
                {
                    if (ReturnType.Success == LogisticCompanyTemplateService.RemoveLogisticCompanyTemplate(logisticCode))
                    {
                        List <LogisticCompanyTemplate> listItem = LogisticCompanyTemplateService.GetAllLogisticCompanyTemplate();
                        gridControl1.DataSource = listItem;
                        gridView1.BestFitColumns();
                        ClearPreviewBox();
                        XtraMessageBox.Show("模版删除成功!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        XtraMessageBox.Show("模板删除出错!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
                else
                {
                    XtraMessageBox.Show("模板标签出错!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }