基本信息
源码名称:VIP会员管理系统源码(入门级,含数据库)
源码大小:1.26M
文件格式:.zip
开发语言:C#
更新时间:2019-01-09
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 2 元 
   源码介绍


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp2.DB;
using System.Data.SqlClient;

namespace WindowsFormsApp2
{
    public partial class TianVip : Form
    {

        Class1 db = new Class1();
        DataSet ds;

        public TianVip()
        {
            InitializeComponent();
        }
        public void Chu()
        {
            string sql = "select * from vipType";
            ds = new DataSet();
            SqlDataAdapter adapter = new SqlDataAdapter(sql,db.Con);
            adapter.Fill(ds, "vipType");
            this.TxtXiaLa.DataSource = ds.Tables["vipType"];
            this.TxtXiaLa.ValueMember = "TypeId";
            this.TxtXiaLa.DisplayMember = "TypeName";
            
        }
        private void frmTianJia_Load(object sender, EventArgs e)
        {
            Chu();
        }
        public bool FeiNull()
        {
            bool i = true;
            if (this.TxtName.Text.Trim().Equals(string.Empty))
            {
                MessageBox.Show("姓名为空", "提示");
                i = false;
            }else if (this.TxtPhone.Text.Trim().Equals(string.Empty))
            {
                MessageBox.Show("电话为空", "提示");
                i = false;
            }
            return i;
        }
        public bool jieshou()
        {
            bool i = false;
            string name = this.TxtName.Text.Trim();
            int xb = 0;
            if (this.RaNan.Checked == true)
            {
                xb = 1;
            }
            else
            {
                xb = 0;
            }
            int xiala = Convert.ToInt32(this.TxtXiaLa.SelectedValue);
            string Phione = this.TxtPhone.Text.Trim();
            DateTime shengri = this.DataRi1qi.Value;
            string enmie = this.Emeln.Text;
            string sql = string.Format(@"insert into vipInfo(Name,Sex,TypeId,Phone,Birthday,Email) values('{0}',{1},{2},'{3}','{4}','{5}')",name, xb, xiala, Phione, shengri, enmie);
            int j = db.Update(sql);
            if (j > 0)
            {
                i = true;
            }
            else
            {
                i = false;
            }
            return i;
        }
        private void Bottian_Click(object sender, EventArgs e)
        {
            if (FeiNull())
            {
                if (jieshou() == true)
                {
                    MessageBox.Show("添加成功");
                }
                else
                {
                    MessageBox.Show("添加失败");
                }
            }
        }
        public bool jieshou()
        {
            bool i = false;
            string name = this.TxtName.Text.Trim();
            int xb = 0;
            if (this.RaNan.Checked == true)
            {
                xb = 1;
            }
            else
            {
                xb = 0;
            }
            int xiala = Convert.ToInt32(this.TxtXiaLa.SelectedValue);
            string Phione = this.TxtPhone.Text.Trim();
            DateTime shengri = this.DataRi1qi.Value;
            string enmie = this.Emeln.Text;
            string sql = string.Format(@"insert into vipInfo(Name,Sex,TypeId,Phone,Birthday,Email) values('{0}',{1},{2},'{3}','{4}','{5}')",name, xb, xiala, Phione, shengri, enmie);
            int j = db.Update(sql);
            if (j > 0)
            {
                i = true;
            }
            else
            {
                i = false;
            }
            return i;
        }
        private void Bottian_Click(object sender, EventArgs e)
        {
            if (FeiNull())
            {
                if (jieshou() == true)
                {
                    MessageBox.Show("添加成功");
                }
                else
                {
                    MessageBox.Show("添加失败");
                }
            }
        }
    }
}