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

📄 formitem_list.cs

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

using Sybase.DataWindow;

using SPRFrame;
using HPIResource;

namespace HPIResource.HisForm
{
    // 申请单项目表
    public class FormItem_List : Sybase.DataWindow.DataStore
    {
        // TYPE 1 - 单选项
        //      2 - 文字项
        //      3 - 线条
        //      4 - 文字输入框
        string strSql = "";
        public FormItem_List()
        {
            this.LibraryList = HPIR.PbdFile;
            this.DataWindowObject = "dw_formitem_list";
            this.SetTransaction(SPRF.GetDB());
            strSql = this.GetSqlSelect();
        }
        public void ResetSQL()
        {
            this.SetSqlSelect(strSql);
        }

        #region 属性
        public int ID
        {
            get
            {
                if (this.RowCount == 0) return -1;
                try
                {
                    return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "id"));
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "id", value);
            }
        }
        public int F_ID
        {
            get
            {
                if (this.RowCount == 0) return -1;
                return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "f_id"));
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "f_id", value);
            }
        }
        public string TYPE
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                return this.GetItemString(this.CurrentRow, "itemType");
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "itemType", value);
            }
        }
        public string SYNTAX_TABLE
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "tableSyntax");
                }
                catch
                {
                    return "";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "tableSyntax", value);
            }
        }
        public string SYNTAX_VIEW
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "viewSyntax");
                }
                catch
                {
                    return "";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "viewSyntax", value);
            }
        }
        public string STS_BIXUAN
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                return this.GetItemString(this.CurrentRow, "bixuan_sts");
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "bixuan_sts", value);
            }
        }
        public string STS_PISHI
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                return this.GetItemString(this.CurrentRow, "pishi_sts");
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "pishi_sts", value);
            }
        }
        public string STS_FEIYONG
        {
            // 0 - 收费,1 - 不收费
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "feiyong_sts");
                }
                catch
                {
                    return "1";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "feiyong_sts", value);
            }
        }
        public string CAPTION
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "caption");
                }
                catch
                {
                    return "";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "caption", value);
            }
        }
        public int FORM_ID
        {
            get
            {
                if (this.RowCount == 0) return -1;
                return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "form_id"));
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "form_id", value);
            }
        }
        public string VALUE
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    string s = this.GetItemString(this.CurrentRow, "itemvalue");
                    if (s != "0" && this.TYPE == "1")
                    {
                        s = "1";
                    }
                    return s;
                }
                catch
                {
                    if (this.TYPE == "1")
                    {
                        return "1";
                    }
                    else
                    {
                        return "";
                    }
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "itemvalue", value);
            }
        }
        #endregion

        #region 取数据的方法
        public void SetDataById(int iFormId,int iId)
        {
            string SqlString = this.GetSqlSelect();
            SqlString += "where Form_Id = "+iFormId.ToString()+" and id = " + iId.ToString();
            this.SetSqlSelect(SqlString);
        }
        public void SetDataByFormId(int iId)
        {
            string SqlString = this.GetSqlSelect();
            SqlString += "where form_id = " + iId.ToString();
            this.SetSqlSelect(SqlString);
        }
        public void SetDataByChild(int iFormId, int if_Id)
        {
            string SqlString = this.GetSqlSelect();
            SqlString += "where form_id = " + iFormId.ToString()+" and f_id = "+if_Id.ToString();
            this.SetSqlSelect(SqlString);
        }
        #endregion
    }
}




⌨️ 快捷键说明

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