private void LoadCustomer()
        {
            List <Custo> lstSource = new CustoService().SelectCustoAll();

            this.dgvCustomerList.DataSource          = lstSource;
            this.dgvCustomerList.AutoGenerateColumns = false;
        }
Ejemplo n.º 2
0
        private void FrmCheckIn_Load(object sender, EventArgs e)
        {
            txtRoomNo.Text = ucRoomList.rm_RoomNo;
            Room     r = new RoomService().SelectRoomByRoomNo(txtRoomNo.Text);
            RoomType t = new RoomTypeService().SelectRoomTypeByRoomNo(txtRoomNo.Text);

            txtType.Text         = t.RoomName;
            txtMoney.Text        = r.RoomMoney.ToString();
            txtRoomPosition.Text = r.RoomPosition;
            txtState.Text        = r.RoomState;
            List <Custo> ctos = new CustoService().SelectCustoAll();
            List <Room>  roms = new RoomService().SelectCanUseRoomAll();

            for (int i = 0; i < roms.Count; i++)
            {
                txtRoomNo.AutoCompleteCustomSource.Add(roms[i].RoomNo);
            }
            for (int j = 0; j < ctos.Count; j++)
            {
                txtCustoNo.AutoCompleteCustomSource.Add(ctos[j].CustoNo);
            }
            try
            {
                txtCustoNo.Text = "";
            }
            catch
            {
                txtCustoNo.Text = ucRoomList.rm_CustoNo;
            }
        }
Ejemplo n.º 3
0
        private void FrmChart_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.DataVisualization.Charting.Series series = new System.Windows.Forms.DataVisualization.Charting.Series("商品销售额(/元)");
            series.ChartType           = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column;
            series.BorderWidth         = 2;
            series.ShadowOffset        = 2;
            series.IsValueShownAsLabel = true;
            List <CustoSpend> custo = CustoService.SelectAllMoney();

            for (int i = 0; i < custo.Count; i++)
            {
                series.Points.AddXY(Convert.ToDouble(custo[0].Years.ToString()), Convert.ToDouble(Convert.ToDouble(custo[0].Money.ToString())));
                series.Points.AddXY(Convert.ToDouble(custo[1].Years.ToString()), Convert.ToDouble(Convert.ToDouble(custo[1].Money.ToString())));
                series.Points.AddXY(Convert.ToDouble(custo[2].Years.ToString()), Convert.ToDouble(Convert.ToDouble(custo[2].Money.ToString())));

                //series.Points.AddY(Convert.ToDouble(custo[2].Years.ToString()));
                //遍历时不需要类型转换
                // Populate new series with data
                //series.Points.AddY(Convert.ToDouble(custo[0].Money.ToString()));
                //series.Points.AddY(Convert.ToDouble(custo[1].Money));
                //series.Points.AddY(Convert.ToDouble(custo[2].Money));
            }



            // Add series into the chart's series collection
            chart1.Series.Add(series);
        }
Ejemplo n.º 4
0
        private void btnOK_BtnClick(object sender, EventArgs e)
        {
            try
            {
                if (txtCustoName.Text == "")
                {
                    MessageBox.Show("添加失败,必填信息不可为空");
                }
                else
                {
                    Custo custo = new Custo()
                    {
                        CustoNo      = txtCustoNo.Text,
                        CustoName    = txtCustoName.Text,
                        CustoSex     = cbSex.SelectedIndex,
                        CustoBirth   = dtpBirthday.Value,
                        CustoType    = cbCustoType.SelectedIndex,
                        PassportType = cbPassportType.SelectedIndex,
                        CustoID      = txtCardID.Text,
                        CustoTel     = txtTel.Text,
                        CustoAdress  = txtCustoAdress.Text
                    };
                    bool t = new CustoService().InsertCustomerInfo(custo);
                    if (t == true)
                    {
                        MessageBox.Show("添加成功");

                        #region 获取添加操作日志所需的信息
                        OperationLog o = new OperationLog();
                        o.OperationTime    = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd,HH:mm:ss"));
                        o.Operationlog     = "编号:" + LoginInfo.WorkerNo + "【" + FrmMain.wk_WorkerName + "】" + "于" + DateTime.Now + "添加了一名客户,客户编号为:" + custo.CustoNo;
                        o.OperationAccount = LoginInfo.WorkerNo;
                        o.datains_usr      = LoginInfo.WorkerNo;
                        o.datains_date     = DateTime.Now;
                        new OperationlogService().InsertOperationLog(o);
                        #endregion
                    }

                    foreach (Control Ctrol in this.Controls)
                    {
                        if (Ctrol is Sunny.UI.UITextBox)
                        {
                            Ctrol.Text = "";
                        }
                        if (Ctrol is Sunny.UI.UIComboBox)
                        {
                            this.cbSex.SelectedIndex          = 0;
                            this.cbCustoType.SelectedIndex    = 0;
                            this.cbPassportType.SelectedIndex = 0;
                        }
                    }
                }
            }
            catch
            {
            }
        }
 private void btnSerach_BtnClick(object sender, EventArgs e)
 {
     if (txtCardID.Text != "")
     {
         dgvCustomerList.DataSource = CustoService.SelectCustoInfoByCardId(txtCardID.Text);
     }
     else
     {
         MessageBox.Show("请输入证件号码!");
     }
 }
 private void btnSerach_BtnClick(object sender, EventArgs e)
 {
     if (txtCustoNo.Text != "")
     {
         //dgvCustomerList.ClearRows();
         var source = new CustoService().SelectCardInfoByCustoNo(txtCustoNo.Text);
         dgvCustomerList.DataSource          = source;
         dgvCustomerList.AutoGenerateColumns = false;
     }
     else
     {
         MessageBox.Show("请输入客户编号!");
     }
 }
Ejemplo n.º 7
0
        private void FrmSelectCustoInfo_Load(object sender, EventArgs e)
        {
            txtCustoNo.Text = ucRoomList.rm_CustoNo;
            Custo c = CustoService.SelectCustoByCustoNo(txtCustoNo.Text);

            txtAddress.Text               = c.CustoAdress;
            txtCustoName.Text             = c.CustoName;
            txtPassportNum.Text           = c.CustoID;
            txtTel.Text                   = c.CustoTel;
            cboCustoSex.Text              = c.CustoSex;
            cboCustoType.SelectedIndex    = c.CustoType;
            cboPassportType.SelectedIndex = c.PassportType;
            dtpBirth.Value                = c.CustoBirth;
        }
Ejemplo n.º 8
0
 private void txtCustoNo_Validated(object sender, EventArgs e)
 {
     try
     {
         Custo c = new CustoService().SelectCardInfoByCustoNo(txtCustoNo.Text);
         txtCustoName.Text = c.CustoName;
         txtCustoTel.Text  = c.CustoTel;
         txtCustoType.Text = c.typeName;
     }
     catch
     {
         txtCustoName.Text = "";
         txtCustoTel.Text  = "";
         txtCustoType.Text = "";
     }
 }
        private void FrmChart_Load(object sender, EventArgs e)
        {
            System.Windows.Forms.DataVisualization.Charting.Series series = new System.Windows.Forms.DataVisualization.Charting.Series("商品销售额(/元)");
            series.ChartType           = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column;
            series.BorderWidth         = 2;
            series.ShadowOffset        = 2;
            series.IsValueShownAsLabel = true;
            var custo = new CustoService().SelectAllMoney();

            for (int i = 0; i < custo.Count; i++)
            {
                series.Points.AddXY(Convert.ToDouble(custo[0].Years.ToString()), Convert.ToDouble(Convert.ToDouble(custo[0].Money.ToString())));
                series.Points.AddXY(Convert.ToDouble(custo[1].Years.ToString()), Convert.ToDouble(Convert.ToDouble(custo[1].Money.ToString())));
                series.Points.AddXY(Convert.ToDouble(custo[2].Years.ToString()), Convert.ToDouble(Convert.ToDouble(custo[2].Money.ToString())));
            }
            chart1.Series.Add(series);
        }
 private void picSearch_Click(object sender, EventArgs e)
 {
     picAddCusto.BackgroundImage = Resources.添_加a;
     picSearch.BackgroundImage   = Resources.搜索__1a;
     if (txtCardID.Text != "")
     {
         Custo c = CustoService.SelectCustoInfoByCardId(txtCardID.Text);
         if (c != null)
         {
             dgvCustomerList.DataSource = c;
         }
         else
         {
             MessageBox.Show("用户不存在!", "来自小T的提示");
         }
     }
     else
     {
         MessageBox.Show("请输入证件号码!", "来自小T的提示");
         txtCardID.Focus();
     }
 }
Ejemplo n.º 11
0
        private void FrmSelectCustoInfo_Load(object sender, EventArgs e)
        {
            #region 加载客户类型信息
            List <CustoType> lstSourceGrid = new BaseService().SelectCustoTypeAll();
            this.cbCustoType.DataSource    = lstSourceGrid;
            this.cbCustoType.DisplayMember = "TypeName";
            this.cbCustoType.ValueMember   = "UserType";
            this.cbCustoType.SelectedIndex = 0;
            this.cbCustoType.ReadOnly      = true;
            #endregion

            #region 加载证件类型信息
            List <PassPortType> passPorts = new BaseService().SelectPassPortTypeAll();
            this.cbPassportType.DataSource    = passPorts;
            this.cbPassportType.DisplayMember = "PassportName";
            this.cbPassportType.ValueMember   = "PassportId";
            this.cbPassportType.SelectedIndex = 0;
            #endregion

            #region 加载性别信息
            List <SexType> listSexType = new BaseService().SelectSexTypeAll();
            this.cbSex.DataSource    = listSexType;
            this.cbSex.DisplayMember = "sexName";
            this.cbSex.ValueMember   = "sexId";
            this.cbSex.SelectedIndex = 0;
            #endregion

            txtCustoNo.Text = ucRoomList.rm_CustoNo;
            Custo c = new CustoService().SelectCardInfoByCustoNo(txtCustoNo.Text);
            txtCustoAdress.Text          = c.CustoAdress;
            txtCustoName.Text            = c.CustoName;
            txtCardID.Text               = c.CustoID;
            txtCustoTel.Text             = c.CustoTel;
            cbSex.Text                   = c.CustoSex == 1 ? "男" : "女";
            cbCustoType.SelectedIndex    = c.CustoType;
            cbPassportType.SelectedIndex = c.PassportType;
            dtpBirthday.Value            = c.CustoBirth;
        }
 /// <summary>
 /// 根据客户编号查询客户信息
 /// </summary>
 /// <param name="cno"></param>
 /// <returns></returns>
 public static Custo SelectCustoByCustoNo(string cno)
 {
     return(CustoService.SelectCustoByCustoNo(cno));
 }
 private void LoadCustomer()
 {
     dgvCustomerList.DataSource = CustoService.SelectCustoAll();
 }
Ejemplo n.º 14
0
        private void LoadCustomer()
        {
            List <Custo> lstSource = CustoService.SelectCustoAll();

            this.dgvCustomerList.DataSource = lstSource;
        }
Ejemplo n.º 15
0
 public static int InsertCustomerInfo(Custo custo)
 {
     return(CustoService.InsertCustomerInfo(custo));
 }
Ejemplo n.º 16
0
 private void picSearch_Click_1(object sender, EventArgs e)
 {
     picAddCusto.BackgroundImage = Resources.添_加a;
     picSearch.BackgroundImage   = Resources.搜索__1a;
     dgvCustomerList.DataSource  = CustoService.SelectCustoInfoByCardId(txtSerach.Text);
 }
Ejemplo n.º 17
0
        private void FrmCheckOutForm_Load(object sender, EventArgs e)
        {
            foreach (Control label in this.Controls)
            {
                if (label.GetType().ToString() == "Sunny.UI.UITabControlMenu")
                {
                    label.Font = UI_FontUtil.SetChildControlsFont();
                }
            }
            #region 加载客户类型信息
            List <CustoType> lstSourceGrid = new BaseService().SelectCustoTypeAll();
            this.cboCustoType.DataSource    = lstSourceGrid;
            this.cboCustoType.DisplayMember = "TypeName";
            this.cboCustoType.ValueMember   = "UserType";
            this.cboCustoType.SelectedIndex = 0;
            this.cboCustoType.ReadOnly      = true;
            #endregion

            #region 加载证件类型信息
            List <PassPortType> passPorts = new BaseService().SelectPassPortTypeAll();
            this.cboPassportType.DataSource    = passPorts;
            this.cboPassportType.DisplayMember = "PassportName";
            this.cboPassportType.ValueMember   = "PassportId";
            this.cboPassportType.SelectedIndex = 0;
            #endregion

            #region 加载性别信息
            List <SexType> listSexType = new BaseService().SelectSexTypeAll();
            this.cboCustoSex.DataSource    = listSexType;
            this.cboCustoSex.DisplayMember = "sexName";
            this.cboCustoSex.ValueMember   = "sexId";
            this.cboCustoSex.SelectedIndex = 0;
            #endregion

            double sum = 0;
            txtCustoNo.Text = ucRoomList.rm_CustoNo;
            CustoNo.Text    = ucRoomList.rm_CustoNo;
            txtRoomNo.Text  = ucRoomList.rm_RoomNo;
            string rn = txtRoomNo.Text.ToString();
            string rs = rn.Substring(0, 2);

            if (ucRoomList.co_CheckTime == null)
            {
                dtpCheckTime.Text = DateTime.Now.ToString("yyyy年MM月dd日");
            }
            else
            {
                dtpCheckTime.Text = Convert.ToDateTime(ucRoomList.co_CheckTime).ToString("yyyy年MM月dd日");
            }
            if (rs == "BD")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(new RoomService().DayByRoomNo(txtRoomNo.Text).ToString()) * 300));
            }
            if (rs == "BS")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(new RoomService().DayByRoomNo(txtRoomNo.Text).ToString()) * 425));
            }
            if (rs == "HD")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(new RoomService().DayByRoomNo(txtRoomNo.Text).ToString()) * 625));
            }
            if (rs == "HS")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(new RoomService().DayByRoomNo(txtRoomNo.Text).ToString()) * 660));
            }
            if (rs == "QL")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(new RoomService().DayByRoomNo(txtRoomNo.Text).ToString()) * 845));
            }
            if (rs == "ZT")
            {
                sum = Convert.ToDouble(Convert.ToString(Convert.ToInt32(new RoomService().DayByRoomNo(txtRoomNo.Text).ToString()) * 1080));
            }
            lblDay.Text = Convert.ToString(Convert.ToInt32(new RoomService().DayByRoomNo(txtRoomNo.Text).ToString()));
            w           = new Wti()
            {
                CustoNo  = txtCustoNo.Text,
                EndDate  = Convert.ToDateTime(DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))),
                PowerUse = Convert.ToDecimal(Convert.ToInt32(new RoomService().DayByRoomNo(txtRoomNo.Text).ToString()) * 3 * 1),
                WaterUse = Convert.ToDecimal(Convert.ToDouble(new RoomService().DayByRoomNo(txtRoomNo.Text).ToString()) * 80 * 0.002),
                RoomNo   = txtRoomNo.Text,
                Record   = "admin",
                UseDate  = Convert.ToDateTime(DateTime.Parse(dtpCheckTime.Text)),
            };

            #region 加载客户信息
            Custo cto = new CustoService().SelectCardInfoByCustoNo(CustoNo.Text.ToString());
            try
            {
                CustoName.Text                = cto.CustoName;
                txtCustoName.Text             = cto.CustoName;
                txtTel.Text                   = cto.CustoTel;
                cboCustoSex.SelectedIndex     = cto.CustoSex;
                cboCustoType.SelectedIndex    = cto.CustoType;
                cboPassportType.SelectedIndex = cto.PassportType;
                dtpBirth.Value                = cto.CustoBirth;
                txtPassportNum.Text           = cto.CustoID;
            }
            catch
            {
            }


            #endregion

            #region 加载消费信息
            string RoomNo = txtRoomNo.Text;
            dgvSpendList.DataSource          = new SpendService().SelectSpendInfoRoomNo(RoomNo);
            dgvSpendList.AutoGenerateColumns = false;
            double result = 0;
            if (dgvSpendList.Rows.Count == 0)
            {
                result = 0;
            }
            else
            {
                result = Convert.ToDouble(new SpendService().SelectMoneyByRoomNoAndTime(RoomNo, CustoNo.Text.ToString()));
            }

            #endregion

            #region 加载水电费信息
            var listWti = new WtiService().SelectWtiInfoAll();
            dgvWti.DataSource          = listWti;
            dgvWti.AutoGenerateColumns = false;
            #endregion

            if (cboCustoType.Text == "钻石会员")
            {
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m * 0.60);
                lblVIP.Text         = "六折";
            }
            else if (cboCustoType.Text == "白金会员")
            {
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m * 0.80);
                lblVIP.Text         = "八折";
            }
            else if (cboCustoType.Text == "黄金会员")
            {
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m * 0.90);
                lblVIP.Text         = "九折";
            }
            else if (cboCustoType.Text == "普通会员")
            {
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m * 0.95);
                lblVIP.Text         = "九五折";
            }
            else if (cboCustoType.Text == "普通用户")
            {
                //39525
                double m = result + sum;
                lblGetReceipts.Text = m.ToString();
                lblVIPPrice.Text    = Convert.ToString(m);
                lblVIP.Text         = "不  打  折";
            }
        }
Ejemplo n.º 18
0
        private void FrmCheckOutForm_Load(object sender, EventArgs e)
        {
            txtCustoNo.Text = ucRoomList.rm_CustoNo;
            CustoNo.Text    = ucRoomList.rm_CustoNo;
            txtRoomNo.Text  = ucRoomList.rm_RoomNo;
            CmpSetDgv();
            try
            {
                dtpCheckTime.Value = DateTime.Now;
            }
            catch
            {
                dtpCheckTime.Value = Convert.ToDateTime(ucRoomList.rm_CheckTime);
            }

            lblDay.Text = Convert.ToString(Convert.ToInt32(RoomService.DayByRoomNo(txtRoomNo.Text).ToString()));

            #region 加载客户信息
            Custo cto = CustoService.SelectCustoByCustoNo(CustoNo.Text.ToString());
            CustoName.Text                = cto.CustoName;
            txtCustoName.Text             = cto.CustoName;
            txtTel.Text                   = cto.CustoTel;
            cboCustoSex.Text              = cto.CustoSex;
            cboCustoType.SelectedIndex    = cto.CustoType;
            cboPassportType.SelectedIndex = cto.PassportType;
            dtpBirth.Value                = cto.CustoBirth;
            txtPassportNum.Text           = cto.CustoID;
            #endregion

            #region 加载消费信息
            string RoomNo = txtRoomNo.Text;
            dgvSpendList.DataSource          = SpendService.SelectSpendInfoRoomNo(RoomNo);
            dgvSpendList.AutoGenerateColumns = false;
            lblGetReceipts.Text = SpendService.SelectMoneyByRoomNoAndTime(RoomNo).ToString();
            #endregion

            if (cboCustoType.Text == "钻石会员")
            {
                double m = Convert.ToDouble(Convert.ToDecimal(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDecimal(m * 0.60));
                lblVIP.Text      = "六折";
            }
            else if (cboCustoType.Text == "白金会员")
            {
                double m = Convert.ToDouble(Convert.ToDecimal(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDecimal(m * 0.80));
                lblVIP.Text      = "八折";
            }
            else if (cboCustoType.Text == "黄金会员")
            {
                double m = Convert.ToDouble(Convert.ToDecimal(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDecimal(m * 0.90));
                lblVIP.Text      = "九折";
            }
            else if (cboCustoType.Text == "普通会员")
            {
                double m = Convert.ToDouble(Convert.ToDecimal(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDecimal(m * 0.95));
                lblVIP.Text      = "九五折";
            }
            else if (cboCustoType.Text == "普通用户")
            {
                double m = Convert.ToDouble(Convert.ToDecimal(lblGetReceipts.Text));
                lblVIPPrice.Text = Convert.ToString(Convert.ToDecimal(m));
                lblVIP.Text      = "不  打  折";
            }
        }