⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hisformmodel_infoform.cs

📁 .net 开发的基础框架
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using SPRFrame;
using Sybase.DataWindow;

namespace HPIResource.HisForm
{
    public partial class HisFormModel_InfoForm : Form
    {
        private Form_List FM = new Form_List();

        public HisFormModel_InfoForm()
        {
            InitializeComponent();
        }

        private void HisFormModel_InfoForm_Load(object sender, EventArgs e)
        {
            string sParm = SPRF.PARM.ToString();
            int id ;
            if (sParm.Substring(0, 1) == "N")
            {
                id = 0;
                FM.SetDataById(id);
                FM.Retrieve();
                int i = FM.InsertRow(0);
                FM.SetRow(i);
                FM.TYPE = sParm.Substring(1, 6);
                FM.MODEL_STS = "0";

            }
            dw_info.LibraryList = FM.LibraryList;
            dw_info.DataWindowObject = FM.DataWindowObject;
            FM.ShareData(dw_info);
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            SPRF.PARM = null;
            this.Close();
        }

        private void btn_Save_Click(object sender, EventArgs e)
        {
            // 保存模版
            if (FM.ID == 0)
            {
                int id = SPRF.MaxId("HPIR_FORM");
                if (id <= 0)
                {
                    MessageBox.Show("错误:无法产生申请单的最大值");
                    return;
                }
                FM.ID = id;
            }
            try
            {
                FM.UpdateData();
                SPRF.SQLCA.Commit();
                SPRF.ErrText = "";
                SPRF.PARM = "OK";
                this.Close();
            }
            catch (DbErrorException ex)
            {
                SPRF.ErrText = ex.SqlErrorText;
                SPRF.SQLCA.Rollback();
                MessageBox.Show("错误:"+SPRF.ErrText);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -