资源简介

用的是Visual Studio 2008+SQL2000编写 只要源代码没有文档、不过药品管理系统的功能基本都实现了,大家如果觉得有用给个好评哦~!

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace medmanage
{
    public partial class AddAccount : Form
    {
        public AddAccount()
        {
            InitializeComponent();
        }

        private void label5_Click(object sender EventArgs e)
        {

        }

        private void button1_Click(object sender EventArgs e)
        {
            if (textBox6.Text.ToString() == “Admin“)
            {
                string[] m_value = new string[10];
                m_value[0] = textBox1.Text.ToString();
                m_value[1] = textBox2.Text.ToString();
                m_value[2] = textBox3.Text.ToString();
                m_value[3] = textBox4.Text.ToString();
                m_value[4] = textBox5.Text.ToString();

                if (isexist() == 0)
                {
                    int mm_id = Convert.ToInt32(m_value[0]);

                    OleDbConnection conx = new OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0; Data Source=“ + “D:\\medchine.mdb“);// Server.MapPath(NNN));

                    conx.Open();

                    string insertstr = “INSERT INTO account([id] [name] [user] [passwd] [mynote]) VALUES (“;
                    insertstr += mm_id + “‘“;
                    insertstr += m_value[1] + “‘‘“;
                    insertstr += m_value[2] + “‘‘“;
                    insertstr += m_value[3] + “‘‘“;
                    insertstr += m_value[4] + “‘)“;

                    MessageBox.Show(insertstr);

                    OleDbCommand comm = new OleDbCommand(insertstr conx);

                    int flag = comm.ExecuteNonQuery();

                    if (flag > 0)
                    {
                        //操作成功
                        conx.Close();
                        this.Close();
                        MessageBox.Show(“添加成功“);
                        //刷新数据表
                    }
                    else
                    {
                        //操作失败
                        conx.Close();
                        MessageBox.Show(“添加失败,请查找原因“);
                    }
                }
                else
                {
                    MessageBox.Show(“要添加的信息已经存在“);
                }
            }
            else
            {
                MessageBox.Show(“密匙不正确,无法添加新用户,请联系管理员“);
            }
        }
        private int isexist()
        {
            //判断要插入的数据是否存在
            int flag = 0;
            OleDbConnection conx = new OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0; Data Source=“ + “D:\\medchine.mdb“);// Server.MapPath(NNN));
            conx.Open();

            OleDbCommand command = conx.CreateCommand();

            command.CommandText = “SELECT id from account“;

            OleDbDataReader r

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        917  2011-05-24 08:53  medmanage\medmanage.sln

    ..A..H.     45568  2011-06-07 09:37  medmanage\medmanage.suo

     文件       3760  2011-05-30 10:34  medmanage\medmanage\AddAccount.cs

     文件      10038  2011-05-30 10:34  medmanage\medmanage\AddAccount.Designer.cs

     文件       5814  2011-05-30 10:34  medmanage\medmanage\AddAccount.resx

     文件       3435  2011-05-26 13:35  medmanage\medmanage\AddInformation.cs

     文件      12303  2011-05-26 13:35  medmanage\medmanage\AddInformation.Designer.cs

     文件       5814  2011-05-26 13:35  medmanage\medmanage\AddInformation.resx

     文件       3758  2011-05-26 13:35  medmanage\medmanage\AddMedchine.cs

     文件      13443  2011-05-26 13:35  medmanage\medmanage\AddMedchine.Designer.cs

     文件       5814  2011-05-26 13:35  medmanage\medmanage\AddMedchine.resx

     文件       3198  2011-05-26 13:35  medmanage\medmanage\AddPurchase.cs

     文件      10314  2011-05-26 13:35  medmanage\medmanage\AddPurchase.Designer.cs

     文件       5814  2011-05-26 13:35  medmanage\medmanage\AddPurchase.resx

     文件       3197  2011-05-29 10:13  medmanage\medmanage\AddSupply.cs

     文件       8439  2011-05-26 13:35  medmanage\medmanage\AddSupply.Designer.cs

     文件       5814  2011-05-26 13:35  medmanage\medmanage\AddSupply.resx

     文件        924  2011-05-24 19:44  medmanage\medmanage\app.config

     文件       2633  2011-05-26 18:10  medmanage\medmanage\BackUp.cs

     文件       5992  2011-05-26 18:10  medmanage\medmanage\BackUp.Designer.cs

     文件       6226  2011-05-26 18:10  medmanage\medmanage\BackUp.resx

     文件       3103  2011-05-26 16:26  medmanage\medmanage\Changecode.cs

     文件       7003  2011-05-26 16:26  medmanage\medmanage\Changecode.Designer.cs

     文件       5814  2011-05-26 16:26  medmanage\medmanage\Changecode.resx

     文件        920  2011-05-24 14:51  medmanage\medmanage\DelDateByName.cs

     文件       2543  2011-05-31 13:18  medmanage\medmanage\Login.cs

     文件       6123  2011-05-31 13:18  medmanage\medmanage\Login.Designer.cs

     文件      25412  2011-05-31 13:18  medmanage\medmanage\Login.resx

     文件       9160  2011-05-26 16:53  medmanage\medmanage\Madmanage.cs

     文件      12990  2011-05-26 13:32  medmanage\medmanage\Madmanage.Designer.cs

............此处省略75个文件信息

评论

共有 条评论