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

📄 formfeiyong_list.cs

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

using Sybase.DataWindow;

using SPRFrame;
using HPIResource;

namespace HPIResource.HisForm
{
    // 申请单项目实际收费
    // 该数据集的检索条件已经在数据窗口中设定
    // 因此,检索数据因使用 Retrieve(参数)
    public class FormFeiyong_List : Sybase.DataWindow.DataStore
    {
        string strSql = "";

        public FormFeiyong_List()
        {
            this.LibraryList = HPIR.PbdFile;
            this.DataWindowObject = "dw_form_feiyong_list";
            this.SetTransaction(SPRF.GetDB());
            strSql = this.GetSqlSelect();
        }
        public void ResetSQL()
        {
            this.SetSqlSelect(strSql);
        }

        #region 属性
        public int FORM_ID
        {
            get
            {
                if (this.RowCount == 0) return -1;
                try
                {
                    return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "form_id"));
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "form_id", value);
            }
        }
        public int ITEM_ID
        {
            get
            {
                if (this.RowCount == 0) return -1;
                try
                {
                    return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "p_itemid"));
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "p_itemid", value);
            }
        }
        public double ITEM_PRICE
        {
            get
            {
                if (this.RowCount == 0) return -1;
                try
                {
                    return this.GetItemDouble(this.CurrentRow, "p_itemprice");
                }
                catch
                {
                    return 0.0;
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "p_itemprice", value);
            }
        }
        public string ITEM_TYPE
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "p_itemtype");
                }
                catch
                {
                    return "";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "p_itemtype", value);
            }
        }
        public string ITEM_UNIT
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "hpir_v_item_jijiadw");
                }
                catch
                {
                    return "";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "hpir_v_item_jijiadw", value);
            }
        }
        public string ITEM_NAME
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "hpir_v_item_xiangmumc");
                }
                catch
                {
                    return "";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "hpir_v_item_xiangmumc", value);
            }
        }
        public double NUM
        {
            get
            {
                if (this.RowCount == 0) return -1;
                try
                {
                    return this.GetItemDouble(this.CurrentRow, "num");
                }
                catch
                {
                    return 0;
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "num", value);
            }
        }
        public string STS_ZIFEI
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "zifei_sts");
                }
                catch
                {
                    return "1";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "zifei_sts", value);
            }
        }
        public string STS_BAOXIANJB
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "baoxianjb");
                }
                catch
                {
                    return "0";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "baoxianjb", value);
            }
        }
        public string STS_BAOXIANXZ
        {
            get
            {
                if (this.RowCount == 0) return "NoData";
                try
                {
                    return this.GetItemString(this.CurrentRow, "baoxianxz");
                }
                catch
                {
                    return "1";
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemString(this.CurrentRow, "baoxianxz", value);
            }
        }
        public int DAYS
        {
            get
            {
                if (this.RowCount == 0) return 0;
                try
                {
                    return Convert.ToInt32(this.GetItemDouble(this.CurrentRow, "days"));
                }
                catch
                {
                    return 1;
                }
            }
            set
            {
                if (this.RowCount == 0) return;
                this.SetItemDouble(this.CurrentRow, "days", value);
            }
        }

        #endregion

        #region 取数据的方法
        // 由于DataWindow.Net 的原因,多表联合后,重新设置数据窗口的SQL语法
        // 会导致数据窗口不能更新,所有一个由多表联合检索的数据窗口,如果要
        // 进行更新操作,只能用Retrieve(参数)的方法来检索数据

        //public void SetDataById(int iId)
        //{
        //    this.ResetSQL();
        //    string s = this.GetSqlSelect();
        //    int i = s.IndexOf("WHERE");
        //    if (i >= 0)
        //    {
        //        string s1 = s.Substring(0, i + 5);
        //        string s2 = s.Substring(i + 6, s.Length - i - 6);
        //        s = s1 + " ( form_id = " + iId.ToString() + " ) and " + s2;
        //    }
        //    else
        //    {
        //        s = " where form_id = " + iId.ToString();
        //    }
        //    this.SetSqlSelect(s);
        //}
        //public void SetDataByIdAndItemType(int iId, string ItemType)
        //{
        //    this.ResetSQL();
        //    string s = this.GetSqlSelect();
        //    int i = s.IndexOf("WHERE");
        //    if (i >= 0)
        //    {
        //        string s1 = s.Substring(0, i + 5);
        //        string s2 = s.Substring(i + 6, s.Length - i - 6);
        //        s = s1 + " (form_id = " + iId.ToString() + " and P_ItemType like '" + ItemType + "%' ) and " + s2;
        //    }
        //    else
        //    {
        //        s =  "  where form_id = " + iId.ToString() + " and P_ItemType like '" + ItemType + "%'  " ;
        //    }
        //    this.SetSqlSelect(s);
        //}
        #endregion
    }
}

⌨️ 快捷键说明

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