Пример #1
0
        public void InsertPatientInsurance(string currUser, PatientInsuranceModel oClass)
        {
            strSql = strSql + "INSERT INTO " + TABLE_PATIENT_INSURANCE + " (" +
                     COLUMN_PATIENT_NO + ", " +
                     COLUMN_INSURANCE_ID + ", " +
                     COLUMN_START_DATE + ", " +
                     COLUMN_EXPIRATION_DATE + ", " +
                     COLUMN_POLICY_NO + ", " +
                     COLUMN_MEMBERSHIP_TYPE + ", " +
                     COLUMN_PRINCIPAL_PATIENT_NO + ", " +
                     COLUMN_EMPLOYEE_NO + ", " +
                     COLUMN_COMPANY + ", " +
                     COLUMN_NOTES + ", " +
                     "created_by, created_date, updated_by, updated_date) ";

            strSql = strSql + "values ('" +
                     oClass.PatientNo + "', '" +
                     oClass.InsuranceID + "', '" +
                     oClass.StartDate.ToString("yyyy-MM-d HH:MM:ss") + "', '" +
                     oClass.ExpirationDate.ToString("yyyy-MM-d HH:MM:ss") + "', '" +
                     oClass.PolicyNo + "', '" +
                     oClass.MembershipType.Replace("'", "") + "', '" +
                     oClass.PrincipalPatientNo + "', '" +
                     oClass.EmployeeNo + "', '" +
                     oClass.Company.Replace("'", "") + "', '" +
                     oClass.Notes.Replace("'", "") + "', '" +
                     currUser + "', " +
                     "CurDate(), '" +
                     currUser + "', " +
                     "CurDate() " +
                     ") ";

            SaveData(strSql);
        }
Пример #2
0
        private void PopulatePatientInsurance(string patientNo)
        {
            MembershipType.Value = "Principal";
            PatientInsuranceDAL   patInsurance      = new PatientInsuranceDAL();
            PatientInsuranceModel patInsuranceModel = new PatientInsuranceModel();

            oDs = new DataSet();

            patInsuranceModel.PatientNo = patientNo;
            oDs = patInsurance.SelectByPatientNo(patInsuranceModel);
            if (oDs != null)
            {
                if (oDs.Tables[0].Rows.Count > 0)
                {
                    ddlInsuranceCompany.SelectedValue = oDs.Tables[0].Rows[0][2].ToString();
                    txtDateStart.Value   = oDs.Tables[0].Rows[0][3].ToString();
                    txtDateExpire.Value  = oDs.Tables[0].Rows[0][4].ToString();
                    txtPolicyNo.Value    = oDs.Tables[0].Rows[0][5].ToString();
                    MembershipType.Value = oDs.Tables[0].Rows[0][6].ToString();
                    txtEmployeeNo.Value  = oDs.Tables[0].Rows[0][9].ToString();
                    txtCompany.Value     = oDs.Tables[0].Rows[0][10].ToString();
                    Remarks.Value        = oDs.Tables[0].Rows[0][8].ToString();
                }
            }
        }
Пример #3
0
        public DataSet SelectByPatientNo(PatientInsuranceModel oClass)
        {
            strSql = "SELECT * " +
                     "FROM " + TABLE_PATIENT_INSURANCE + " " +
                     "WHERE " + COLUMN_PATIENT_NO + " = '" + oClass.PatientNo + "' ";

            return(Select(strSql));
        }
Пример #4
0
        public DataSet SelectByPatientInsuranceID(PatientInsuranceModel oClass)
        {
            strSql = "SELECT * " +
                     "FROM " + TABLE_PATIENT_INSURANCE + " " +
                     "WHERE " + COLUMN_ID + " = '" + oClass.ID + "' AND IsDeleted <> 1 ";

            return(Select(strSql));
        }
Пример #5
0
        public void DeletePatient(string user, PatientInsuranceModel oClass)
        {
            strSql = "UPDATE " + TABLE_PATIENT_INSURANCE + " SET " +
                     " isDeleted = 1, " +
                     " ReasonDelete = '" + oClass.ReasonDelete.Replace("'", "''") + "', " +
                     " updated_by = '" + user + "', " +
                     " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " +
                     " WHERE " + COLUMN_ID + " = '" + oClass.ID + "' ";

            SaveData(strSql);
        }
Пример #6
0
        public void UpdatePatient(string user, PatientInsuranceModel oClass)
        {
            strSql = "UPDATE " + TABLE_PATIENT_INSURANCE + " SET " +
                     COLUMN_PATIENT_NO + " = '" + oClass.PatientNo.Replace("'", "''") + "', " +
                     COLUMN_INSURANCE_ID + " = '" + oClass.InsuranceID + "', " +
                     COLUMN_START_DATE + " = '" + oClass.StartDate.ToString("yyyy-MM-d HH:MM:ss") + "', " +
                     COLUMN_EXPIRATION_DATE + " = '" + oClass.ExpirationDate.ToString("yyyy-MM-d HH:MM:ss") + "', " +
                     COLUMN_POLICY_NO + " = '" + oClass.PolicyNo + "', " +
                     COLUMN_MEMBERSHIP_TYPE + " = '" + oClass.MembershipType + "', " +
                     COLUMN_PRINCIPAL_PATIENT_NO + " = '" + oClass.PrincipalPatientNo + "', " +
                     COLUMN_EMPLOYEE_NO + " = '" + oClass.EmployeeNo + "', " +
                     COLUMN_COMPANY + " = '" + oClass.Company.Replace("'", "''") + "', " +
                     COLUMN_NOTES + " = '" + oClass.Notes.Replace("'", "''") + "', " +
                     " updated_by = '" + user + "', " +
                     " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " +
                     " WHERE " + COLUMN_ID + " = '" + oClass.ID + "' ";

            SaveData(strSql);
        }
Пример #7
0
        private void SaveInsurance()
        {
            PatientInsuranceDAL   patInsurance      = new PatientInsuranceDAL();
            PatientInsuranceModel patInsuranceModel = new PatientInsuranceModel();

            string sUserName = Session["User"].ToString();

            patInsuranceModel.PatientNo          = PatientNo.Value;
            patInsuranceModel.InsuranceID        = Convert.ToInt16(ddlInsuranceCompany.SelectedValue);
            patInsuranceModel.StartDate          = Convert.ToDateTime(txtDateStart.Value);
            patInsuranceModel.ExpirationDate     = Convert.ToDateTime(txtDateExpire.Value);
            patInsuranceModel.PolicyNo           = txtPolicyNo.Value;
            patInsuranceModel.MembershipType     = MembershipType.Value;
            patInsuranceModel.PrincipalPatientNo = "";
            patInsuranceModel.EmployeeNo         = txtEmployeeNo.Value;
            patInsuranceModel.Company            = txtCompany.Value;
            patInsuranceModel.Notes = Remarks.Value;

            patInsurance.InsertPatientInsurance(sUserName, patInsuranceModel);
        }