Beispiel #1
0
        /// <summary>
        /// 获取新增客户编号
        /// </summary>
        private void GetCustomerNo()
        {
            BLL.Argument bllArgument = new BLL.Argument();
            DataTable    dt          = bllArgument.GetList("type = '客户编号'").Tables[0];

            string str = dt.Rows[0][1].ToString();

            BLL.Customer bllCustomer = new BLL.Customer();
            txtNO.Text = str + bllCustomer.GetMaxID();
        }
Beispiel #2
0
        /// <summary>
        /// 获取新增服务编号
        /// </summary>
        private void GetServiceNo()
        {
            BLL.Argument bllArgument = new BLL.Argument();
            DataTable    dt          = bllArgument.GetList("type = '服务编号'").Tables[0];

            string str = dt.Rows[0][1].ToString();

            BLL.Service bllService = new BLL.Service();
            txtNO.Text = str + bllService.GetMaxID();
        }
Beispiel #3
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);
        }
Beispiel #4
0
        /// <summary>
        /// 修改信息初始化
        /// </summary>
        private void GetUpdate()
        {
            this.Text = "编辑服务记录";
            BLL.Service   bll   = new BLL.Service();
            Model.Service model = bll.GetModel(_model.GUID);

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

            string str = dt.Rows[0][1].ToString();

            txtNO.Text      = str + model.sNO;
            dtpAccept.Value = model.acceptDate ?? DateTime.Now;

            if (_guid != Guid.Empty)
            {
                GetCustomerGroupAndSelected(_guid);
            }
            cbxType.Text = model.type;

            //服务内容
            if (!string.IsNullOrEmpty(model.content) &&
                model.content.Contains('ス'))
            {
                string[] content = model.content.Split('ス');

                if (content.Length == 2)
                {
                    txtFault.Text    = content[0];
                    txtSolution.Text = content[1];
                }
            }

            txtResult.Text        = model.result;
            cbxEvaluate.Text      = model.evaluate;
            txtMaterial.Text      = model.material;
            txtMaterialMoney.Text =
                string.Format("{0:F2}", model.materialMoney);
            txtServiceMoney.Text =
                string.Format("{0:F2}", model.serviceMoney);
            txtSum.Text =
                string.Format("{0:F2}",
                              model.materialMoney + model.serviceMoney);
            cbxPayStatus.Text = model.payStatus;
            dtpSolution.Value = model.solutionDate ?? DateTime.Now;
            cbxTraffic.Text   = model.traffic;
            cbxEmployee.Text  = model.employee;
        }
Beispiel #5
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;
        }
Beispiel #6
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;
        }
Beispiel #7
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;
        }
Beispiel #8
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;
        }
Beispiel #9
0
        /// <summary>
        /// 修改信息初始化
        /// </summary>
        private void GetUpdate()
        {
            this.Text = "编辑客户信息";
            BLL.Customer   bll   = new BLL.Customer();
            Model.Customer model = bll.GetModel(_model.GUID);
            this.llblAddService.Visible = true;
            this.llblService.Visible    = true;

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

            string str = dt.Rows[0][1].ToString();

            txtNO.Text   = str + model.cNO;
            txtName.Text = model.cName;

            //获得所属客户组
            BLL.CustomerGroup bllGroup = new BLL.CustomerGroup();
            List <string>     lst      = new List <string>();

            bllGroup.GetSelected(ref lst, model.parentGUID);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxCustomerGroup.Text         = sb.ToString();
            this.cbxCustomerGroup.SelectedNode =
                (this.cbxCustomerGroup.Nodes.Find(
                     model.parentGUID.ToString(), true))[0];

            cbxIsGov.SelectedIndex = Convert.ToInt32(!model.isGov);
            txtTrade.Text          = model.trade;
            txtMan.Text            = model.cMan;
            txtTel.Text            = model.Tel;
            txtFax.Text            = model.fax;
            txtEmail.Text          = model.email;
            cbxProvince.Text       = model.province;
            cbxCity.Text           = model.city;
            cbxDistrict.Text       = model.district;
            txtQQ.Text             = model.QQ;
            txtMode.Text           = model.mode;
            txtScope.Text          = model.scope;
            txtProduct.Text        = model.product;
            txtAddress.Text        = model.addresss;
            cbxStage.Text          = model.cStage;
            cbxType.Text           = model.cType;
            cbxLevel.Text          = model.cLevel;
            cbxStatus.Text         = model.cStatus;
            txtLink1.Text          = model.link1;
            txtTel1.Text           = model.tel1;
            txtLink2.Text          = model.link2;
            txtTel2.Text           = model.tel2;
        }
Beispiel #10
0
        /// <summary>
        /// 获取新增服务编号
        /// </summary>
        private void GetServiceNo()
        {
            BLL.Argument bllArgument = new BLL.Argument();
            DataTable dt = bllArgument.GetList("type = '服务编号'").Tables[0];

            string str = dt.Rows[0][1].ToString();

            BLL.Service bllService = new BLL.Service();
            txtNO.Text = str + bllService.GetMaxID();
        }
Beispiel #11
0
        /// <summary>
        /// 修改信息初始化
        /// </summary>
        private void GetUpdate()
        {
            this.Text = "编辑服务记录";
            BLL.Service bll = new BLL.Service();
            Model.Service model = bll.GetModel(_model.GUID);

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

            string str = dt.Rows[0][1].ToString();

            txtNO.Text = str + model.sNO;
            dtpAccept.Value = model.acceptDate ?? DateTime.Now;

            if (_guid != Guid.Empty)
            {
                GetCustomerGroupAndSelected(_guid);
            }
            cbxType.Text = model.type;

            //服务内容
            if (!string.IsNullOrEmpty(model.content) &&
                model.content.Contains('ス'))
            {
                string[] content = model.content.Split('ス');

                if (content.Length == 2)
                {
                    txtFault.Text = content[0];
                    txtSolution.Text = content[1];
                }
            }

            txtResult.Text = model.result;
            cbxEvaluate.Text = model.evaluate;
            txtMaterial.Text = model.material;
            txtMaterialMoney.Text = 
                string.Format("{0:F2}", model.materialMoney);
            txtServiceMoney.Text =
                string.Format("{0:F2}", model.serviceMoney);
            txtSum.Text = 
                string.Format("{0:F2}", 
                model.materialMoney + model.serviceMoney);
            cbxPayStatus.Text = model.payStatus;
            dtpSolution.Value = model.solutionDate ?? DateTime.Now;
            cbxTraffic.Text = model.traffic;
            cbxEmployee.Text = model.employee;
        }
Beispiel #12
0
        /// <summary>
        /// 修改信息初始化
        /// </summary>
        private void GetUpdate()
        {
            this.Text = "编辑客户信息";
            BLL.Customer bll = new BLL.Customer();
            Model.Customer model = bll.GetModel(_model.GUID);
            this.llblAddService.Visible = true;
            this.llblService.Visible = true;

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

            string str = dt.Rows[0][1].ToString();

            txtNO.Text = str + model.cNO;
            txtName.Text = model.cName;

            //获得所属客户组
            BLL.CustomerGroup bllGroup = new BLL.CustomerGroup();
            List<string> lst = new List<string>();
            bllGroup.GetSelected(ref lst, model.parentGUID);

            StringBuilder sb = new StringBuilder();

            for (int i = lst.Count - 1; i > 0; i--)
            {
                sb.Append(lst[i]);
                sb.Append(this.cbxCustomerGroup.BranchSeparator);
            }

            sb.Append(lst[0]);

            this.cbxCustomerGroup.Text = sb.ToString();
            this.cbxCustomerGroup.SelectedNode = 
                (this.cbxCustomerGroup.Nodes.Find(
                model.parentGUID.ToString(), true))[0];

            cbxIsGov.SelectedIndex = Convert.ToInt32(!model.isGov);
            txtTrade.Text = model.trade;
            txtMan.Text = model.cMan;
            txtTel.Text = model.Tel;
            txtFax.Text = model.fax;
            txtEmail.Text = model.email;
            cbxProvince.Text = model.province;
            cbxCity.Text = model.city;
            cbxDistrict.Text = model.district;
            txtQQ.Text = model.QQ;
            txtMode.Text = model.mode;
            txtScope.Text = model.scope;
            txtProduct.Text = model.product;
            txtAddress.Text = model.addresss;
            cbxStage.Text = model.cStage;
            cbxType.Text = model.cType;
            cbxLevel.Text = model.cLevel;
            cbxStatus.Text = model.cStatus;
            txtLink1.Text = model.link1;
            txtTel1.Text = model.tel1;
            txtLink2.Text = model.link2;
            txtTel2.Text = model.tel2;
        }
Beispiel #13
0
        /// <summary>
        /// 获取新增客户编号
        /// </summary>
        private void GetCustomerNo()
        {
            BLL.Argument bllArgument = new BLL.Argument();
            DataTable dt = bllArgument.GetList("type = '客户编号'").Tables[0];

            string str = dt.Rows[0][1].ToString();

            BLL.Customer bllCustomer = new BLL.Customer();
            txtNO.Text = str + bllCustomer.GetMaxID();
        }