Exemplo n.º 1
0
        /// <summary>
        /// 给定报表类型和类型字符串(Service或Customer)返回报表
        /// </summary>
        /// <typeparam name="T">报表类型</typeparam>
        /// <param name="strType">类型字符串</param>
        /// <returns></returns>
        public ReportClass GetReport <T>(string strType, string where) where T : new()
        {
            Type type = typeof(T);

            ReportClass rpt;

            if (type.IsSubclassOf(typeof(ReportClass)))
            {
                rpt = new T() as ReportClass;
            }
            else
            {
                throw new Exception("所给类型不是ReportClass的子类");
            }

            string tblName = "V_Customer";
            string fldName = "客户编号";

            if (strType != "Customer")
            {
                tblName = "V_Service";
                fldName = "服务编号";
            }

            if (where == "")
            {
                where = "1 = 1";
            }

            BLL.ViewOperator bll = new BLL.ViewOperator();
            DataSet          dst = bll.GetList(tblName,
                                               where + " ORDER BY " + fldName);

            dst.Tables[0].TableName = tblName;

            BLL.Argument bllArgument = new BLL.Argument();
            DataTable    dtbl        = bllArgument.GetList("type = '" + fldName + "'").Tables[0];

            string strNO = dtbl.Rows[0][1].ToString();

            for (int i = 0; i < dst.Tables[0].Rows.Count; i++)
            {
                dst.Tables[0].Rows[i][1] = strNO + dst.Tables[0].Rows[i][1];
            }

            rpt.SetDataSource(dst);

            return(rpt);
        }
Exemplo n.º 2
0
        public void GetData()
        {
            List <string> lst = new List <string>();

            string where = "";

            if (GUID != Guid.Empty)
            {
                GetWhere(ref lst, GUID);
                where = string.Format("parentGUID in ({0})",
                                      string.Join(",", lst.ToArray()));
            }

            BLL.ViewOperator bll = new BLL.ViewOperator();
            DataTable        dt  = bll.GetList(
                "V_Customer",
                "客户编号",
                winFormPager1.PageSize,
                winFormPager1.PageIndex,
                where).Tables[0];

            winFormPager1.RecordCount = bll.GetListCount("V_Customer", where);

            BLL.Argument bllArgument = new BLL.Argument();
            DataTable    dtbl        = bllArgument.GetList("type = '客户编号'").Tables[0];

            string strNO = dtbl.Rows[0][1].ToString();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][1] = strNO + dt.Rows[i][1];
            }

            this.dataGridView1.DataSource = dt;

            this.dataGridView1.Columns[0].Visible  = false;
            this.dataGridView1.Columns[9].Visible  = false;
            this.dataGridView1.Columns[10].Visible = false;
        }
Exemplo n.º 3
0
        public void GetData()
        {
            List<string> lst = new List<string>();

            string where = "";

            if (GUID != Guid.Empty)
            {
                GetWhere(ref lst, GUID);
                where = string.Format("parentGUID in ({0})",
                    string.Join(",", lst.ToArray()));
            }

            BLL.ViewOperator bll = new BLL.ViewOperator();
            DataTable dt = bll.GetList(
                "V_Customer", 
                "客户编号",
                winFormPager1.PageSize, 
                winFormPager1.PageIndex, 
                where).Tables[0];

            winFormPager1.RecordCount = bll.GetListCount("V_Customer", where);

            BLL.Argument bllArgument = new BLL.Argument();
            DataTable dtbl = bllArgument.GetList("type = '客户编号'").Tables[0];

            string strNO = dtbl.Rows[0][1].ToString();

            for (int i = 0; i < dt.Rows.Count; i++)
			{
                dt.Rows[i][1] = strNO + dt.Rows[i][1];
			}

            this.dataGridView1.DataSource = dt;

            this.dataGridView1.Columns[0].Visible = false;
            this.dataGridView1.Columns[9].Visible = false;
            this.dataGridView1.Columns[10].Visible = false;
        }
Exemplo n.º 4
0
        private void cbxCustomerGroup_Leave(object sender, EventArgs e)
        {
            List <string> lst = new List <string>();

            string where = "";

            if (cbxCustomerGroup.SelectedNode.Name !=
                Guid.Empty.ToString() &&
                cbxCustomerGroup.SelectedNode.Name != null)
            {
                GetWhere(ref lst, new Guid(cbxCustomerGroup.SelectedNode.Name));
                where = string.Format("parentGUID in ({0})",
                                      string.Join(",", lst.ToArray()));
            }

            BLL.ViewOperator bll = new BLL.ViewOperator();
            DataTable        dt  = bll.GetList("V_Customer", where).Tables[0];

            cbxName.DataSource    = dt;
            cbxName.DisplayMember = "客户名称";
            cbxName.ValueMember   = "GUID";
        }
Exemplo n.º 5
0
        public void GetData()
        {
            string where = "";

            if (!(GUID == Guid.Empty))
            {
                 where= "customerGUID = '" + GUID + "'";
            }

            BLL.ViewOperator bll = new BLL.ViewOperator();
            DataTable dt = bll.GetList(
                "V_Service",
                "服务编号",
                winFormPager1.PageSize,
                winFormPager1.PageIndex,
                where).Tables[0];

            winFormPager1.RecordCount = bll.GetListCount("V_Service", where);

            BLL.Argument bllArgument = new BLL.Argument();
            DataTable dtbl = bllArgument.GetList("type = '服务编号'").Tables[0];

            string strNO = dtbl.Rows[0][1].ToString();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][1] = strNO + dt.Rows[i][1];
            }

            this.dataGridView1.DataSource = dt;

            this.dataGridView1.Columns[0].Visible = false;
            this.dataGridView1.Columns[8].Visible = false;
            this.dataGridView1.Columns[9].Visible = false;
            this.dataGridView1.Columns[10].Visible = false;
        }
Exemplo n.º 6
0
        public void GetData()
        {
            string where = "";

            if (!(GUID == Guid.Empty))
            {
                where = "customerGUID = '" + GUID + "'";
            }

            BLL.ViewOperator bll = new BLL.ViewOperator();
            DataTable        dt  = bll.GetList(
                "V_Service",
                "服务编号",
                winFormPager1.PageSize,
                winFormPager1.PageIndex,
                where).Tables[0];

            winFormPager1.RecordCount = bll.GetListCount("V_Service", where);

            BLL.Argument bllArgument = new BLL.Argument();
            DataTable    dtbl        = bllArgument.GetList("type = '服务编号'").Tables[0];

            string strNO = dtbl.Rows[0][1].ToString();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i][1] = strNO + dt.Rows[i][1];
            }

            this.dataGridView1.DataSource = dt;

            this.dataGridView1.Columns[0].Visible  = false;
            this.dataGridView1.Columns[8].Visible  = false;
            this.dataGridView1.Columns[9].Visible  = false;
            this.dataGridView1.Columns[10].Visible = false;
        }
Exemplo n.º 7
0
        private void cbxCustomerGroup_Leave(object sender, EventArgs e)
        {
            List<string> lst = new List<string>();

            string where = "";

            if (cbxCustomerGroup.SelectedNode.Name !=
                Guid.Empty.ToString() &&
                cbxCustomerGroup.SelectedNode.Name != null)
            {
                GetWhere(ref lst, new Guid(cbxCustomerGroup.SelectedNode.Name));
                where = string.Format("parentGUID in ({0})",
                    string.Join(",", lst.ToArray()));
            }

            BLL.ViewOperator bll = new BLL.ViewOperator();
            DataTable dt = bll.GetList("V_Customer", where).Tables[0];

            cbxName.DataSource = dt;
            cbxName.DisplayMember = "客户名称";
            cbxName.ValueMember = "GUID";
        }