Пример #1
0
        private void CallWebservice() //grid view diagnosis
        {
            if (Program.CurrentRegis != null)
            {
                using (Service.WS_TrakcareCls ws = new Service.WS_TrakcareCls())
                {
                    using (InhCheckupDataContext dbc = new InhCheckupDataContext())
                    {
                        int tprid = Program.CurrentRegis.tpr_id;
                        trn_patient_regi currentRegis = (from t1 in dbc.trn_patient_regis where t1.tpr_id == tprid select t1).FirstOrDefault();
                        if (currentRegis != null)
                        {
                            string HNno       = currentRegis.trn_patient.tpt_hn_no;
                            string ENno       = currentRegis.tpr_en_no;
                            string Doctorcode = Program.CurrentUser.mut_username;

                            var currentobsChief = (trn_obstetric_chief)bsObstestricChief.Current;


                            DataTable dt = ws.GetDiagnosisByDoctor("01-92-006363", "O01-12-876565", "001915668");//(HNno, ENno, Doctorcode); //
                            gvDiagnosis.AutoGenerateColumns = false;
                            foreach (DataRow dr in dt.Rows)
                            {
                                bsObstetricDiag.AddNew();
                                var pa = (trn_obstetric_diag)bsObstetricDiag.Current;
                                pa.toc_id          = currentobsChief.toc_id;
                                pa.obg_diag_code   = dr["MRCID_Code"].ToString();
                                pa.obg_diag_desc   = dr["MRCID_Desc"].ToString();
                                pa.obg_diag_type   = dr["DTYP_Desc"].ToString();
                                pa.obg_diag_date   = Convert.ToDateTime(dr["MRDIA_Date"]);
                                pa.obg_create_by   = Program.CurrentUser.mut_username;
                                pa.obg_update_by   = pa.obg_create_by;
                                pa.obg_create_date = Program.GetServerDateTime();
                                pa.obg_update_date = pa.obg_create_date;
                            }
                            //gvDiagnosis.DataSource = dt;

                            //TakeCare 2016
                            //DataTable dt2 = ws.GetMedicineByDoctor("01-92-006363", "O01-12-876565", "001915668");//(HNno, ENno, Doctorcode);//
                            //gvMedicationTreatment.AutoGenerateColumns = false;
                            //foreach (DataRow dr in dt2.Rows)
                            //{
                            //    bsObstetricMed.AddNew();
                            //    var pa = (trn_obstetric_med)bsObstetricMed.Current;
                            //    pa.toc_id = currentobsChief.toc_id;
                            //    pa.obm_med_code = dr["ARCIM_Code"].ToString();
                            //    pa.obm_med_desc = dr["ARCIM_Desc"].ToString();
                            //    pa.obm_desc = dr["PHCFR_Desc1"].ToString();
                            //    pa.obm_qty = dr["OEORI_DoseQty"].ToString();
                            //    pa.obm_unit = dr["CTUOM_Desc2"].ToString();
                            //    pa.obm_eat_unit = dr["PHCIN_Desc1"].ToString();
                            //    pa.obm_create_by = Program.CurrentUser.mut_username;
                            //    pa.obm_update_by = pa.obm_create_by;
                            //    pa.obm_create_date = Program.GetServerDateTime();
                            //    pa.obm_update_date = pa.obm_create_date;
                            //}
                            // gvMedicationTreatment.DataSource = dt2;
                        }
                    }
                }
            }
        }