Beispiel #1
0
        private void btn_Add_Click(object sender, EventArgs e)
        {
            FisherResult      result           = null;
            TSysConfiguration sysConfiguration = new TSysConfiguration()
            {
                ConfigurationID  = 1,
                ConfigurationKey = Guid.NewGuid().ToString(),
                IsDisabled       = false
            };
            //using(IDbConnection dbConnection = new SqlConnection(Globals.SqlConnectionString)) {
            //    result = dbConnection.Insert<TSysConfiguration>(sysConfiguration);
            //}
            //if(result.ExecResult == Result.OK) {

            //}
        }
Beispiel #2
0
        private void btn_PageClicked(object sender, EventArgs e)
        {
            int pageSize  = FisherUtil.ParseInt(tbx_PageSize.Text, 10);
            int pageIndex = FisherUtil.ParseInt(tbx_PageIndex.Text, 1);

            Button btn = (Button)sender;

            switch (btn.Name)
            {
            case "btn_FirstPage":
                pageIndex = 1;
                break;

            case "btn_PrevPage":
                pageIndex--;
                break;

            case "btn_NextPage":
                pageIndex++;
                break;

            case "btn_LastPage":
                pageIndex = totalPage;
                break;
            }
            if (pageIndex <= 0)
            {
                pageIndex = 1;
            }
            else if (pageIndex > totalPage && totalPage > 0)
            {
                pageIndex = totalPage;
            }

            //Fisher.Query<TSysConfiguration>(sqlWhere: "",pageSize: 1);

            FisherResult <TSysConfiguration> result = Fisher.Query <TSysConfiguration>(tbx_SqlCondition.Text, null, pageSize, pageIndex);

            dgv.DataSource       = result.Result;
            tbx_PageIndex.Text   = result.PageIndex.ToString();
            tbx_RecordCount.Text = result.TotalRecord.ToString();
            tbx_TotalPage.Text   = result.TotalPage.ToString();
            totalPage            = result.TotalPage;
        }
Beispiel #3
0
        private void btn_Save_Click(object sender, EventArgs e)
        {
            int id = FisherUtil.ParseInt(tbx_ConfigurationID.Text);

            TSysConfiguration configuration = new TSysConfiguration();

            if (id > 0)  // 修改
            {
                configuration.ConfigurationID = id;
            }
            configuration.ConfigurationKey = tbx_ConfigurationKey.Text;
            configuration.Value            = tbx_Value.Text;
            configuration.Remark           = tbx_Remark.Text;
            configuration.IsDisabled       = cbx_IsDisabled.Checked;

            FisherResult result = null;

            result = Fisher.Save <TSysConfiguration>(configuration);
            if (result.Success == Result.True)
            {
                Console.WriteLine(result.Pk_Id);
            }
        }