Simplfy我的C#代码的任何可能性?

时间:2017-09-29 09:23:34

标签: c# .net winforms devexpress

我正在使用C#开发winform应用程序,我需要简化。所以请帮助我任何人如何在我的代码下面的Simplfy。我在下面给出了使用代码。

try
        {
            object countnew = ((DataTable)grid_cheque.DataSource).Compute("Count(ChequeStatus)", "ChequeStatus = 'New'");
            object countIssued = ((DataTable)grid_cheque.DataSource).Compute("Count(ChequeStatus)", "ChequeStatus = 'Issued'");
            object countCancelled = ((DataTable)grid_cheque.DataSource).Compute("Count(ChequeStatus)", "ChequeStatus = 'Cancelled'");
            object countDishonour = ((DataTable)grid_cheque.DataSource).Compute("Count(ChequeStatus)", "ChequeStatus = 'DisHonour'");

            this.lblNew.Text = ERPModule.isnull(Convert.ToString(countnew), "0");
            this.lbl_Issued.Text = ERPModule.isnull(Convert.ToString(countIssued), "0");
            this.lblCancel.Text = ERPModule.isnull(Convert.ToString(countCancelled), "0");
            this.lbldishonour.Text = ERPModule.isnull(Convert.ToString(countDishonour), "0");
        }
        catch (Exception ex)
        {

        }

1 个答案:

答案 0 :(得分:0)

基于答案:

  

How can I bring my application window to the front?

Control.BringToFront会将控件带到托管控件的前面,例如,您可以在Label前面放置一个TextBox,以确保标签的空白不会遮挡TextBox的一部分。表单已从Control继承此表单,当它是MDI子表单时,它可用于更改表单的z顺序 - 即表单托管在另一个表单中。它不会在另一个应用程序前面提供表单。