Exemplo n.º 1
0
        /*Заполняет таблицу исследований для пришедшего пациента*/
        public void FillStudy(CStudy study) 
        {
            conn.Open();
            NpgsqlTransaction t = conn.BeginTransaction();
            NpgsqlCommand comm = new NpgsqlCommand("\"FillStudy2\"", conn);

            NpgsqlParameter pid = new NpgsqlParameter("pid", NpgsqlTypes.NpgsqlDbType.Integer);
            NpgsqlParameter sid = new NpgsqlParameter("sid", NpgsqlTypes.NpgsqlDbType.Integer);
            NpgsqlParameter mod = new NpgsqlParameter("mod", NpgsqlTypes.NpgsqlDbType.Varchar);
            NpgsqlParameter is_hosp = new NpgsqlParameter("is_hosp", NpgsqlTypes.NpgsqlDbType.Varchar);
            NpgsqlParameter dep = new NpgsqlParameter("dep", NpgsqlTypes.NpgsqlDbType.Varchar);
            NpgsqlParameter body = new NpgsqlParameter("body", NpgsqlTypes.NpgsqlDbType.Varchar);
            NpgsqlParameter role = new NpgsqlParameter("role", NpgsqlTypes.NpgsqlDbType.Integer);
            NpgsqlParameter date = new NpgsqlParameter("date", NpgsqlTypes.NpgsqlDbType.Date);

            pid.Direction = ParameterDirection.Input;
            sid.Direction = ParameterDirection.Input;
            mod.Direction = ParameterDirection.Input;
            is_hosp.Direction = ParameterDirection.Input;
            dep.Direction = ParameterDirection.Input;
            body.Direction = ParameterDirection.Input;
            role.Direction = ParameterDirection.Input;
            date.Direction = ParameterDirection.Input;

            comm.Parameters.Add(pid);
            comm.Parameters.Add(sid);
            comm.Parameters.Add(mod);
            comm.Parameters.Add(is_hosp);
            comm.Parameters.Add(dep);
            comm.Parameters.Add(body);
            comm.Parameters.Add(role);
            comm.Parameters.Add(date);

            comm.Parameters[0].Value = study.pid;   // first of all it must be in patient
            comm.Parameters[1].Value = study.sid;
            comm.Parameters[2].Value = study.modality;
            comm.Parameters[3].Value = study.is_hospital;
            comm.Parameters[4].Value = study.department;
            comm.Parameters[5].Value = study.body;
            comm.Parameters[6].Value = study.role_id;
            comm.Parameters[7].Value = study.study_date;

            comm.CommandType = CommandType.StoredProcedure;

            try
            {
                var result = comm.ExecuteScalar();
                study.sid = (int)result;
            }
            finally
            {
                t.Commit();
                conn.Close();
            }
        }
Exemplo n.º 2
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();
            
  
        }