| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 334 人关注过本帖
标题:谁能帮我啊
取消只看楼主 加入收藏
gududya
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2009-11-6
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
谁能帮我啊
我想把本月的收入查询出来并且算出总营业额
也可以直接联系我QQ:307619191
用的三层模式
程序代码:
Model层
namespace Model
{
    public class BetrayInFo
    {
        private int _BetrayID;
        /**
         * 卖出编号
         **/
        public int BetrayID
        {
            get { return _BetrayID; }
            set { _BetrayID = value; }
        }
        private string _BetrayName;
        /**
         * 卖出商品
         **/
        public string BetrayName
        {
            get { return _BetrayName; }
            set { _BetrayName = value; }
        }
        private string _BetrayTypes;
        /**
         * 卖出型号
         **/
        public string BetrayTypes
        {
            get { return _BetrayTypes; }
            set { _BetrayTypes = value; }
        }
        private string _BetrayType;
        /**
         * 卖出类型
         **/
        public string BetrayType
        {
            get { return _BetrayType; }
            set { _BetrayType = value; }
        }
        private int _BetrayMoney;
        /**
         * 卖出单价
         **/
        public int BetrayMoney
        {
            get { return _BetrayMoney; }
            set { _BetrayMoney = value; }
        }
        private int _BetrayMoneys;
        /**
         * 卖出总价
         **/
        public int BetrayMoneys
        {
            get { return _BetrayMoneys; }
            set { _BetrayMoneys = value; }
        }
        private int _BetrayAmount;
        /**
        * 卖出数量
        **/
        public int BetrayAmount
        {
            get { return _BetrayAmount; }
            set { _BetrayAmount = value; }
        }
        private int _BetrayMone;

        public int BetrayMone
        {
            get { return _BetrayMone; }
            set { _BetrayMone = value; }
        }
        private string _BetrayNames;
        /**
       * 购买人
       **/
        public string BetrayNames
        {
            get { return _BetrayNames; }
            set { _BetrayNames = value; }
        }
        private string _BetrayZhangTai;

        public string BetrayZhangTai
        {
            get { return _BetrayZhangTai; }
            set { _BetrayZhangTai = value; }
        }
        private DateTime _BetrayTimes;

        public DateTime BetrayTimes
        {
            get { return _BetrayTimes; }
            set { _BetrayTimes = value; }
        }
        private DateTime _BetrayTime;
        /**
        * 卖出时间
        **/
        private DateTime _BetrayTim;

        public DateTime BetrayTim
        {
            get { return _BetrayTim; }
            set { _BetrayTim = value; }
        }
        public DateTime BetrayTime
        {
            get { return _BetrayTime; }
            set { _BetrayTime = value; }
        }
        private string _Betraybeizhu;

        public string Betraybeizhu
        {
            get { return _Betraybeizhu; }
            set { _Betraybeizhu = value; }
        }
    }
DAL层
 public List<BetrayInFo> Selrcts(BetrayInFo entity)
        {
            string strSQL = "select * from Betray  where  1=1 and BetrayZhangTai='已付清'";
            List<BetrayInFo> objItems = new List<BetrayInFo>();
            if (entity != null)
            {
                strSQL = strSQL + " and  BetrayTimes between '" + entity.BetrayTimes + "' and '" + entity.BetrayTim + "'";
            }
            using (SqlDataReader rdr = SqlHelper.ExecuteReader(SqlHelper.ConnString, CommandType.Text, strSQL, null))
            {
                while (rdr.Read())
                {
                    BetrayInFo objinfo = new BetrayInFo();
                    objinfo.BetrayID = Convert.ToInt32(rdr["BetrayID"]);
                    objinfo.BetrayName = rdr["BetrayName"].ToString();
                    objinfo.BetrayTypes = rdr["BetrayTypes"].ToString();
                    objinfo.BetrayType = rdr["BetrayType"].ToString();
                    objinfo.BetrayMoney = Convert.ToInt32(rdr["BetrayMoney"]);
                    objinfo.BetrayMoneys = Convert.ToInt32(rdr["BetrayMoneys"]);
                    objinfo.BetrayMone = Convert.ToInt32(rdr["BetrayMone"]);
                    objinfo.BetrayAmount = Convert.ToInt32(rdr["BetrayAmount"]);
                    objinfo.BetrayNames = rdr["BetrayNames"].ToString();
                    objinfo.BetrayZhangTai = rdr["BetrayZhangTai"].ToString();
                    objinfo.BetrayTimes = Convert.ToDateTime(rdr["BetrayTimes"]);
                    objinfo.BetrayTime = Convert.ToDateTime(rdr["BetrayTime"]);
                    objinfo.Betraybeizhu = rdr["Betraybeizhu"].ToString();
                    objItems.Add(objinfo);
                }
            }
            return objItems;
        }

BLL层
 public static List<BetrayInFo> Selrcts(BetrayInFo entity)
        {
            BetrayDAL dal = new BetrayDAL();
            return dal.Selrcts(entity);
        }

界面层
public BetrayInFo Obinfos
        {
            get
            {
                BetrayInFo obj = new BetrayInFo();
                if (dateTimePicker3.Text != "")
                {
                    obj.BetrayTimes = dateTimePicker3.Value;
                }
                if (dateTimePicker4.Text != "")
                {
                    obj.BetrayTim = dateTimePicker4.Value;
                }
                return obj;
            }
            set
            {
                if (value != null)
                {
                    dateTimePicker3.Value = value.BetrayTimes;
                }
                if (value != null)
                {
                    dateTimePicker4.Value = value.BetrayTim;
                }
            }
        }
        private void btnJieSuan_Click(object sender, EventArgs e)
        {
            dataGridView4.DataSource = BLL.BetrayBLL.Selrcts(Obinfos);
            MessageBox.Show("执行完毕!");
        }
搜索更多相关主题的帖子: return public private 查询 
2009-11-06 10:34
快速回复:谁能帮我啊
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.040448 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved