public bool SaveConsultation(ConsultationModel model)
        {
            try
            {
                DBResource newConnection = new DBResource();
                newConnection.DBOpen();

                SqlCommand comm = new SqlCommand();
                comm.Connection  = DBResource.conn;
                comm.CommandText = "dbo.SaveConsultation";
                comm.CommandType = CommandType.StoredProcedure;

                comm.Parameters.AddWithValue("@consultaton_id", model.ConsultatonId);
                comm.Parameters.AddWithValue("@member_code", model.MemberCOde);
                comm.Parameters.AddWithValue("@time_in", model.TimeIn);
                comm.Parameters.AddWithValue("@time_out", model.TimeOut);
                comm.Parameters.AddWithValue("@complaints", model.Complaints);
                comm.Parameters.AddWithValue("@medicine", model.Medicine);
                comm.Parameters.AddWithValue("@quantity", model.Quantity);
                comm.Parameters.AddWithValue("@disposition", model.Disposition);
                comm.Parameters.AddWithValue("@diag_code", model.DiagCode);
                comm.Parameters.AddWithValue("@created_by", model.CreatedBy);
                comm.Parameters.AddWithValue("@created_date", model.CreatedDate);

                comm.ExecuteNonQuery();
                newConnection.DBClose();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public bool  SavePatientComp(PatientComplaintModel model)
        {
            try
            {
                DBResource newConnection = new DBResource();
                newConnection.DBOpen();

                SqlCommand comm = new SqlCommand();
                comm.Connection  = DBResource.conn;
                comm.CommandText = "dbo.SavePatientComplaint";
                comm.CommandType = CommandType.StoredProcedure;

                comm.Parameters.AddWithValue("@consultaton_id", model.ConsultatonId);
                comm.Parameters.AddWithValue("@geid", model.geid);
                comm.Parameters.AddWithValue("@empname", model.EmpName);
                comm.Parameters.AddWithValue("@complaints", model.Complaints);
                comm.Parameters.AddWithValue("@created_date", model.CreatedDate);
                comm.Parameters.AddWithValue("@created_by", model.CreatedBy);
                comm.Parameters.AddWithValue("@medicine", model.Medicine);
                comm.Parameters.AddWithValue("@isAgree", model.Agree);
                comm.Parameters.AddWithValue("@company", model.Company);

                comm.ExecuteNonQuery();
                newConnection.DBClose();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #3
0
        public bool SaveEmployeeExcel()
        {
            try
            {
                DBResource newConnection = new DBResource();

                VIEW.frmProgress obj = new VIEW.frmProgress();
                obj.Show();
                for (int i = 0; i <= EmployeeCount - 1; i++)
                {
                    Application.DoEvents();
                    newConnection.DBOpen();
                    SqlCommand comm = new SqlCommand();
                    comm.Connection  = DBResource.conn;
                    comm.CommandText = "dbo.SaveListOfEmployee";
                    comm.CommandType = CommandType.StoredProcedure;

                    comm.Parameters.AddWithValue("@GEID", listMemModel[i].GEID);
                    comm.Parameters.AddWithValue("@CostCenter", listMemModel[i].CostCenter);
                    comm.Parameters.AddWithValue("@LegalVehicle", listMemModel[i].LegalVehicle);
                    comm.Parameters.AddWithValue("@MemberType", listMemModel[i].MemberType);
                    comm.Parameters.AddWithValue("@Membercode", listMemModel[i].Membercode);
                    comm.Parameters.AddWithValue("@EmployeeName", listMemModel[i].EmployeeName);
                    comm.Parameters.AddWithValue("@Sex", listMemModel[i].Sex);
                    comm.Parameters.AddWithValue("@CS", listMemModel[i].CS);
                    comm.Parameters.AddWithValue("@BirthDate", listMemModel[i].BirthDate);
                    comm.Parameters.AddWithValue("@EffectiveDate", listMemModel[i].EffectiveDate);
                    comm.Parameters.AddWithValue("@ValidityDate", listMemModel[i].ValidityDate);
                    comm.Parameters.AddWithValue("@Relation", listMemModel[i].Relation);
                    comm.Parameters.AddWithValue("@PlanDescription", listMemModel[i].PlanDescription);
                    comm.Parameters.AddWithValue("@Area", listMemModel[i].Area);

                    comm.ExecuteNonQuery();
                    comm.Dispose();
                    newConnection.DBClose();
                    SqlConnection.ClearAllPools();
                    obj.Text = "Total number of employees: " + i + " of " + EmployeeCount;
                }
                obj.Close();
                obj.Hide();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #4
0
        public bool SaveConsultation(ConsultationModel model)
        {
            try
            {
                DBResource newConnection = new DBResource();
                newConnection.DBOpen();

                SqlCommand comm = new SqlCommand();
                comm.Connection  = DBResource.conn;
                comm.CommandText = "dbo.SaveConsultation";
                comm.CommandType = CommandType.StoredProcedure;

                comm.Parameters.AddWithValue("@consultaton_id", model.ConsultatonId);
                comm.Parameters.AddWithValue("@GEID", model.GEID);
                comm.Parameters.AddWithValue("@member_code", model.MemberCode);
                comm.Parameters.AddWithValue("@time_in", model.TimeIn);
                comm.Parameters.AddWithValue("@time_out", model.TimeOut);
                comm.Parameters.AddWithValue("@complaints", model.Complaints);
                comm.Parameters.AddWithValue("@medicine", model.Medicine);
                comm.Parameters.AddWithValue("@disposition", model.Disposition);
                comm.Parameters.AddWithValue("@diag_code", model.DiagCode);

                if (Class.clsGlobal.lblrole == "Nurse")
                {
                    comm.Parameters.AddWithValue("@update_by_nurse", model.CreatedBy);
                    comm.Parameters.AddWithValue("@update_date_nurse", model.CreatedDate);
                }
                else
                {
                    comm.Parameters.AddWithValue("@update_by_doctor", model.CreatedBy);
                    comm.Parameters.AddWithValue("@update_date_doctor", model.CreatedDate);
                }

                comm.Parameters.AddWithValue("@role", Class.clsGlobal.lblrole);

                comm.ExecuteNonQuery();
                newConnection.DBClose();
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #5
0
        public bool SaveUsersInformation(UsersModel UsersModel)
        {
            try
            {
                int        result;
                DBResource newConnection = new DBResource();
                newConnection.DBOpen();

                SqlCommand comm = new SqlCommand();
                comm.Connection  = DBResource.conn;
                comm.CommandText = "dbo.SaveUserInformation";
                comm.CommandType = CommandType.StoredProcedure;

                comm.Parameters.AddWithValue("@LastName", UsersModel.lastname);
                comm.Parameters.AddWithValue("@FirstName", UsersModel.firstname);
                comm.Parameters.AddWithValue("@MiddleName", UsersModel.middlename);
                comm.Parameters.AddWithValue("@UserCode", UsersModel.usercode);
                comm.Parameters.AddWithValue("@UserPassword", UsersModel.userpass);
                comm.Parameters.AddWithValue("@Role", UsersModel.role);
                comm.Parameters.AddWithValue("@LicenseNo", UsersModel.licenseno);
                comm.Parameters.AddWithValue("@Privilege", UsersModel.privilege);
                comm.Parameters.AddWithValue("@active", UsersModel.active);
                result = comm.ExecuteNonQuery();
                newConnection.DBClose();
                if (result > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }