Exemplo n.º 1
0
        public void issueToken(string username, string tokenNo, string patientID, string category, string doctor, string code)
        {
            string    issue  = "INSERT INTO token (transaction_id, date, token_no, patient_id, category, doctor, token_key) VALUES ('" + username + "','" + DateTime.Today.ToString("yyyy-MM-dd") + "'," + tokenNo + ",'" + patientID + "','" + category + "','" + doctor + "'," + code + ")";
            dbconnect insert = new dbconnect();

            insert.command_nonquery(issue, insert.con);
            insert.dbclose();
        }
Exemplo n.º 2
0
        public void cancelToken(string opd)
        {
            string    query = "DELETE FROM token WHERE opd=" + opd;
            dbconnect db    = new dbconnect();

            db.command_nonquery(query, db.con);
            db.dbclose();
        }
Exemplo n.º 3
0
        public void generateStoreIndentNo()
        {
            string    query = "INSERT INTO storeindentno SET indent_no='" + DateTime.Today.ToString("yyyyMMdd") + "'";
            dbconnect db    = new dbconnect("medicines");

            db.command_nonquery(query, db.con);
            db.dbclose();
        }
Exemplo n.º 4
0
        public void generateStoreIndent(string medicineID, string medicineName, string Qty, string storeStock, string username)
        {
            string    query = "INSERT INTO storeindent SET indent_no='" + DateTime.Today.ToString("yyyyMMdd") + "', medicine_id='" + medicineID + "', medicine_name='" + medicineName + "', qty=" + Qty + ",store_stock=" + storeStock + ",date='" + DateTime.Today.ToString("yyyy-MM-dd") + "', username='******'";
            dbconnect db    = new dbconnect("medicines");

            db.command_nonquery(query, db.con);
            db.dbclose();
        }
Exemplo n.º 5
0
        public void editMedicine(string id, string name, string type)
        {
            dbconnect db    = new dbconnect("medicines");
            string    query = "UPDATE medicines SET medicine_name='" + name + "',medicine_type='" + type + "' WHERE medicine_id='" + id + "'";

            db.command_nonquery(query, db.con);
            error = db.reader;
            db.dbclose();
        }
Exemplo n.º 6
0
        public void addMedicine(string id, string name, string type, int bal, string user)
        {
            dbconnect db     = new dbconnect("medicines");
            string    query1 = "INSERT INTO medicines (medicine_id, medicine_name, medicine_type, store_stock, disp_stock, created_by) VALUES ('" + id + "','" + name + "','" + type + "'," + bal + ",0,'" + user + "')";
            // string query2 = "CREATE TABLE " + id + " (sno bigint IDENTITY(1,1) NOT NULL,office varchar(50) NULL,transaction_id varchar(50) NULL,username varchar(50) NOT NULL,sender varchar(50) NULL,receiver varchar(50) NULL,type varchar(50) NOT NULL,quantity bigint NOT NULL,store_stock bigint NOT NULL,disp_stock bigint NOT NULL,comments varchar(MAX) NOT NULL,timestamp datetime NULL)";

            string query2 = "CREATE TABLE " + id + " (sno INT( 11 ) NOT NULL AUTO_INCREMENT ,office VARCHAR( 255 ) NULL ,transaction_id VARCHAR( 255 ) NULL ,username VARCHAR( 255 ) NOT NULL ,sender VARCHAR( 255 ) NULL ,receiver VARCHAR( 255 ) NULL ,type VARCHAR( 255 ) NOT NULL ,quantity INT( 11 ) NOT NULL ,store_stock INT( 11 ) NOT NULL ,disp_stock INT( 11 ) NOT NULL ,comments VARCHAR( 255 ) NOT NULL ,timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,PRIMARY KEY (sno))";

            string query3 = "INSERT INTO " + id + "(office, transaction_id, username, sender, receiver, type, quantity, store_stock, disp_stock, comments) VALUES('store','','" + user + "','','','opening'," + bal + "," + bal + ",0,'" + DateTime.Today.ToString("yyyy-MM-dd") + "')";
            string query4 = "INSERT INTO " + id + "(office, transaction_id, username, sender, receiver, type, quantity, store_stock, disp_stock, comments) VALUES('dispensary','','" + user + "','','','opening',0,0,0,'" + DateTime.Today.ToString("yyyy-MM-dd") + "')";

            check = query2;
            db.command_nonquery(query1, db.con);
            db.command_nonquery(query2, db.con);
            error = db.reader;
            db.command_nonquery(query3, db.con);
            db.command_nonquery(query4, db.con);
            //error = db.reader;
            db.dbclose();
        }
Exemplo n.º 7
0
        // Change user Password
        public void changePassword(string username, string password)
        {
            username = GetMD5Hash(username);
            string pass = password;

            password = GetMD5Hash(password);
            dbconnect dbco = new dbconnect();
            string    qu   = "UPDATE users SET password='******', passhash='" + password + "' WHERE userhash='" + username + "'";

            dbco.command_nonquery(qu, dbco.con);
            error = dbco.reader;
            dbco.dbclose();
        }