public void btnAddSave_Click()
    {
        btnSave_Click();
        RowSelectionModel row = this.GridPanel1.GetSelectionModel() as RowSelectionModel;

        row.ClearSelections();
        txtRowID.Text   = "";
        Textfield2.Text = "";
        Textfield3.Text = "";
        Textfield2.Focus();
    }
    public void btnSave_Click()
    {
        if (string.IsNullOrEmpty(CmbStat.Text.Trim()))
        {
            CmbStat.Text = "";
            CmbStat.Focus();
            return;
        }
        if (this.Textfield2.Text.Trim() == "")
        {
            Textfield2.Text = "";
            Textfield2.Focus();
            return;
        }
        else if (this.Textfield3.Text.Trim() == "")
        {
            Textfield3.Text = "";
            Textfield3.Focus();
            return;
        }

        DataTable dt = dal.FactoryDAL(PageHelper.ConnectionStrings, "FW_BasicData_PRINTER_SP", new List <IFields>()
        {
            dal.CreateIFields()
            .Append("Option", "check")
            .Append("prt_ROWID", txtRowID.Text)
            .Append("prt_STAT", CmbStat.SelectedItem.Value)
            .Append("prt_PrinterCode", this.Textfield2.Text.ToUpper())
            .Append("prt_PrinterName", this.Textfield3.Text.ToUpper())
        }).GetTable();

        if (int.Parse(dt.Rows[0][0].ToString().Trim()) == 1)
        {
            X.Msg.Alert("status", "Printer already exists", new JFunction()
            {
                Fn = "textResult"
            }).Show();
            return;
        }
        addSave(dt);
    }