Esempio n. 1
0
        public int InsertOPDPatientTreatmentDetail(List <EntityOPDPatient> lstentOPDMaster, EntityOPDPatient entOPDMaster)
        {
            int           cnt        = 0;
            List <string> lstspNames = new List <string>();
            List <List <SqlParameter> > lstParamVals = new List <List <SqlParameter> >();
            List <SqlParameter>         lstParam;

            try
            {
                foreach (EntityOPDPatient entOPD in lstentOPDMaster)
                {
                    lstspNames.Add("sp_InsertOPDPatient");
                    lstParamVals.Add(CreateParameterOPDPatient(entOPD));
                }

                lstspNames.Add("sp_InsertOPDPatientDiagnosis");
                lstParam = new List <SqlParameter>();
                Commons.ADDParameter(ref lstParam, "@PatientCode", DbType.String, entOPDMaster.PatientCode);
                Commons.ADDParameter(ref lstParam, "@PatientName", DbType.String, entOPDMaster.PatientName);
                Commons.ADDParameter(ref lstParam, "@Injections", DbType.Int32, entOPDMaster.TotalInjections);
                Commons.ADDParameter(ref lstParam, "@InjectionCharge", DbType.Decimal, entOPDMaster.InjectionCharge);
                Commons.ADDParameter(ref lstParam, "@DressingCharge", DbType.Decimal, entOPDMaster.DressingCharge);
                Commons.ADDParameter(ref lstParam, "@RevisitCharge", DbType.Decimal, entOPDMaster.RevisitCharge);
                Commons.ADDParameter(ref lstParam, "@ConsultantCharge", DbType.Decimal, entOPDMaster.ConsultantCharge);
                Commons.ADDParameter(ref lstParam, "@TotalOPDBill", DbType.Decimal, entOPDMaster.TotalOPDBill);
                Commons.ADDParameter(ref lstParam, "@PatientVisitType", DbType.String, entOPDMaster.PatientVisitType);
                Commons.ADDParameter(ref lstParam, "@ConsultedBy", DbType.Int32, entOPDMaster.ConsultedBy);
                Commons.ADDParameter(ref lstParam, "@EntryBy", DbType.String, entOPDMaster.EntryBy);
                Commons.ADDParameter(ref lstParam, "@DiagnosisNo", DbType.String, entOPDMaster.DiagnosisCode);
                Commons.ADDParameter(ref lstParam, "@Symptoms", DbType.String, entOPDMaster.Symptoms);
                Commons.ADDParameter(ref lstParam, "@Diagnosis", DbType.String, entOPDMaster.Diagnosis);
                Commons.ADDParameter(ref lstParam, "@XRays", DbType.String, entOPDMaster.XRay);
                Commons.ADDParameter(ref lstParam, "@BloodTests", DbType.String, entOPDMaster.BloodTest);
                lstParamVals.Add(lstParam);

                lstspNames.Add("sp_CloseOPDPatient");
                lstParam = new List <SqlParameter>();
                Commons.ADDParameter(ref lstParam, "@PatientCode", DbType.String, entOPDMaster.PatientCode);
                Commons.ADDParameter(ref lstParam, "@AppointNo", DbType.Int32, entOPDMaster.AppointNO);
                lstParamVals.Add(lstParam);

                cnt = mobjDataAcces.ExecuteTransaction(lstspNames, lstParamVals);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(cnt);
        }
Esempio n. 2
0
        public int InsertMaterialInward(List <EntityMatrialInword> lstentInward, EntityMatrialInword entMaterialInward)
        {
            int           cnt       = 0;
            List <string> lstspName = new List <string>();
            List <List <SqlParameter> > lstParamVals = new List <List <SqlParameter> >();
            List <SqlParameter>         lstParam;

            try
            {
                foreach (EntityMatrialInword entInward in lstentInward)
                {
                    lstspName.Add("sp_InsertInwardDT");
                    lstParamVals.Add(CreateParameterMaterialInward(entInward));

                    lstParam = new List <SqlParameter>();
                    lstspName.Add("sp_UpdateItemByInwardDetails");
                    Commons.ADDParameter(ref lstParam, "@ItemCode", DbType.String, entInward.ItemCode);
                    Commons.ADDParameter(ref lstParam, "@Quantity", DbType.Decimal, entInward.Quantity);
                    lstParamVals.Add(lstParam);
                }
                if (!Commons.IsRecordExists("tblMaterialInwardMT", "InwardNo", entMaterialInward.InwardNo))
                {
                    lstspName.Add("sp_InsertInwardMT");
                    lstParam = new List <SqlParameter>();
                    Commons.ADDParameter(ref lstParam, "@InwardNo", DbType.String, entMaterialInward.InwardNo);
                    Commons.ADDParameter(ref lstParam, "@InwardDate", DbType.DateTime, entMaterialInward.InwardDate);
                    Commons.ADDParameter(ref lstParam, "@SupplierCode", DbType.String, entMaterialInward.SupplierCode);
                    Commons.ADDParameter(ref lstParam, "@SupplierName", DbType.String, entMaterialInward.SupplierName);
                    Commons.ADDParameter(ref lstParam, "@TotalInwardAmount", DbType.Decimal, entMaterialInward.TotalInwardAmount);
                    Commons.ADDParameter(ref lstParam, "@EntryBy", DbType.String, entMaterialInward.EntryBy);
                    lstParamVals.Add(lstParam);
                }

                lstParam = new List <SqlParameter>();
                lstspName.Add("sp_UpdateSupplierMasterOnInward");
                Commons.ADDParameter(ref lstParam, "@SupplierCode", DbType.String, entMaterialInward.SupplierCode);
                Commons.ADDParameter(ref lstParam, "@InwardAmnt", DbType.Decimal, entMaterialInward.TotalInwardAmount);
                lstParamVals.Add(lstParam);

                cnt = mobjDataAcces.ExecuteTransaction(lstspName, lstParamVals);
            }

            catch (Exception ex)
            {
                Commons.FileLog("MterialInwardBLL - insertMaterialInward(EntityMatrialInward entMaterialInward)", ex);
            }
            return(cnt);
        }
Esempio n. 3
0
        public int UpdateRequisition(List <EntityMaterialRequisition> pstentMaterialReq, EntityMaterialRequisition entRequisition)
        {
            int           cnt       = 0;
            List <string> lstspName = new List <string>();
            List <List <SqlParameter> > lstParamVals = new List <List <SqlParameter> >();
            List <SqlParameter>         lstParam;

            try
            {
                foreach (EntityMaterialRequisition entMaterialReq in pstentMaterialReq)
                {
                    lstspName.Add("sp_UpdateRerquisitonDT");
                    lstParamVals.Add(createParameterList(entMaterialReq));

                    lstParam = new List <SqlParameter>();
                    lstspName.Add("sp_UpdateItemByReqDetails");
                    Commons.ADDParameter(ref lstParam, "@ItemCode", DbType.String, entRequisition.ItemCode);
                    Commons.ADDParameter(ref lstParam, "@Quantity", DbType.Decimal, entRequisition.Qty);
                    lstParamVals.Add(lstParam);
                }

                lstspName.Add("sp_UpdateRerquisitonMT");
                lstParam = new List <SqlParameter>();
                Commons.ADDParameter(ref lstParam, "@RequisitionCode", DbType.String, entRequisition.RequisitionCode);
                Commons.ADDParameter(ref lstParam, "@RequisitionStatus", DbType.String, entRequisition.RequisitionStatus);
                lstParamVals.Add(lstParam);

                cnt = mobjDataAcces.ExecuteTransaction(lstspName, lstParamVals);
            }
            catch (Exception ex)
            {
                Commons.FileLog("RequisitionDetailsBLL - InsertRequisition(EntityRequisition entRequisition)", ex);
            }
            return(cnt);
        }
Esempio n. 4
0
        public int GetRegister(EntityRegistration ent)
        {
            int           lintcnt    = 0;
            List <string> lstspNames = new List <string>();
            List <List <SqlParameter> > lstParamVals = new List <List <SqlParameter> >();
            List <SqlParameter>         lstParam;

            try
            {
                lstParam = new List <SqlParameter>();
                Commons.ADDParameter(ref lstParam, "@UserName", DbType.String, ent.UserName);
                Commons.ADDParameter(ref lstParam, "@ConfirmPass", DbType.String, ent.ConfirmPassword);
                Commons.ADDParameter(ref lstParam, "@UserType", DbType.String, ent.UserType);
                lstspNames.Add("sp_InsertPassInLoginTable");
                lstParamVals.Add(lstParam);

                lstParam = new List <SqlParameter>();
                Commons.ADDParameter(ref lstParam, "@UserCode", DbType.String, ent.UserName);
                Commons.ADDParameter(ref lstParam, "@ConfirmPass", DbType.String, ent.ConfirmPassword);
                Commons.ADDParameter(ref lstParam, "@UserType", DbType.String, ent.UserType);
                lstspNames.Add("sp_UpdatePassInEmpMaster");
                lstParamVals.Add(lstParam);

                lintcnt = mobjDataAccess.ExecuteTransaction(lstspNames, lstParamVals);
            }
            catch (Exception ex)
            {
                Commons.FileLog("RegistrationBLL - GetRegister(EntityRegistration ent)", ex);
            }

            return(lintcnt);
        }
Esempio n. 5
0
        public int DeleteEmployee(List <EntityEmployee> lstEntEmployee)
        {
            int           cnt        = 0;
            List <string> lstspNames = new List <string>();
            List <List <SqlParameter> > lstParamVals = new List <List <SqlParameter> >();

            try
            {
                foreach (EntityEmployee entEmployee in lstEntEmployee)
                {
                    lstspNames.Add("sp_DeleteEmployee");
                    lstParamVals.Add(CreateParameterDeleteEmp(entEmployee));

                    lstspNames.Add("sp_DeleteEmployeeLogin");
                    List <SqlParameter> lstParam = new List <SqlParameter>();
                    Commons.ADDParameter(ref lstParam, "@EmpCode", DbType.String, entEmployee.EmpCode);
                    Commons.ADDParameter(ref lstParam, "@Discontinued", DbType.Boolean, entEmployee.DisContinued);
                    lstParamVals.Add(lstParam);
                }
                cnt = mobjDataAcces.ExecuteTransaction(lstspNames, lstParamVals);
            }
            catch (Exception ex)
            {
                Commons.FileLog("EmployeeBLL - DeleteEmployee(List<EntityEmployee> lstEntEmployee) ", ex);
            }
            return(cnt);
        }
        public int InsertRequisition(List <EntityMaterialRequisition> lstentRequisition, EntityMaterialRequisition entRequisition)
        {
            int           cnt        = 0;
            List <string> lstspNames = new List <string>();
            List <List <SqlParameter> > lstParamVals = new List <List <SqlParameter> >();

            try
            {
                foreach (EntityMaterialRequisition entMaterialReq in lstentRequisition)
                {
                    lstspNames.Add("sp_InsertRequisitionDT");
                    lstParamVals.Add(CreateParameterMaterialReceipt(entMaterialReq));
                }

                if (!Commons.IsRecordExists("tblMaterialRequisitionMT", "RequisitionCode", entRequisition.RequisitionCode))
                {
                    lstspNames.Add("sp_InsertRequisitionMT");
                    List <SqlParameter> lstParam = new List <SqlParameter>();
                    Commons.ADDParameter(ref lstParam, "@RequisitionCode", DbType.String, entRequisition.RequisitionCode);
                    Commons.ADDParameter(ref lstParam, "@RequisitionBy", DbType.String, entRequisition.RequisitionBy);
                    Commons.ADDParameter(ref lstParam, "@RequisitionStatus", DbType.String, entRequisition.RequisitionStatus);
                    Commons.ADDParameter(ref lstParam, "@GroupId", DbType.Int32, entRequisition.Group);
                    Commons.ADDParameter(ref lstParam, "@EntryBy", DbType.String, entRequisition.EntryBy);
                    lstParamVals.Add(lstParam);
                }
                cnt = mobjDataAcces.ExecuteTransaction(lstspNames, lstParamVals);
            }
            catch (Exception ex)
            {
                Commons.FileLog("CustomerReceiptBLL -  InsertRequisitionDT(List<EntityMaterialRequisition> lstentRequisition, EntityMaterialRequisition entRequisition)", ex);
            }
            return(cnt);
        }
Esempio n. 7
0
        public int DeleteConsultant(List <EntityConsultant> lstEntConsultant)
        {
            int           cnt        = 0;
            List <string> lstspNames = new List <string>();
            List <List <SqlParameter> > lstParamVals = new List <List <SqlParameter> >();

            try
            {
                foreach (EntityConsultant entConsultant in lstEntConsultant)
                {
                    lstspNames.Add("sp_DeleteConsultant");
                    lstParamVals.Add(CreateParameterDeleteCons(entConsultant));

                    lstspNames.Add("sp_DeleteConsultantLogin");
                    List <SqlParameter> lstParam = new List <SqlParameter>();
                    Commons.ADDParameter(ref lstParam, "@ConsCode", DbType.String, entConsultant.ConsultantCode);
                    Commons.ADDParameter(ref lstParam, "@Discontinued", DbType.Boolean, entConsultant.DisContinued);
                    lstParamVals.Add(lstParam);
                }
                cnt = mobjDataAcces.ExecuteTransaction(lstspNames, lstParamVals);
            }
            catch (Exception ex)
            {
                Commons.FileLog("ConsultantBLL - DeleteConsultant(List<EntityConsultant> lstEntConsultant) ", ex);
            }
            return(cnt);
        }
Esempio n. 8
0
        public int DeletePatient(List <EntityPatientMaster> lstentPatientMaster)
        {
            int           cnt        = 0;
            List <string> lstspNames = new List <string>();
            List <List <SqlParameter> > lstParamVals = new List <List <SqlParameter> >();

            try
            {
                foreach (EntityPatientMaster entPatient in lstentPatientMaster)
                {
                    lstspNames.Add("sp_DeletePatientMaster");
                    lstParamVals.Add(CreateParameterDeletePatient(entPatient));
                }
                cnt = mobjDataAcces.ExecuteTransaction(lstspNames, lstParamVals);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(cnt);
        }
Esempio n. 9
0
        public int DeleteItem(List <EntityItem> lstentItem)
        {
            int           cnt        = 0;
            List <string> lstspNames = new List <string>();
            List <List <SqlParameter> > lstParamVals = new List <List <SqlParameter> >();

            try
            {
                foreach (EntityItem entItem in lstentItem)
                {
                    lstspNames.Add("sp_DeleteItem");
                    lstParamVals.Add(CreateParameterDeleteItem(entItem));
                }
                cnt = mobjDataAcces.ExecuteTransaction(lstspNames, lstParamVals);
            }
            catch (Exception ex)
            {
                Commons.FileLog("ItemBLL - DeleteItem(List<EntityItem> lstEntItem) ", ex);
            }
            return(cnt);
        }