Пример #1
0
        public int SaveMedicalBill(lmsMedicalBilling objlmsMedicalBillings)
        {
            var resultId = 0;

            try
            {
                if (objlmsMedicalBillings.BILLID > 0)
                {
                    _objLabManagementEntities.lmsMedicalBillings.Attach(objlmsMedicalBillings);
                    _objLabManagementEntities.Entry(objlmsMedicalBillings).State = EntityState.Modified;
                    _objLabManagementEntities.SaveChanges();
                    return(objlmsMedicalBillings.BILLID);
                }
                _objLabManagementEntities.lmsMedicalBillings.Add(objlmsMedicalBillings);
                _objLabManagementEntities.SaveChanges();
                var result = _objLabManagementEntities.lmsMedicalBillings.ToList().LastOrDefault();
                resultId = result.BILLID;
            }
            catch (Exception ex)
            {
                _objIAppLogger.LogError(ex);
            }

            return(resultId);
        }
        public int Save(lmsOtherCaseSheet data)
        {
            var resultId = 0;

            try
            {
                if (data.OCSID > 0)
                {
                    _objLabManagementEntities.lmsOtherCaseSheets.Attach(data);
                    _objLabManagementEntities.Entry(data).State = EntityState.Modified;
                    _objLabManagementEntities.SaveChanges();
                    return(data.OCSID);
                }
                _objLabManagementEntities.lmsOtherCaseSheets.Add(data);
                _objLabManagementEntities.SaveChanges();
                var result = _objLabManagementEntities.lmsOtherCaseSheets.ToList().LastOrDefault();
                resultId = result.OCSID;
            }
            catch (Exception ex)
            {
                _objIAppLogger.LogError(ex);
            }

            return(resultId);
        }
Пример #3
0
        public int SavePatient(lmsPatientRegistration objlmsPatientRegistrations)
        {
            var resultId = 0;

            try
            {
                if (objlmsPatientRegistrations.PATIENTID > 0)
                {
                    _objLabManagementEntities.lmsPatientRegistrations.Attach(objlmsPatientRegistrations);
                    _objLabManagementEntities.Entry(objlmsPatientRegistrations).State = EntityState.Modified;
                    _objLabManagementEntities.SaveChanges();
                    return(objlmsPatientRegistrations.PATIENTID);
                }
                _objLabManagementEntities.lmsPatientRegistrations.Add(objlmsPatientRegistrations);
                _objLabManagementEntities.SaveChanges();
                resultId = _objLabManagementEntities.lmsPatientRegistrations.LastOrDefault().PATIENTID;
            }
            catch (Exception ex)
            {
                _objIAppLogger.LogError(ex);
            }

            return(resultId);
        }
Пример #4
0
        public int SaveDrug(lmsDrug objDrugMaster)
        {
            var resultId = 0;

            try
            {
                if (objDrugMaster.DRUGID > 0)
                {
                    _objLabManagementEntities.lmsDrugs.Attach(objDrugMaster);
                    _objLabManagementEntities.Entry(objDrugMaster).State = EntityState.Modified;
                    _objLabManagementEntities.SaveChanges();
                    return(objDrugMaster.DRUGID);
                }
                _objLabManagementEntities.lmsDrugs.Add(objDrugMaster);
                _objLabManagementEntities.SaveChanges();
                resultId = _objLabManagementEntities.lmsDrugs.LastOrDefault().DRUGID;
            }
            catch (Exception ex)
            {
                _objIAppLogger.LogError(ex);
            }

            return(resultId);
        }