¡¾¼ÆËã»úÈí¼þ±ÏÒµÉè¼Æ¡¿ÓÚC#ÓïÑÔºÍSQL ServerÊý¾Ý¿âµÄ³èÎïµê¹ÜÀíϵͳ ÏÂÔØ±¾ÎÄ

µÚ3Õ ϵͳʵÏÖ

3.1Éè¼ÆÖ÷½çÃæ

±¾ÏµÍ³Ö÷½çÃæÎªMainform.csÈçͼ3.1Ëùʾ:

ͼ3.1³èÎïµêϵͳÖ÷½çÃæ

3.2ÒµÎñ¹ÜÀíÄ£¿éÉè¼Æ

ÒµÎñ¹ÜÀíÄ£¿éÖ÷Òª°üÀ¨ÒµÎñ¼Ç¼£¬ÒµÎñ²éѯ£¬ÒµÎñÌí¼ÓµÈ¹¦ÄÜ¡£ÆäÖÐÒµÎñ¼Ç¼£¬°üº­Æß¸ö×ÓÑ¡Ï³èÎïÒ½ÁÆ£¬ÃÀÈÝ£¬ÃâÒߣ¬¼ÄÑø£¬¼ÄÊÛ£¬»éÅ䣬°²Ôá¡£¿ÉÒÔÑ¡Ôñ»áÔ±µÄ³èÎȻºóÑ¡ÔñÒµÎñ·ÖÀà¡¢ÒµÎñÃû³Æ¡¢ÒµÎñÔ±£¬×îºóÌí¼ÓÒµÎñ¡£È»ºó£¬¿ÉÒÔ½øÐÐÉÌÆ·²éÕÒ¡£ÐèҪעÒâµÄÊÇ£¬ÒѾ­Ìí¼ÓµÄÒµÎñÒ²¿É½øÐÐÒÆ³ý£¬²»¹ýÒÆ³ý֮ǰ£¬ÐèÈ·±£µ±Ç°ÎÞÉÌÆ·ÐÅÏ¢£¬·ñÔò»áÌáʾ£¬ÒƳýËùÓÐÉÌÆ·ºó²Å¿É½øÐÐÒµÎñÒÆ³ý¡£ÒµÎñ²éѯ¼´²é¿´³èÎïµêËùÓÐÒÑÓÐÒµÎñ¡£Ìõ¼þ²éѯ£¬¿ÉÒÔ¸ù¾ÝÒµÎñÀàÐͼ°ÒµÎñÔ±Ãû½øÐвéÕÒ¡£ÒµÎñÌí¼Ó¿ÉÒÔÌí¼ÓÉ̵êеÄÒµÎñ£¬ÒµÎñÀàÐÍÓгèÎïÒ½ÁÆ£¬ÃÀÈÝ£¬ÃâÒߣ¬¼ÄÑø£¬¼ÄÊÛ£¬»éÅ䣬°²ÔáÆß¸ö´óÀà¡££¨¼ûͼ3.2£©

ͼ3.2³èÎï»éÅäµÇ¼Ç½çÃæ

ÏÂÃæ½«½éÉÜBrmarry.csÖÐÓë½çÃæÏÔʾÏà¹ØµÄ²¿·Ö´úÂë:

1.nonvip_Click ¹ý³Ìµ±Óû§µ¥»÷¡°»áÔ±ÑéÖ¤¡±°´Å¥Ê±£¬½«´¥·¢³èÎïToolStripMenuItem1_Click ʼþ£¬¶ÔÓ¦µÄ´úÂëÈçÏ£º

private void vipseek_Click(object sender, EventArgs e) { connection = new SqlConnection(connString); command = new SqlCommand(); command.Connection = connection; string txt = vips.Text.Trim();

string sql = String.Format(\* from [shopvip] where Vipname='{0}' or Vipno = '{1}'\, txt, txt);

//ÖØÃüÃûÅжÏ

string txt0 = vips.Text.Trim();

connection0 = new SqlConnection(connString); command0 = new SqlCommand(); command0.Connection = connection0;

string sql0 = String.Format(\= '{1}'\, txt0, txt0);

connection0.Open();

command0.CommandText = sql0;

int names = (int)command0.ExecuteScalar();

connection0.Close(); if (names == 0) {

MessageBox.Show(\ÕÒ²»µ½Ëù²éѯµÄÐÅÏ¢£¬Çë¼ì²éÊäÈëÐÅÏ¢\ \»áÔ±Ñé֤ʧ°Ü\, MessageBoxButtons.OK, MessageBoxIcon.Information);}

if (names > 1) { MessageBox.Show(\²éÕÒµÄÐÕÃûÓÐÖØ¸´£¬ÇëÒÔ»áÔ±±àºÅΪÑéÖ¤¹Ø¼ü×Ö\, \ÐÅÏ¢ÖØ¸´\, MessageBoxButtons.OK, MessageBoxIcon.Information);} else{//²éÕÒÏÔʾ

try{

connection.Open(); command.CommandText = sql;

dataReader = command.ExecuteReader(); if (dataReader.Read()){

vno = dataReader[0].ToString().Trim(); string vna = dataReader[1].ToString().Trim();

MessageBox.Show(\»áÔ±ÑéÖ¤³É¹¦£¬ÇëÑ¡Ôñ³èÎï\, \ÑéÖ¤³É¹¦\, MessageBoxButtons.OK, MessageBoxIcon.Information); } }

3.3Ò©Æ·Èë¿âÄ£¿éÉè¼Æ

±¾Ä£¿é½éÉÜÒ©Æ·Èë¿â¹¦ÄÜ£¬µ±³èÎïµêҩƷȱÉÙʱ£¬ÐèÒª½øÐÐÒ©Æ·µÄ²¹³ä£¬ÏµÍ³¹Ü

ÀíÔ±°ÑÏàÓ¦ÐèÒª²¹³äµÄÒ©Æ·½øÐÐÈë¿â£¬Èç¹û±£´æ³É¹¦£¬ÔòÏÔʾ³öËùÌí¼ÓÒ©Æ·µÄËùÓÐÐÅ

Ï¢£¬Í¬Ê±£¬¿ÉÒԲ鿴ÒÑÌí¼ÓÒ©Æ·µÄÐÅÏ¢¡££¨¼ûͼ3.3£©

ͼ3.3Ò©Æ·Èë¿â½çÃæ

ÏÂÃæ½«½éÉÜ Buygoods.csÖÐÓë½çÃæÏÔʾÏà¹ØµÄ²¿·Ö´úÂë:

private void Buygoods_Load(object sender, EventArgs e)

{

goodstype.Items.Clear(); goodstype.Items.Add(\ʳƷ\); goodstype.Items.Add(\ÓÃÆ·\);

goodsunit.Items.Clear(); goodsunit.Items.Add(\Ö§\); goodsunit.Items.Add(\´ü\); goodsunit.Items.Add(\Ö»\); goodsunit.Items.Add(\Ìõ\); goodsunit.Items.Add(\ºÐ\); goodsunit.Items.Add(\¼þ\); goodsunit.Items.Add(\Ì×\); if (yp == \Ò©Æ·\) {

label1.Text = yp + \ÀàÐÍ\; label2.Text = yp + \±àºÅ\; label3.Text = yp + \Ãû³Æ\; label8.Text = yp + \Æ·ÅÆ\; label22.Text = yp + \ÖØÁ¿\; label13.Text = yp + \¹æ¸ñ\; label10.Text = yp + \±¸×¢\; this.Text = yp + \Èë¿â¹ÜÀí\

megsave.Text = \±£´æ\ + yp + \ÐÅÏ¢\; button1.Text = \²é¿´ÒÑÓÐ\ + yp; goodstype.Items.Clear(); goodstype.Items.Add(\Ò©Æ·\); goodstype.Items.Add(\ÒßÃç\); goodsunit.Items.Clear(); goodsunit.Items.Add(\Õë¼Á\); goodsunit.Items.Add(\·ÇÕë¼Á\); goodsunit.Items.Add(\ÉúÎïÖÆÒ©\);

}

goodsno.Text =

nono.Value.Year.ToString()

+

nono.Value.Month.ToString()

nono.Value.Day.ToString() +

nono.Value.Hour.ToString()

nono.Value.Minute.ToString()+nono.Value.Second.ToString();

people.Items.Clear();

+ +