Beispiel #1
0
        /* последовательная версия*/
        public void UpdateProtocol(CProtocol protocol, DateTime date) 
        {

            conn.Open();

            NpgsqlTransaction t = conn.BeginTransaction();
            NpgsqlCommand comm = new NpgsqlCommand("\"UpdateProtocol\"", conn);

            NpgsqlParameter pid = new NpgsqlParameter("pid", NpgsqlTypes.NpgsqlDbType.Integer);
            NpgsqlParameter dat = new NpgsqlParameter("dat", NpgsqlTypes.NpgsqlDbType.Date);
            NpgsqlParameter text = new NpgsqlParameter("text", NpgsqlTypes.NpgsqlDbType.Varchar);


            pid.Direction = ParameterDirection.Input;
            dat.Direction = ParameterDirection.Input;
            text.Direction = ParameterDirection.Input;


            comm.Parameters.Add(pid);
            comm.Parameters.Add(dat);
            comm.Parameters.Add(text);

            comm.Parameters[0].Value = protocol.sid;
            comm.Parameters[1].Value = date.Date;
            comm.Parameters[2].Value = protocol.text;

            comm.CommandType = CommandType.StoredProcedure;

            try
            {
                var result = comm.ExecuteScalar();
                //protocol.text = (string)result;

            }
            finally
            {
                t.Commit();
                conn.Close();


            }
            return;  // ???
        
        }
Beispiel #2
0
        public void FillProtocol(CProtocol protocol) 
        {
            conn.Open();
            NpgsqlTransaction t = conn.BeginTransaction();
            NpgsqlCommand comm = new NpgsqlCommand("\"FillProtocol\"", conn);

            NpgsqlParameter prid = new NpgsqlParameter("prid", NpgsqlTypes.NpgsqlDbType.Integer);
            NpgsqlParameter sid = new NpgsqlParameter("sid", NpgsqlTypes.NpgsqlDbType.Integer);
            // NpgsqlParameter txt = new NpgsqlParameter("txt", NpgsqlTypes.NpgsqlDbType.Text);
         
            prid.Direction = ParameterDirection.Input;
            sid.Direction = ParameterDirection.Input;
            //txt.Direction = ParameterDirection.Input;
       
            comm.Parameters.Add(prid);
            comm.Parameters.Add(sid);
           // comm.Parameters.Add(txt);

            comm.Parameters[0].Value = protocol.prid;
            comm.Parameters[1].Value = protocol.sid;
         
            comm.CommandType = CommandType.StoredProcedure;

            try
            {
                var result = comm.ExecuteScalar();
                protocol.prid = (int)result;
            }
            finally
            {
                t.Commit();
                conn.Close();
            }
        }
Beispiel #3
0
        public CStartForm()
        {   

            InitializeComponent(); // system function

            tabed_window.SelectedTab = tabPage2;
            user = new User();
            shadow = new CShadowService();

            patient = new CPatient();
            study = new CStudy();
            protocol = new CProtocol();

            patient.initials = new CInitials();
            patient.birth_date = new CBirthDate();

            shadow.win = new MakeaWindowPrm();
            shadow.sql = new SQLDaemon(FileReader(path));
            shadow.box = new CStateBox();
            shadow.box.locker = new object();
            
  
        }